<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Windows Task Scheduler stops running python script after a few weeks running successfully in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72565#M5963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am unclear whether this is the first time this has happened or whether it repeatedly happens.&amp;nbsp; If the latter, what have you done in the past to get the script working again?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest putting some extra print or logging statements in to tease out where in the script Python isn't working right.&amp;nbsp; Since I assume you are importing ArcPy, what if you comment out the arcpy parts of the script to see if it runs the other parts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 14 Dec 2019 14:59:00 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2019-12-14T14:59:00Z</dc:date>
    <item>
      <title>Windows Task Scheduler stops running python script after a few weeks running successfully</title>
      <link>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72564#M5962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script that uses arcpy that I have scheduled to run using the windows task scheduler on a VM (Windows Server 2012, 64bit)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script runs every hour and produces some maps in png using data driven pages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Windows Task Scheduler successfully runs the python script at the defined times for a few weeks before it decides to just stop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This seems to be just happening with tasks that are calling python on the VM. I have other tasks that do not seem to be affected by this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the python script I log the progress of the script in a text file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at the history tab of the task I can see the logs generated by the task scheduler from initiating the request, Action started etc. When it stops working I see all the logs that I expect from the Windows task scheduler up to Action Started. However, the python script does not seem to be executed at all as I do not get any logs from the python script in the text file that I log. The next Windows Task scheduler that I see is a task termination that is triggered at the time that I have set in the Settings of the Task (if task runs for x minutes stop it).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if there is something wrong with my script or if the Windows task is somehow not able to initiate the python script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The strange thing is that script runs successfully for a few weeks before it decides to just stop for some unexplained reason? I would welcome any ideas on how I can get to the root cause of this issue?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Dec 2019 10:03:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72564#M5962</guid>
      <dc:creator>wadsonmakari</dc:creator>
      <dc:date>2019-12-14T10:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Task Scheduler stops running python script after a few weeks running successfully</title>
      <link>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72565#M5963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am unclear whether this is the first time this has happened or whether it repeatedly happens.&amp;nbsp; If the latter, what have you done in the past to get the script working again?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest putting some extra print or logging statements in to tease out where in the script Python isn't working right.&amp;nbsp; Since I assume you are importing ArcPy, what if you comment out the arcpy parts of the script to see if it runs the other parts?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Dec 2019 14:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72565#M5963</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2019-12-14T14:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Windows Task Scheduler stops running python script after a few weeks running successfully</title>
      <link>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72566#M5964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Joshua,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to clarify this has happened repeatedly for the past few months. The script runs successfully through the windows task scheduler for a few weeks without any errors.It then just stops with no logs from the script as if it was not invoked by the windows task scheduler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get it&amp;nbsp; going again I manually kill the task from the Windows Task scheduler. After that it starts running again and until it stops again after a few weeks. Manually killing the stuck task is not really ideal as the script produces output data that is used in a live production environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the mean time I have added extra logging to see if the script is evening starting at all when it stops running. Hopefully this will give some clues to work with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 15 Dec 2019 00:37:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/windows-task-scheduler-stops-running-python-script/m-p/72566#M5964</guid>
      <dc:creator>wadsonmakari</dc:creator>
      <dc:date>2019-12-15T00:37:23Z</dc:date>
    </item>
  </channel>
</rss>

