Duplicate scheduled tasks

Having a strange problem here.

Ubuntu 16.04 with Nginx
Lucee 5.2.5.20

I have several scheduled tasks that run regularly, e.g. every minute, but every now and then the server starts running each task twice per minute instead, as though there is a duplicate configured somewhere.

In both the Lucee admin and using I only see one task, but in the request logs it’s definitely happening twice. A Lucee restart usually fixes it, for a while, at least. I only noticed it because I was getting locking errors.

Any ideas what could be causing this? Is it correct that task setup is handled outside of a specific web context?

Encountered exactly the same problem recently (Ubuntu 16.04 with Apache2, Lucee 5.2.7.63).
Scheduled tasks spawned up to four times on that machine.

Workaround for us is currently to make sure we have server-wide locking in place.

Would also love to learn more about this issue… anyone…?

Hi @Andy_Bellenie,

I can’t replicate the issue in my local environment. Is this happen in production?

My scheduler xml conatins

<?xml version="1.0"?>
<schedule>
   <task autoDelete="false" hidden="false" interval="30"
       name="testTask" paused="false" port="8888" proxyHost=""
       proxyPassword="" proxyPort="0" proxyUser="" publish="false"
       readonly="false" resolveUrl="false" startDate="{d '2018-06-28'}"
       startTime="{t '20:20:00'}" timeout="50000" url="http://localhost:8888/sampleTask/test.cfm"/>
</schedule>

Please check the schedule.xml. Or post your schedule xml here

I checked with Windows 10 Apache Tomcat/8.0.36

1 Like

No intention of hijacking Andy’s topic, but since I have run into the same issue, here’s a snippet from my schedule XML:

<task autoDelete="false" endTime="{t '01:30:00'}" hidden="false"
        interval="1200" name="TaskName"
        paused="false" port="80" proxyHost="" proxyPassword=""
        proxyPort="0" proxyUser="" publish="false" readonly="false"
        resolveUrl="false" startDate="{d '2018-04-19'}"
        startTime="{t '00:20:00'}" timeout="300000" url="http://domain.tld:80/jobs/script.cfm"/>

I don’t think the XML is the culprit though.

Hijack away :slight_smile: Here’s mine (fromweb-content/scheduler):

<?xml version="1.0"?>
<schedule>
    <task autoDelete="false" hidden="false" interval="60"
        name="Process payments" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-03-21'}"
        startTime="{t '00:00:20'}" timeout="60000" url="https://domain.tld:443/scheduler/process-payments?origin=dashadmin"/>
    <task autoDelete="false" hidden="false" interval="600"
        name="Import cancellations" paused="false" port="443"
        proxyHost="" proxyPassword="" proxyPort="0" proxyUser=""
        publish="false" readonly="false" resolveUrl="false"
        startDate="{d '2018-03-21'}" startTime="{t '00:05:00'}"
        timeout="60000" url="https://domain.tld:443/scheduler/import-cancellations"/>
    <task autoDelete="false" hidden="false" interval="60"
        name="Process events" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-03-21'}"
        startTime="{t '00:00:00'}" timeout="60000" url="https://domain.tld:443/scheduler/process-events"/>
    <task autoDelete="false" hidden="false" interval="60"
        name="Process renewals" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-03-21'}"
        startTime="{t '00:00:40'}" timeout="60000" url="https://domain.tld:443/scheduler/process-renewals"/>
    <task autoDelete="false" hidden="false" interval="daily"
        name="Send notifications" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-03-21'}"
        startTime="{t '05:00:00'}" timeout="300000" url="https://domain.tld:443/scheduler/send-notifications"/>
    <task autoDelete="false" hidden="false" interval="monthly"
        name="Run billing" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-07-05'}"
        startTime="{t '06:00:00'}" timeout="300000" url="https://domain.tld:443/scheduler/run-billing"/>
    <task autoDelete="false" hidden="false" interval="daily"
        name="Requests Report" paused="false" port="443" proxyHost=""
        proxyPassword="" proxyPort="0" proxyUser="" publish="false"
        readonly="false" resolveUrl="false" startDate="{d '2018-06-14'}"
        startTime="{t '10:00:00'}" timeout="50000" url="https://domain.tld:443/scheduler/requests-report"/>
</schedule>

(Don’t know if this is what you are experiencing, but) I recently encountered a similar problem where some of my scheduled tasks would run on schedule but then mysteriously run again a minute later.

It took me a while to realise it only happened on tasks which ran for over 60 seconds without anything being written to the response buffer (e.g. pages with very slow running queries).

The cause was nginx automatically retrying the request after a 60 second timeout.

1 Like

Same problem on Windows server 2016 after a Lucee update. Current version: 5.2.6.60.
After an update all scheduled tasks run twice. My fix is to delete all tasks and enter them again, then restart Lucee.

Here’s a silly question: Do you have by any chance a copy of the site running in test/beta/dev environment? i.e. You might have only one scheduled task defined, but in more than one site?

I for one can rule out that possibility.
The tasks in questions have been created a few weeks ago and exist only on one machine.

are there any additional log levels supported for the scheduler.log supported beyond ERROR to help diagnose this?

I don’t remember without looking, but we can easily add some.

Came here to say “me too”. I’m on Lucee 5.3.8.17, Linux RedHat 7. Suddenly the scheduled tasks each start running twice. I know because I have database logging in place on a task which runs every 5 minutes. Out of nowhere there will be duplicate entries. Also I schedule an email at certain intervals and I’ll start receiving two instead of one.

I don’t see any resolution to this thread but hoping to get some more information on this.