Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFAdmin Scheduled Tasks

Status
Not open for further replies.

KevinFSI

Programmer
Nov 17, 2000
582
US
I've been reading post after post about Scheduled Tasks. I've seen my question at least a dozen times, but unfortunately haven't seen an answer.

Why can I run a template manually, but not as a scheduled task? I have several scheduled tasks running, but this one is the only one that doesn't work. It's also the only one running on a "monthly" basis.

WHAT GIVES??? Kevin
slanek@ssd.fsi.com
 
Yes, i've got the same problem. I got a daily task that isn't performed. It's a page which sends an email to a group of people. The email adresses are different each day. Howcome the server application doesn't perform the task?
Wouter
zure_zult@hotmail.com
To me, boxing is like a ballet, except there's no music, no choreography, and the dancers hit each other.
 
Some folks have no trouble with CFSCHEDULE, others... well you know what it is like :)

First, if you are "lucky" restarting the cfexecutive service (and only that one) has been found to solve this problem (ok, once for one guy but worth a shot)

If you happen to have "admin" privilidges on your server it may be better to go with a Unix "Cron" or Windows "Scheduled Event". Have that task start a script that "runs" your CFML.

Try to have it run a script like this:
*Spawn a task

That trick uses "c:/cfusion/bin/cfml.exe" to "run" a template through the CF server in the background.

Good luck :)
 
Hey all,

I think you're experiencing the scheduler's somewhat buggy behavior. I've generally had good luck with scheduled tasks but on occasion I've had one not run when it's supposed to for no reason. I've found that deleting it and then recreating it would usually get it back into normal service. I don't know why or what causes the scheduler to develop a problem with a task but it seems to happen from time to time.

One thing you can do is set the scheduled task to save output to a file. If the task is actually running but there's a problem with the url or some other error occurs, you can see it in the output file. Another place to check is the scheduler log file to see if the task is getting submitted.

All in all, the delete/recreate should get you back running if it's just a scheduler bug.

Hope this helps,
GJ
 
Hey GJ, good to hear from you. Been a while.

I deleted it and re-created it, but still get the same result. This time, however, I created an output file so I could see what's what.

It's a text file and when I run the task and open the text file, the only text that's there simply says "Access Denied"

This particular procedure is one of many, and like I said earlier, it's the only one that doesn't work. Why would I be getting an "Access Denied" for a file that resides on the same server? Kevin
slanek@ssd.fsi.com
 
Hey Kevin,

That sounds like file permissions or IP resctrictions to me. What happens if you copy and past the url from the scheduler into a web browser? If you don't get the same "access denied" message, I would then login on the webserver and try the same thing of copying and pasting the url into a web browser and running it from the server. This will make sure there aren't any IP restrictions in effect.

Good to see you around again,
GJ
 
That's exactly what I did and was able to run the template with no problems. This is why I'm completely baffled. Kevin
slanek@ssd.fsi.com
 
Hey Kevin,

If you're able to run the template from the webserver using the exact url from the scheduler, the only thing that makes sense to me is that the web browser is sending some type of login info automatically while the CF scheduler isn't. Are you using IE? If so, I would try the same test in NS and see if it works. I suspect that you'll find that NS gets the access denied message.

Let me know, this sounds like an interesting one.
GJ
 
GJ. Found it. It was in IIS. Security | Allow anon. access. Kevin
slanek@ssd.fsi.com
 
Interesting. So was IE supplying your windows login info automatically?

GJ
 
Well, I'm not sure. I assume that was the case, but I don't really know.

To be honest, I don't see how that could matter. I shouldn't have to check "Allow annonymous access" just to run a scheduled task.

There is no login check within the application, so it's not as if I was restricting access within the app.

While I've managed to make it work, I've also managed to confuse myself further. I don't like the way I got it to work and would like a way around it. Kevin
slanek@ssd.fsi.com
 
Hey Kevin,

Within IIS, NOT setting "allow anonymous" users tells the webserver to restrict access only to authorized users. This means that any page request will require the web browser to send a username and password to view that page. When the scheduler runs, it functions as a web browser when it requests the url (task). Since it doesn't send a username and password, it gets denied by the IIS webserver and thus sends back the "access denied" response from IIS.

As I was writing this, I realized that there is a username and password setting for each scheduled task. If you supply a valid username and password, the scheduler should run that task even if IIS doesn't allow anonymous access.

GJ
 
I did. It didn't work. I even tried the admin username and password for both CF and NT. Neither one did it.

If that were the case, would I have been able to run that page from within the browser on the server? That is to say, if the scheduler functions as a browser on the server, should I have been able to get that page to run from the server's browser? Kevin
slanek@ssd.fsi.com
 
Hey Kevin,

Yes, you should be able to run the script from a browser on the server but I wouldn't use IE for testing as it may send the account and password you are logged in with instead of prompting you. The newer versions of Front Page do this where it doesn't give you a chance to login in with a different account.

I would check to see if you have it set to use NT authentication. The standard username and password options found in Netscape and other software usually don't work with the MS NT authentication scheme. This is why websites secured with directory permissions and IIS/NT auth. only work with IE. I doubt that the scheduler supports the NT authentication. If you have this option un-checked in IIS, I would expect the scheduler to then be able to connect via the u/p options.

Let me know what you find as this is an interesting one,
GJ
 
GJ,

I'll most likely dig into it later today. I'll keep you posted. I agree, it is pretty interesting. Especially considering the number of related posts.

Kevin Kevin
slanek@ssd.fsi.com
 
GJ,
I'm OK with the site working only on IE. It's an intranet app, so that's no big deal.

I was originally using NT Auth. with an option to &quot;log in as a different user.&quot; I was just using <CFIF Auth_User IS...> which I can no longer do now that I've checked the Allow Anonymous Access box. I don't have a problem with not being able use Auth_User on my site as it was more of an experiment than anything else, but I don't understand why I can't get the Scheduler to work without allowing anonymous access. I even tried several username/password combos in the scheduler to no avail? Any thoughts? Kevin
slanek@ssd.fsi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top