Scheduled Task not Running

Using the latest release. I created a scheduled task with these settings…

Name: Top100Scan
URL: http://scans.localhost/automation/top100scan.cfm
Start date: 08/12/2018
Start time: 00:17:00
Interval: 10 secs

Everything else is default. When the interval period passes, the page never runs.

Little bit more info. The scheduler.log is returning:

“ERROR”,“Thread-11262”,“08/12/2018”,“00:00:00”,“schedule task:Top100Scan”,“Task is not valid”

Did you create this in the admin or through code?

Created through the web admin panel. I also tried to run the task manually in a browser with the same URL and it works fine, just not as a scheduled task in Lucee.

I am just going to put this out there, but the date in the admin panel might be in normal format (dd/mm/yyyy) rather than american format which is how you are putting your date in the text. I have this and it’s working:

I wish it was that simple.

Reads a little different because I fiddled with it after. It appears to be running, because its making log entries, but based on the log and the lack of execution to the database its not working. It also doesn’t have any exceptions in the logs.

Is this server able to access that URL? Does it have a hosts entry etc.

let me run a couple tests to get more details:

  1. Its accessible via the browser, but I’ll try to access the page via cfhttp to see if the server can reach it with the call

  2. I’ll create a much simpler page to run through the scheduled task so I can test and share it

When I tried to access the page through CFHTTP, the returning file content was referencing my ISP’s attempt to redirect me to their search page. It appears this is due to using a localhost subdomain like “scans.localhost”. When I use “localhost” with a port specified in cfhttp, the request works. Still a big problem though because I have many websites and I’ve had issues getting them to work in Lucee using localhost with port numbers. I kept getting the Lucee welcome page instead of my website on the first machine I setup Lucee on to test a migration.

On this machine I can only get 1 localhost/port website to work in IIS. Setting up other ones causes them to display the working port’s content minus all of its css (like a text version) instead of my website. Very odd.

Running Windows 10 Pro Build 1803
IIS Server 10.0.17134.1
I uninstalled CF and installed Lucee Prior with ACF I didn’t have any issues with using localhost and ports and using cfhttp/scheduled tasks.

Any ideas on how to fix? Thanks

I had the same issue recently. I was able to notice the following behaviors.

  1. The date/time of a new scheduled task has to be future.
  2. An expired scheduled task will not run again even the end date/time are extended.

Another odd trick, try to create the scheduled task with a different name.

I hope that helps.

I got it working. Here’s how:

Instead of using a subdomain like “scans.localhost” or port like “localhost:7901” I edited the host file to “ www.scans.local”

The CFHTTP requests started resolving (though chrome may act weird, make sure to type in the leading http:// so it doesn’t assume its a search) after that and then I setup another scheduled task pointing to the www.scans.local URL and this time it ran as expected with the real scheduled task file.

I still need to figure out how to reduce that internal below 10 seconds but I have another ticket opened for that. Also I recommend noting in the IIS docs here that without doing it this way locally, http requests will experience trouble or just make it the standard for local website setup. Would save some folks migrating from ACF to Lucee some early headaches.

Thanks for your help. It got me in the frame of thought that working in the browser does not necessarily equal working in cfhttp.

1 Like

Did you see any other exception errors in your schedule log, before the “Task is not valid” messages?

whether the task is valid is a Boolean flag

The actual exception which caused the task’s valid flag to be set to false could also be stored alongside the Boolean flag, that way it could be shown in the administrator without the need to go and dig into the log files?

Browsing thru that code, it also appears that once a task is flagged invalid, it won’t run again?

Yes, Once task is flagged as invalid, it won’t run the task after that.

@MDR, can you post your scheduler.log file here if possible.

does that seem a bit problematic to you?

any exception, minor network outage or a service being rebooted etc and a scheduled task will just stop working?

what do you think about storing and displaying the last exception for display in the administrator?

I have filed a bug about this