Coldfusion - .cfm file not found when it exists on the server - coldfusion

About 10x a day we are getting a file not found error in our Coldfusion application logs for files that EXIST on the server. The specific error is
"File not found: /rewrite.cfm The specific sequence of files included or processed is: '''' "
and the stack trace:
coldfusion.runtime.TemplateNotFoundException: File not found: /rewrite.cfm
at coldfusion.filter.PathFilter.invoke(PathFilter.java:69)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
Our server environment:
Ubuntu 10.04 LTS
Coldfusion 9.01
CFWheels
While this is happening relatively few times compared with the number of requests we are serving, this is still something I would like to figure out.
Has anyone seen this error before and can you tell me why Coldfusion randomly decides that the files is not there?
Thanks.

When I put wheels in a subdirectory I had to edit the .htaccess file and make sure that the sub directory name was in the rewrite rules.
Another time I saw this was when someone went to a domain name that wasn't in Apache so it would go to the default website and throw a weird error like that.

Are you using Apache name-based Virtual Hosts? Requests that hit the ColdFusion server by another URL (say http://localhost) will not necessarily find files in the root of a name-based vhost. I'll sometimes run into this with CF Scheduled Tasks that get set up pointing to localhost.
Can you line up the actual request in your Apache logs with the offending one in your CF logs?

We ran into a similiar issue. For us, we were running into the limit on the number of open files.
You can run:
ulimit -Hn
and
ulimit -Sn
to see the current limits for the relevant user.
Modify /etc/security/limits.conf to update the open files limit.

Unless you've changed it, "/" is an aliased directory in CF. In Windows, IIRC, this points to the document root specified in the installation process (unless modified), and I assume it is similar for Linux systems. My guess is that one of two things is happening:
CFWheels expects to be installed in the root directory, and isn't (or / isn't pointed at the install location for CFWheels)
You are trying to use / to point to a directory that is not the one aliased in CF
Try making sure that / is pointed to the colder with the missing template in the CF Administrator.

What about leaving trusted cache off for awhile, and make sure you can access the file.
Or clear the cache, and make sure the template is accessible.

Whenever I reference a file on a server, unless it's in a specific directory that gets hard-coded for some reason, I use ExpandPath... for example:
<cffile action="read" file="#ExpandPath('.')#/myfile.txt">
This assumes the file is in the same directory as the currently-executing template.

Related

Does cf cli have some kind of max concurrent connection for a single user?

