Skip to main content
Inspiring
March 26, 2007
Answered

CFSchedule firing multiple times

  • March 26, 2007
  • 30 replies
  • 6932 views
Hi Everyone,
i still have not found a solution to this. if anyone has any other suggestions please let me know.
Also i would like to report this as a bug, what is the proper procedure for reporting this?

thanks to all

Tim

Original- Hi All,
i have had issues since upgrading from 6 to 7 with cfschedule. sometimes it runs fine, other times it will run the same task multiple times in a row, other times it will wait an hour then run the same task again.

This may not sound like a big deal, but the tasks send out several thousands of emails. talk about spam!!

I have been screamed at on a weekly basis to make this stop.

Now since the the DST change, the tasks that were scheduled at 3pm run at 3pm and again at 4pm!!

Please someone help!!!!!!!!!!!!!!!!!!!!!


Thanks in advance.
Tim
    This topic has been closed for replies.
    Correct answer nicetim
    Hi All,
    after restoring the system completly from backup, CF would not run.
    So we removed it completely and installed if from scratch.
    We restored the CFM code and database.

    This fixed it :) i guess i should have done this from the begining.
    So i have no idea what the issue was, lets just hope it does not come back.

    Thanks to all who gave suggestions and help,
    Good luck to those of you who are still having this issue, if you get tired of trying to find the solution, just format and start over.
    This was much less painfull than trying to fix this issue.

    Regards,
    Tim

    30 replies

    Inspiring
    August 2, 2007
    nicetim wrote:
    > Hi All,
    > after restoring the system completly from backup, CF would not run.
    > So we removed it completely and installed if from scratch.
    > We restored the CFM code and database.
    >
    > This fixed it :) i guess i should have done this from the begining.
    > So i have no idea what the issue was, lets just hope it does not come back.
    >
    > Thanks to all who gave suggestions and help.
    >
    > Regards,
    > Tim
    >

    Let us hope! Hopefully it is encouraging that I have used schedule
    tasks with CF for 8 years since version 4.5 and I have never had an
    issue like you described.

    Inspiring
    October 13, 2017

    In my case the scheduled task run twice within some milliseconds (sometimes the exact millisecond!)

    Then I logged IP number and the duplet tasks was run from another IP.

    Turned out our internet service provider had some redundat server set up that had kicked in, and somehow the CF instance continued to run, even after our primary server kicked in again.

    I put this code in some of my scheduled task, that really helped me!

    <cflog file="myTasks" text="#GetCurrentTemplatePath()# Tickcount:#GetTickCount()# userAgent:#cgi.HTTP_USER_AGENT# IP:#cgi.REMOTE_ADDR#">

    Then you go to CF Admin and find your myTasks.log at "Log files". Check that IP

    nicetimAuthorCorrect answer
    Inspiring
    August 2, 2007
    Hi All,
    after restoring the system completly from backup, CF would not run.
    So we removed it completely and installed if from scratch.
    We restored the CFM code and database.

    This fixed it :) i guess i should have done this from the begining.
    So i have no idea what the issue was, lets just hope it does not come back.

    Thanks to all who gave suggestions and help,
    Good luck to those of you who are still having this issue, if you get tired of trying to find the solution, just format and start over.
    This was much less painfull than trying to fix this issue.

    Regards,
    Tim
    BKBK
    Community Expert
    Community Expert
    August 1, 2007
    i had a task pointing to my dev box and it was executing only once per task.
    Some light at last. Good luck.

    nicetimAuthor
    Inspiring
    July 31, 2007
    hey everyone, i hope you all are well.
    I am not!
    my admin installed some updates and crashed our production server.
    they are rebuilding it now.

    Ill check to ensure there are no more than one instance of CFusion running on the box. i agree this sounds like it could be the coulprete, so i want to triple check when its restored.

    ill keep you updated, oh just befor it went down, i had a task pointing to my dev box and it was executing only once per task.

    tim
    Inspiring
    July 31, 2007
    nicetim wrote:
    > Hi All,
    > i let this run all night, and i got 2 emails every 15 minutes all night long.
    >
    > not sure what else to test.
    >
    > Tim

    Have you investigated the neo_cron.xml file, at C:\CFusionMX7\lib for my
    standard, single server, developer configuration. Is there anything
    funny there?

    Do you have any application.cfm|application.cfc files that maybe coming
    into play here? You may want to place blank application files in the
    directory with the scheduled task to insure that no stay code is being
    utilized.

    What happens if you set a scheduled task to a resource not on your
    sever. This will be harder to monitor, but you could set a task to
    access something like http:\\www.google.com. Then monitor your logs to
    see if it is accessed multiple times.

    Do you set an output file for the scheduled task. Anything unexpected
    show up in that output file?




    nicetimAuthor
    Inspiring
    July 31, 2007
    Hi Ian,
    I am not sure what is strange or not in the file. i dont have a known good one to compare it with.

    As I mentioned earlier in the thread, i have 2 sites, one where my action pages are form my tasks is not under windows authentication, it has a very simple application.cfm file in its root, with no redirects or includes of any kind, just sets a few variables, and the task pages are in folders under the root.

    The second site, is under windows authentication but no task action pages are located here.
    The URL to the action pages uses the DNS name on our network of the local file to run. I can call the files individually via a browser and the updates and emails only happen one time, i can verify this in my IIS logs.

    I will setup a new task that points to my dev server and runs the same basic email me the time cfm test page. Would this be the same as what you are suggesting?
    I dont think IIS will show me outbound web requests and i dont know where i could get a log like that so sending the request to another server i have control over might be easier.

    All the task either have a file set in the task or write to the cf log
    The ones that have the file set in the task overwrite each other everytime they run, and not much is there except the output of the results.
    The others that use the cflog are easier to see the duplication but not the output of the file.

    ill let this run and post my results.

    thanks
    Tim
    nicetimAuthor
    Inspiring
    July 31, 2007
    Hi All,
    i let this run all night, and i got 2 emails every 15 minutes all night long.

    not sure what else to test.

    Tim
    BKBK
    Community Expert
    Community Expert
    July 31, 2007
    Nicetim,
    Could you let us see the actual code that the scheduler multiplies. It just might be doing multiple writes, you never know.

    nicetimAuthor
    Inspiring
    July 31, 2007
    Hi BK,
    in my task is setup to run every 15 with a start date of a few days ago and no end date or time.
    it calls a file on the same server via its dsn name.
    The file it calls is this:

    <cfset testtext = "Testing st #now()#">
    <cfset testSTname = "d:\st_test_" & #DateFormat(now(),"yyyymmdd")#&""&#TimeFormat(now(),"HHmmss")# &".txt">
    <!--- <cffile action="write" file="#testSTname#" output="#testtext#" nameconflict="makeunique"> --->
    <cfmail to="nicetim@nicetim.com" from="test@nicetim.com" subject="st timer test">
    #Dateformat(now(),"mm/dd/yyyy")#
    #TimeFormat(now(),"hh:mm:ss:l")#
    </cfmail>

    If you notice i commented out the file write. something was puzzling about it, it would write fine for an hour then once in awhile write multiples (by comparing the date created on the file in windows.
    I then found the calls in my IIS log file, every single call was done twice at exactly the same time.
    (edited for security)

    2007-07-30 22:15:06 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:15:06 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:30:06 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:30:06 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:45:08 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0
    2007-07-30 22:45:08 x.x.x.x GET /tools/test_ts.cfm - 80 - x.x.x.x CFSCHEDULE 200 0 0


    So i decieded to make it send an email, this way there is a queue so to speak for the messages to be written, i think this is why i saw speratic multiples with cffile.

    Email 1 contents: {ts '2007-07-31 01:30:00'} 01:30:00:769
    Email 2 contents: {ts '2007-07-31 01:30:00'} 01:30:00:909

    So far, i am only getting 2 copies for every fire of the task, but i have seen in other tasks that email, up to 6 copies.
    i can see this in IIS Logs, the test cfm file being called at least twice per task for long periods, then other tasks will fire and i only see a single call to the test cfm file. but its next execution time is duplicated if there is no other tasks running during the same time period

    I have dug through all the logs for each task, so far all of the task that have no end date fire multiple times.
    I can see the results (files written, db records inserted, emails sent, IIS log files).
    all show duplicates during same creation time Except the scheduler.log it only shows each of those tasks firing once.
    I can only assume that the scheduler log is being updated correctly which leads me to belive that this log entry is done some time before the scheduler payload execution or the scheduler code dosnt log multiple triggers on its actions.

    So i am going to set the End date for this test task to see if the duplicates stop.

    more to come

    Tim

    nicetimAuthor
    Inspiring
    July 31, 2007
    Hi all,
    i setup one to run every 15 minutes now.
    Here is all the code in the action page:

    <cfset testtext = "Testing st #now()#">
    <cfset testSTname = "d:\st_test_" & #DateFormat(now(),"yyyymmdd")#&""&#TimeFormat(now(),"HHmmss")# &".txt">
    <cffile action="write" file="#testSTname#" output="#testtext#" nameconflict="makeunique">


    I will let this run for a day or two and post my results.

    Tim
    nicetimAuthor
    Inspiring
    July 30, 2007
    Hi Ian,
    i gave that a try and as expected i get mulitple files created.

    but its not consistant, one time it ran i got one file other times it get 2 or 3 then 1 again.

    Tim
    Inspiring
    July 30, 2007
    nicetim wrote:
    > Hi All,
    > I still do not have a solution for this crippling bug!!!
    > Thats right BUG! Adobe are you reading this???
    >
    > I want to upgrade but have a fear that this issue would still be present.
    > Also i dont think i should have to pay to upgrade just to fix a bug!!
    >
    > I need this fixed asap!!!

    I have never experience this that is not human error. I gleaned from
    earlier posts that you may be running a multi-home configuration of
    ColdFusion. If so, are you sure the scheduled task is not configured in
    any other instances? Particularly the root 'cfusion' instance?

    Do you have any process that back-up/copy/restore the neo_xxx.xml
    configuration files for the server? This is where the scheduled task
    configurations are actually stored. If these files are not being
    updated, or somehow being copies or restored then that would return the
    scheduled task definition.

    When you delete the scheduled task, but do not restore it, does it still
    run somehow?

    nicetimAuthor
    Inspiring
    July 30, 2007
    Hi Ian,
    I hope you did not hurt yourself gleaning. :)
    This setup is our production server runing win2k3 IIS6 and MS SQL2k.
    It is setup to be multi homed, multi server (instances) but we have never needed to spawn a new instance.
    All 2 IIS sites are configured through JRun to use the single CFusion instance.

    I have only one instance of CFusion running on that server and no other server calls the task pages.

    I am not sure what you mean by back/restore or copy the neo files. i am assuming you mean Do i have something replacing the files after i update them? and no i dont. The neo-xxx.xml files have the same date/time as when i last updated my scheduled tasks.

    After i deleted my tasks from cf schedule through cf admin, i only had 1 task that ran and it was my test task.
    The cfm page was a simple email test page. i setup the task to run one time and it did, but i received 3 emails. my log file shows the emails sent to me from cf also the emails had the same date/time stamp in the header and in the body of the email (#now()#). None of the deleted tasks ran.

    I then re created all of my needed tasks.


    Here is an example of my logs. The first is from the scheduler.log.
    Jul 29, 2007 5:15 PM Information 0
    [Dispatcher] Rescheduling for :Sun Jul 29 17:30:00 EDT 2007 Now: Sun Jul 29 17:15:04 EDT 2007
    Jul 29, 2007 5:15 PM Information 0
    [Dispatcher] Executing at Sun Jul 29 17:15:00 EDT 2007

    -----------------------------------

    Here is from another log. When the above task runs it fires a page that loops over a set of records. the select is select ID from table where checkFlag=0 Which would produce no duplicate PK records. for each record, my cfm page does a lot of work but also updates a few other tables and writes to this log file. the cflog entry is at the top of the loop before any logic.

    Jul 29, 2007 5:15 PM Information 0 FSNET
    AH dispatch ST checking 216984
    Jul 29, 2007 5:15 PM Information 0 FSNET
    AH dispatch ST checking 216984

    Notice the duplicate PK numbers??!!

    Anyway, this is an example of the problem. One of my tasks is responsible for sending weekly reminders to ALL of the users in my site. 1300 of them. That task runs the cfm page 3 times. you can imagine what a VP would say to you if they get 3 copies every week of an email.

    I am not sure what else to put in this post, but i am ready willing and able to do anything to get this *#*@)(!)#*# issue resolved.

    Thanks again
    Tim