Skip to main content
Participant
July 4, 2025
Answered

Scheduled tasks not saving changes [Coldfusion2021]

  • July 4, 2025
  • 2 replies
  • 782 views

On my server, I've got a few scheduled tasks set up. Yesterday, after a while, I wanted one of the tasks to run at a different time. After doing the edits and clicking the "Submit Changes" button, I got this error:


Invalid extension of the file name. Valid extensions are :log,txt

 

Didn't have this issue before, so I am not sure what's causing it. 

Here are the server details:

 

 

    Correct answer Charlie Arehart

    Nope, the mechanism is not assessing what code is in the url being called in the task, if that's what you mean by "the script" doing that writelog. 🙂 

     

    So when you say you "had never checked the Publish checkbox", the simple question now is whether that BOX IS checked as you view the task. If it is, and you don't care to have the task's output saved, then just uncheck it and you're done.

     

    (To be clear,  the update would NOT have somehow caused cf to now make the task now publish its output. Indeed, the 3rd issue above new to the May update literally REMOVES any tasks that publish output, if not whitelisted in that pathfilter.json file first.)

     

    Let us know how it goes. 


    While we await your news of trying what I proposed (which is far simpler than what BKBK proposed after that), I'll add that I've since confirmed that it was in fact CF11 which implemented the change that required if any scheduled task was set to "publish" or "save output to a file", the extension must end with txt or log.

     

    I bring this up first to say that your issue really can't seem to be related to your having done the CF update. (I realize you said that you didn't think you'd clicked that "publish" option for your task. Again, uncheck it in that case and proceed with your desuired update.)

     

    But second, in case any future readers may find this and wonder how to control that set of choices of  log,txt (as shown in the CF admin error mesage you quoted), that actually CAN be controlled via a setting in the neo-cron.xml (such as in CF's cfusion/lib, or [instancename]/lib for those running more than one), where one will find a setting: 

    <string>log,txt</string>
    And this, too, was documented when CF11 made the change. One would need to restart CF for that to take effect.
     
    Finally, since all this came up, it got me wondering why there's no CF Admin setting that controls tat set of values. It could EASILY be an input field on the front page for scheduled tasks (where some other global scheduled task settings are set). I made a feature request  to that effect today at https://tracker.adobe.com/#/view/CF-4227162
     
    Sorry this second point about the setting is getting away from your simpler problem. Hopefully you can just uncheck the publish setting for your task, get your task update done, and enjoy the the weekend. 🙂

    2 replies

    BKBK
    Community Expert
    Community Expert
    July 4, 2025

    Please share the entire stacktrace of the error. Review ColdFusion's logs and you should find the stacktrace. 

     

    On second thoughts, the message "Invalid extension of the file name. Valid extensions are :log,txt" might just be validation feedback of the scheduled-task interface in the Administrator. In which case, it will not percolate down to the logs.

     

    Suggestions:

    1.  Open /lib/neo-cron.xml in an editor and ensure that the "publish" element for the sheduled task is
      <var name='publish'>
      <boolean value='false'/>
      </var>​
    2.  Temporarily comment out the line 
       writelog( file="myfile", text="starting myfile.cfm" );​

      and see what happens.
    3.  Open /lib/pathfilter.json in an editor. Check whether the attribute "schedulerexecutionpaths" contains a file path that ends in an extension other than LOG or TXT. If it does, that might be the cause of the error message. 
      In any case, change the setting to
      "schedulerexecutionpaths": "opt/coldfusion2021/cfusion/logs/**"​

      Restart ColdFusion, then see if you can edit the scheduled task without error. 
    Charlie Arehart
    Community Expert
    Community Expert
    July 4, 2025

    There are a couple issues here. First, the fact that you get that error is because the task you're 

    editing is trying to "publish its output" to a file. See the settings within the task in the cf admin. 

     

    And the fact that you're getting the error about its file extension suggests that your cf2021 had not been updated in quite a while. A previous release forced that file to have one of those two extensions. 

     

    So your first step is to edit that setting to name a different file extension. 

     

    But then you will hit a NEW issue that's specific to this latest May 2025 update, which is update 20 for cf2021. It implements yet another security improvement that requires specifically whirelisting the path to that file in the new pathfilter.jsonnfile. For more, see the blue box under the code sample offered in the section labeled "Pathfilter changes".

     

    Finally, folks applying these May 2025 cf updates should also see a related point BEFORE doing the update, as covered in a point in the "known issues" section, in the bullet starting with the sentence, "After installing the update, the scheduled tasks configured with the Save output to a file option enabled may be removed from the neo-cron.xml configuration file...."

     

    [As a clarification, when I FIRST replied I thought you'd hit that second or third problem, the third of which is so lamentable when it happens unexpectedly. I've now corrected this reply to address your issue as my first point here.] 

    /Charlie (troubleshooter, carehart. org)
    Participant
    July 4, 2025

    Thank you for the detailed explanation. I'm confused, as I had never checked the Publish checkbox. The script has the extension .cfm though.
    In my script there is this line:
     writelog( file="myfile", text="starting myfile.cfm" );
    Could that be the issue?

    Charlie Arehart
    Community Expert
    Community Expert
    July 4, 2025

    Nope, the mechanism is not assessing what code is in the url being called in the task, if that's what you mean by "the script" doing that writelog. 🙂 

     

    So when you say you "had never checked the Publish checkbox", the simple question now is whether that BOX IS checked as you view the task. If it is, and you don't care to have the task's output saved, then just uncheck it and you're done.

     

    (To be clear,  the update would NOT have somehow caused cf to now make the task now publish its output. Indeed, the 3rd issue above new to the May update literally REMOVES any tasks that publish output, if not whitelisted in that pathfilter.json file first.)

     

    Let us know how it goes. 

    /Charlie (troubleshooter, carehart. org)