I'm trying to deploy apps using with cf cli commands with jenkins, and have some weird issue now.
It works fine with 1 or 2 concurrent deployments, but if there are more than 3-4 jobs running, any cf cli command returns strange errors randomly like;
No space targeted, use 'cf target -s' to target a space.
or
Server error, status code: 404, error code: 100004, message: The app
could not be found: 0da4xxxx-9476-473a-b77d-f02xxxxxx
However, there is no issue cf cli command itself if I run each cf command one by one.
(I'm only assigned to 1 org, 1 space, so no issue to choose space/target, and app is there if I do 'cf a' later.)
I fixed the config.json issue by this comment, but still blocked by strange behavior of cf cli. Any idea?
https://stackoverflow.com/a/35247160/5862540
The cf CLI stores your configured API endpoint and access & refresh tokens in a local file, $CF_HOME/config.json.
Most cf CLI commands read this file when you invoke them, and many commands write to the file when they finish. Writing is performed for two reasons: when your access token expires, the cf CLI automatically requests a new token from UAA and updates the one in config.json. Also, we simply don't have any logic to check if any updates were made that need persisting, so the file gets written out again just in case.
So it's important to configure a different CF_HOME for any parallel executions of cf CLI commands to avoid random errors. And when your config.json is corrupted, just delete the file and configure your API endpoint & login again.

Storm Supervisors not starting after machine restart

I have been running a storm-0.8.2 cluster for over a year now. Last night AWS restarted the supervisor machines. I have tried to restart the supervisor processes manually, but upon start up I receive this error message in the logs.
014-10-15 19:48:04 supervisor [ERROR] Error on initialization of server mk-supervisor
java.net.UnknownHostException: domU-<aws internal ip>: domU-<aws internal ip>
at java.net.InetAddress.getLocalHost(InetAddress.java:1454)
at backtype.storm.util$local_hostname.invoke(util.clj:153)
at backtype.storm.daemon.supervisor$supervisor_data.invoke(supervisor.clj:181)
at backtype.storm.daemon.supervisor$fn__4729$exec_fn__1200__auto____4730.invoke(supervisor.clj:331)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:601)
at backtype.storm.daemon.supervisor$fn__4729$mk_supervisor__4754.doInvoke(supervisor.clj:327)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at backtype.storm.daemon.supervisor$_launch.invoke(supervisor.clj:477)
at backtype.storm.daemon.supervisor$_main.invoke(supervisor.clj:506)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at backtype.storm.daemon.supervisor.main(Unknown Source)
I am not a clojure expert, but it looks like on line 215 of backtype.storm.daemon.supervisor.clj, that it is possible to set the localhost name in a config file.
215 :my-hostname (if (contains? conf STORM-LOCAL-HOSTNAME)
216 (conf STORM-LOCAL-HOSTNAME)
217 (local-hostname))
Is this possible? What file do I need to set this setting in? What is the correct key for this setting?
Or am I way off base and need to do something else to get my workers to restart?
I didn't face that situation before but if I were you, I would try:
Clear the directories used by Storm (the ones your configure in conf/storm.yaml.
If the previous step didn't solve the issue, then try mapping IPs to hostnames in your OS host file.
I got help from the user mailing list (user AT storm DOT apache DOT com). You can set the local host in your conf/storm.yaml file using the key "storm.local.hostname".
Add below entry to storm.yaml file
storm.local.hostname: "localhost"

IOException when running the BAM samples

I am tryying my hands on the WSO2 BAM.
I tried to run the examples (“HTTPD Logs Analysis” or “KPI Monitoring Sample”), but I get the following message after creating the toolbox, upon the publishing of data:
java.io.IOException : Cannot run program in “C:\Program” (in directory “C:\wso2bam-2.3.0”): CreateProcess error=2 , The specified file cannot be found.
Any tips on this issue?
Some times in windows 'Programs Files' cause problem due to space in it. Therefore if you have WSO2 BAM distribution within C:\Program Files or you have space in the distribution path some where, please change it to a location without space.
And also check where your java installation is in. That also should be in a location which doesn't have space in the path.
Please check both, that will resolve your problem.

Cannot start Jetty as a service on CentOS

When I try to launch jetty-9.0.3.v20130506 as a user or a service, I get an error as follows:
2013-06-24 00:00:36.927:WARN:oejs.Holder:main:
java.lang.ClassNotFoundException: org.eclipse.jetty.servlets.CrossOriginFilter
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
When I add lib=lib to start.ini, I can run jetty as a user by launching the script. I do not understand how adding this standard location fixes it, but it does.
bin/jetty.sh start
When I try to launch jetty as a service, which uses the same script, it fails with the error given above.
It look like the start script does not use the start.ini when it is launched as a service because it does not process the lib=lib statement that solves the problem.
Can anyone offer a clear explanation as to how I can get jetty to load a CrossOriginFilter using the jars that are in the lib folder.
Alright, this one cause a LOT of pain.
you should not add this to start.ini
lib=lib
you should add this
lib=/<full path to jetty>/lib
When running as a service, the script does not apply the relative path for some reason, like it does with the other arguments in start.ini. Just use the full path.
The only thing I hate about SO is that I usually figure out the problem right after I post.
UPDATE: The solution below, adding servlets to the options, was the way to go. That was easy, but for some reason I did not see that in any other posts about the CrossOriginFilter.

CF10 / IIS7.5 - cffile read file outside of web root

CF10 on Win 2K8 with IIS 7.5. My webroot is d:\web[sitename] with [sitename] being a folder for the actual site.
I want to read a .txt file stored elsewhere - say d:\web\somefile.txt or d:\somefile.txt, but seemingly no matter what permissions I give the file or it's parent folder I keep getting a file not found error:
An error occurred when performing a file operation read on file d:/web/somefile.txt.
The cause of this exception was: java.io.FileNotFoundException: d:/web/somefile.txt (The system cannot find the file specified).
My CF service runs as a specific user and I've given that user everything from read to full control of that file and still no dice. My IIS app pool also runs as a specific user and adding permissions for it also doesn't help.
Is this something with Tomcat that I need to configure? If so, how?
You may have sandbox security enabled which is preventing CF from reading the file. Log into the CF administrator and check it that.