I have a scheduled task registered in ColdFusion 11 Admin console. ColdFusion 11 is hosted over IIS 7.5. The schedule task is to run 1 perticular file from sub application of the main app. After upgrading application from ColdFusion 9 to ColdFusion 11, scheduled task stopped working.
Note that, on IIS, main App has "Anonymous Authentication - Disabled" and "Windows Authentication - Enabled" ...
While for sub app (which is being called by scheduled task) has "Anonymous Authentication - Enabled" and "Windows Authentication - Disabled".
Moreover, when I try to run the scheduled task manually, it shows "Authentication falure" error in log file as
HTTP Error 401.2 - Unauthorized You are not authorized to view this page due to invalid authentication headers.
Any help would be greatly appriciated.
I've been fighting the identical problem since upgrading from CF8 on Windows Server 2008R2 with SSL enabled. The main CF application's folder is set for Windows Authentication This is happening on two different test servers- one running CF10 and the other running CF11, both of which had been running CF8 tasks with no problems. IIS settings for the subfolder with the scheduled task have only Anonymous authentication enabled (which is set to use the Application Pool identity that the Application Pool's identity is set to). I've set the file system permissions to allow Everybody, as well as IUSR, on the .CFM in question, and have tried using both HTTP and HTTPS forms of the URL in the scheduled task settings.
I can use the same HTTP/HTTPS URL in a browser directly (without authenticating to the server's application first) and the .CFM runs flawlessly. The CF http.log file shows Status Code=401, and saving the scheduled task output shows "IIS 7.0 Detailed Error - 401.2 - Unauthorized". What has changed in CF10 and CF11 if the underlying IIS server settings that worked before haven't changed?
I've been trying to get this corrected for the longest time and finally today I figured out a solution.
Initially I set the directory my scheduled tasks were in to anonymous access and was still getting the 401.2 error just like you both described. I set the task to send the output of the error to a text file, I coppied and pasted the file to my desktop and looked over the error information closely. It appears the error is actually referring to a shortcut in the file system called "jakarta". I located the shortcut and changed the access from Windows Authentication to anonymous and reran the task.
It worked! So you need to set the directory that the files are in to anonymous access and set "jakarta" to anonymous access. Please note that I'm using CF11 so not sure if this will work with CF10 or lower.
Congrats on getting your system functioning. Can you tell me where your Jakarta shortcut was within your file system (in the folder where ColdFusion was installed, or elsewhere)?
I got around the problem as well: I created a DNS alias for my server, created a new website in IIS that uses the folder I keep my scheduled tasks in as the root folder for the new website, set the IIS bindings to the new alias, and set the authentication for the new site to Anonymous only.
Just a point of clarification: "Jakarta" isn't a shortcut (if you're talking about within IIS) - it's a virtual directory that the ColdFusion Web Server Configuration Tool creates on your site to enable the integration between IIS and ColdFusion. You can set the authentication to Anonymous for this virtual directory, but that may not be ideal from a security standpoint.
Another option is to use the internal web server and use 127.0.0.1. You will need to move the tasks to the webroot /cfusion/wwwroot for instance.
You can turn on the internal webserver in the /cfusion/runtime/conf/server.xml file it is documented in the file how to turn it on.