Recently migrated from CF2016 to CF2021- it seems to have gone relatively smoothly, except we have at least some scheduled tasks that appear to be firing twice.
This is a single standalone server.
New install of CF2021 on it.
No dev server running- this is it for now.
A check of the Task Manager appears to show only one instance of CF running.
scheduler.log shows the task firing only once ar a given time.
But the task code has a CFLOG at the top that writes to a separate log file, and it is chock full of lines like:
"Information","ajp-nio-127.0.0.1-8020-exec-188","10/30/21","13:30:00","APPName","Task Start- Check Interval Start: 2021-10-30T17:00:02 End: 2021-10-30T17:15:00" "Information","ajp-nio-127.0.0.1-8020-exec-140","10/30/21","13:30:00","APPName","Task Start- Check Interval Start: 2021-10-30T17:00:02 End: 2021-10-30T17:15:00"
You can see the entries are the same except for the thread IDs, and the task is essentially run twice, with mayhem ensuing. Looking for any ideas to track this down. Either we misconfigured CF on the new server, or missed something with the scheduled task setup, but can't think what. This all ran fine on the old server, which was a co-lo shared box- the new server is on AWS, so there's no chance of crossover. I just checked and CF is not running on the old server.
Thanks for your help.
When this happens to folks, the natural reaction is to feel there must be something wrong with CF, especially on a new version. But often there's a simpler explanation.
I see your clarifications about the old server not possibly being the source of the other request. Still, since you ask for "any ideas", I'd suggest you modify the cflog line (which I assume is in the code called as a task) so that it outputs the cf variables cgi.remote_addr and cgi.http_user_agent. The former would be the ip of who made the request, while the latter is the kind of client making the call. They may be the same, but perhaps not.
Also, it's possible that your cf server is behind a load balancer or proxy that causes ALL requests to seem to come from the same ip address. There are various solutions and alternative steps to help if so. But for now, let's see what the above gets you.
I will add that if you had a cf monitor in place, like either the pmt fusionreactor, that could help with your challenge. I'll assume for now you have neither in place.
Thanks for your response, Charlie. We talked a few months ago about CF2021 licensing. Your suggestion is a good one, and I'd normally give ir a go, but in the interim it appears that our DecOps guy decided to spin up a dev server by cloning the existing production server, with the result that tasks ran twice. This is AWS, so I'm still not clear why data from both servers were making it into the one log file we set up for the remplate, but disabling the services on the cloned server restored (more or less) normal operation.
But thanks very much for the quick response and suggesrion, that was a very useful idea.
Thanks for sharing your findings.
It might be innocent. ColdFusion does itself write to log whenever a scheduled task runs. It just might be that your cflog code is duplicating what ColdFusion is doing.
The test of this hypothesis is obvious. Temporarily comment out the cflog code and see what happens.