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:
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.
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 5.2.8.50. Prior with ACF I didn’t have any issues with using localhost and ports and using cfhttp/scheduled tasks.
Instead of using a subdomain like “scans.localhost” or port like “localhost:7901” I edited the host file to “127.0.0.1 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.
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?