Cold Fusion 11: Variable is Undefined in session - coldfusion

Recently some users have been experiencing this error. This error doesn't appear until the user is in the application for a bit (Ranged from a couple minutes to hour and a half).
When this issue first came up, I modified the application.cfm file which contains the timeout variables. This helped one user, but now more are experiencing the same error. Below is the modified code, I exended the timeout to 200 minutes.
<CFAPPLICATION
NAME="MyApplication"
SESSIONMANAGEMENT="Yes"
sessiontimeout="#CreateTimeSpan(0,0,200,0)#"
applicationtimeout="#CreateTimeSpan(0,0,200,0)#">
My question: Users are still experiencing this timeout error within 5 minutes, after I set the timeout to 200 minutes. Can there be a variable or something that is set on the CF Admin side which overrides my timeout span? If there is not, I will need to research into this more. Any suggestions or comments are helpful, thanks.

You definitely need more info from the hosting provider. Common issues include:
They are load balancing and not using sticky sessions. So the user will have to login and create a session on each server that is part of the loadbalanced cluster.
They have a proxy or webserver in front of the ColdFusion server with configuration that alters the response from the ColdFusion server.
They have settings in the CFAdmin console that limit the application settings, as per the comments provided by TRose and Chris.

So the concern is timing out: IIS, Apache, and TomCat web services can timeout as well. For example if Apache is set to timeout in 300 seconds but Coldfusion is set to timeout in 350 the web service will always trigger beforehand (it won't matter what you do in Coldfusion Admin or Cfsettings because the web server supersedes it).
So web server timeout implementations could front run your Coldfusion to timeouts.

Related

Port blocked creating web app on AWS

I'm trying to create a web app on AWS and I'm running into port issues. I would like to have multiple apps providing different services on different ports. I've created a website (on the same instance) to receive a text query and pass it to my app on port 3000. The app listening on 3000 is written in CherryPy.
We are using a VPN to provide security for the AWS instance. When logged into the VPN, everything works fine. The web page loads, the query returns the correct data. When I disconnect from the VPN, or someone else goes to the page, the page still loads, but queries to the service time out.
I've used netstat to make sure the service is listening but I'm not sure what could be blocking traffic. I've worked through the CORS issues as evident by the fact it works when I'm signed into the VPN.
What can I check now?
When I disconnect from the VPN, or someone else goes to the page, the page still loads, but queries to the service time out.
My assumption is that the web server and the app are on the same server.
It sounds very much like the connection from web server to app is happening via a routed IP address rather than localhost. In addition to being slower, it's also hitting your firewall rules.
Configure the web server to access your app on localhost:3000 and the issue should clear up.
I actually got it working. I have an AWS instance with nginix and CherryPy. When the user goes to a web address, the nginix page loads with a form for a query string. When they submit a string, the string is POSTed to a CherryPy service running on port 3000. The CherryPy service does some computations and returns a result via JSON.
I thought I had opened up everything completely for testing, but I was having so many issues. It turned out that having CherryPy set
"Access-Control-Allow-Origin" = "*"
wasn't working, instead I needed to specifically set the origin of the calling page.

Time out error on heroku using puma server

I deployed my rails project on heroku but I am facing timeout error on heroku. I am using puma server on heroku. My project is about scraping web data using URL. I also tried webrick & unicorn server. Can anybody suggest me the solution for this problem?
Your question is lacking information about what is causing the Timeout error. As you are fetching data from other web pages, it's likely the timeout is caused by a not responding HTTP URL.
In this case, the web server you are using may be irrelevant. In fact, Heroku imposes a request timeout of 30 seconds. If your app doesn't return a response within 30 seconds, the request is terminated by Heroku. It doesn't really matter which web server you are using.
In order to solve this problem you have to
set a timeout in your code (you can use the Timeout library) to make sure that no external HTTP request takes more than a certain period of time, which must be lower than the Heroku timeout.
you may also want to move lon-running tasks away from the context of a request into async jobs that are not subject to the request timeout in Heroku. However, in order to do that you will require a background job system such as Sidekiq or Resque.

Migrating web service from ColdFusion 8 to 10 issues

I have a web service that has been running on CF 8 for awhile now without issues. We've recently moved to CF10, and this web service no longer works. I've already tried switching the Axis setting to 1, it's still tossing errors. Has anyone else encountered this, or have an ideas on what else to look for here?
Process:
CF Server sends a web service request to App Server.
App Server processes request, generates another web service back to CF Server with SOAP data pushes, then replies back to the step 1 originating request with a boolean response on how its own web service request went.
CF Server Errors:
The web service operation caused an invocation exception.The root cause was that: ClientAbortException: java.net.SocketException: Connection reset by peer: socket write error.
Cannot perform web service invocation [Method Name]. The fault returned when invoking the web service operation is: java.lang.NoClassDefFoundError: org/apache/james/mime4j/MimeException
App Server Error Logs:
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
SEVERE: SAAJ0009: Message send failed
com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Message send failed
Caused by: java.io.IOException: Error writing to server
I've gone as far as modifying the App Server configuration to have it's web service request push out to the CF 8 server for processing, while still replying back to the originating request from the CF 10 server. This worked fine. It's definitely something with the requests or my CF 10 web service config.
I can't post any of the code examples unfortunately.
24 Sept 13 Update
I've tried various combinations of v1 and v2 in the CF admin, with wsdl and wsdl2, and the application.cfc setup. The app that is interacting with this service has given me the ability to modify a variety of parameters for soap versioning and some internal items. I can get the two services to talk with a bare bones connection of give me your soap and I'll toss a YES back. Whenever I try to use the full request it seems to never actually hit my web service, and gets stopped somewhere by CF. I see no logging on it other than in the web service log.
I found the solution to my problem. The ColdFusion connector was causing the fault. After installing ColdFusion 10 and patching, I had run the wsconfig to rebuild the connector. I had either done this incorrectly, or for some reason it didn't take. I ran it this morning, removed the connector, re-added it.... everything working fine now. Very frustrating.

Unable to start event gateway instance: Event Gateway Service is not enabled

I recently migrated our server from ColdFusion 7 Enterprise to ColdFusion 10 Standard and now our event gateways aren't working. When I try to start them, it says:
Unable to start event gateway instance: Event Gateway Service is not
enabled.
I do have "Enable ColdFusion Event Gateway Services" checked in the "Gateway Settings" page. When I turn the setting on and off, it says "Event Gateway Started.". Yet it still won't start my services. When I click start, I get the "Unable to start..." error.
I've seen a few posts about this problem, on Adobe's site, but no solutions. Both threads end with a comment that "it's working now!", but do not explain how the problem was fixed.
Unable to start event gateway instance: Event Gateway Service is not enabled., (service IS enabled)
Event Gateway Service/Instance Not Working
Am I totally forgetting a setting on the server or something?
I figured it out. If you are using Standard and not Enterprise you will have to make sure you are only entering 1 in the thread. I was entering 8 like on our old server. When I was clicking update it was not really updating even though it said it was. After I updated it with 1 thread and restarted the server. It worked. I didn't even have to click start services, they came up on their own. I'm assuming since the answer was so simple why no one updated their own answer on the adobe forums, which was super annoying.
You need to start the Event Gateway Service in CF Administrator, and then will likely need to restart ColdFusion service.
This could be caused by the insufficient privileges for the the directories you're trying to watch.
Check the service account of the Coldfusion Application Server service and see if it has sufficient privileges (i.e. local system account might not have access to the directories you're trying to watch)

Windows Integrated Authentication fails ONLY if web svcs client is on same machine as IIS server

I have a web service running under IIS7 on a server with a host header set so that it receives requests made to http://myserver1.mydomain.com.
I've set Windows INtegrated Authentication to Enabled and everything else (basic, anonymous, etc) to Disabled.
I'm testing the web service using a powershell script, and it works fine when I run it from my workstation against http://myserver1.mydomain.com
However, when I run the same exact script on the IIS server itself, I get a 401-Unauthorized message.
In addition, I've tried installing the web service on a second server, myserver2.mydomain.com. Again I can call my test script fine from BOTH my workstation and from myserver1.
So it seems the only issue is when the client is on the same box as the web server itself - somehow the windows credentials are not being passed or recognized.
I tried playing with IE settings on myserver1 (checked and unchecked 'Enable Windows Integrated Authentication', and added the URL to Local Sites). That did not seem to have an effect.
When I look at the IIS logs, I see the 401 unauthorized line but very little other information.
I see basically the same behavior when testing with IE (v9) - works from my workstation but not when IE is running on the IIS server.
I found the answer after several hours:
By default, there is something called a LoopbackCheck which will reject windows authentication if the host header used for the site does not match the local host's name. This behavior will only be seen when the client is on the local host. The check is there to defeat possible reflection attacks.
More details here:
http://support.microsoft.com/kb/896861
The kb item discusses ways to disable the Loopback check, but I ended up just switching from using host headers to ports to distinguish the different sites on the IIS server.
Thanks to those who gave assistance.
Try checking the actual credential that is being passed when you are running on the server itself. Often times you will be running on some system account that doesn't have access to the resource in question.
For example, on your box your credentials are running as...
MYDOMAIN\MYNAME
and the server will be something like...
SYSTEM\SYSTEM_ACCOUNT
and so this will fail because 'SYSTEM\SYSTEM_ACCOUNT' doesn't have credentials.
If this is the case, you can fix the problem in one of two ways.
Give 'SYSTEM\SYSTEM_ACCOUNT' access to the resource in question. Most people would avoid this strategy due to security concerns (which is why the account has no access in the first place).
Impersonate, or change the credentials of the client manually to something that does have access to the resource, 'MYDOMAIN\MYNAME' for example. This is what most people would probably go with, including myself.