<?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: Python 3.x Scheduled Task Fails in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531354#M23384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a machine you are currently running ArcMap's python 2.7 based scripts from in Windows Task Scheduler?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your organization support Windows Server 2016 at this time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Jan 2019 18:23:18 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2019-01-03T18:23:18Z</dc:date>
    <item>
      <title>Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531347#M23377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am in the process of migrating a scheduled task from ArcMap to ArcGIS Pro that exports maps to PDFs on a daily basis. &amp;nbsp;I have the python script written, and it executes as expected when running through an IDE (PyCharm) using the python executable delivered with ArcGIS Pro (..\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try executing the same script through Windows Task Scheduler, I can tell the script is running because a .txt file is generated to log processes, however, at some point the script is failing as the maps are not being exported. &amp;nbsp;The task scheduler returns a code of 0xFFFFFFFF and I haven't found anything of substance for this code. &amp;nbsp;There are no warnings or errors in the task history either to give any clues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have several other tasks that are running just fine using python&amp;nbsp;2.7 along with ArcMap/ArcGIS Desktop using my domain account, so the username I'm using has sufficient permissions to execute a task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have ArcGIS Pro setup to login automatically, which again, works fine through the IDE. &amp;nbsp;I tried using a Single Use license, with the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I comment out all the ArcGIS Pro / arcpy functions, the script will execute as expected through Task Scheduler (creates a log, and sends an email). &amp;nbsp;It seems to be specific to the arcpy&amp;nbsp;functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is anyone running a Windows Task Scheduler task using ArcGIS Pro projects successfully? &amp;nbsp;If so, am I missing something? &amp;nbsp;Is there some sort of permission setting I'm missing? &amp;nbsp;Any ideas of where to look...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 16:33:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531347#M23377</guid>
      <dc:creator>mpboyle</dc:creator>
      <dc:date>2017-06-29T16:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531348#M23378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't believe this will work in versions previous to Pro 2.0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at this thread:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/197214-python-351-script-wont-run-via-windows-task-scheduler-when-user-logged-off"&gt;https://community.esri.com/thread/197214-python-351-script-wont-run-via-windows-task-scheduler-when-user-logged-off&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 17:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531348#M23378</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2017-06-29T17:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531349#M23379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcGIS Pro 2.0 (Single Use Advanced)...and after reading through the thread, my script will work ONLY when the task is set to 'Run only when user is logged on'. &amp;nbsp;If I try to execute the script using 'Run whether user is logged on or not' it will fail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for pointing me in the direction of the other thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 17:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531349#M23379</guid>
      <dc:creator>mpboyle</dc:creator>
      <dc:date>2017-06-29T17:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531350#M23380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you have the ability to spin up a Windows Server 2016 server to see if the scheduled task would work there if not logged onto the server?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jun 2017 17:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531350#M23380</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2017-06-29T17:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531351#M23381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can also only run py3 scripts in Windows Task Scheduler when the task is set to&amp;nbsp;&lt;STRONG&gt;Run only when user is logged on&lt;/STRONG&gt;. It sounds like from this thread and others that upgrading to Windows Server 2016 is the only sure way to resolve the issue. Hopefully ESRI releases guidance soon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 17:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531351#M23381</guid>
      <dc:creator>Zach_Robinson</dc:creator>
      <dc:date>2019-01-03T17:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531352#M23382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What kind of&amp;nbsp;machine are you using when running this script (workstation, server, other)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 18:18:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531352#M23382</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-01-03T18:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531353#M23383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Running Windows Server 2012 R2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/432525_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 18:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531353#M23383</guid>
      <dc:creator>Zach_Robinson</dc:creator>
      <dc:date>2019-01-03T18:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531354#M23384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is this a machine you are currently running ArcMap's python 2.7 based scripts from in Windows Task Scheduler?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your organization support Windows Server 2016 at this time?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 18:23:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531354#M23384</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2019-01-03T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531355#M23385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I run a handful of py2.7 scripts in task scheduler from the server machine. They run fine with the option&amp;nbsp;&lt;STRONG&gt;Run whether user is logged on or not&lt;/STRONG&gt; set to True. I also have left&amp;nbsp;&lt;STRONG&gt;Run with highest privileges&lt;/STRONG&gt; unchecked when running 2.7 scripts and they run without issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And no, our city does not yet support Windows Server 2016.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Jan 2019 18:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531355#M23385</guid>
      <dc:creator>Zach_Robinson</dc:creator>
      <dc:date>2019-01-03T18:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531356#M23386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the same issue running Python 3 task on Windows server 2019. I have actually attempted to use only when user is logged on, but that really isn't an option anyway. Running the same scripts as a task using Python 2.7 works fine. I can run the scripts in python 3 manually on the same machine, but not as a task. Wondering if it could have to do with the Conda environment and the fact that the system PATH info might be pointing to arcpy for the 2.7 environment?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Aug 2020 13:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531356#M23386</guid>
      <dc:creator>DarylHochhalter</dc:creator>
      <dc:date>2020-08-07T13:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531357#M23387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming the original question was address a while back. So &lt;A href="https://community.esri.com/migrated-users/144212"&gt;Daryl Hochhalter&lt;/A&gt;‌ ...&lt;/P&gt;&lt;P&gt;I've run into various issues with this but ultimately got it working and now have scheduled tasked for arcpy jobs running on Win Server. Typically I have found:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a service account to run the job.&lt;/LI&gt;&lt;LI&gt;Make sure service account has logon as service privileges.&lt;/LI&gt;&lt;LI&gt;Make sure the service account get can a Pro license (named or concurrent, depending on your version of Pro)&lt;/LI&gt;&lt;LI&gt;Start up ArcGIS Pro at least once using the service account to&amp;nbsp;set up that account's environment.&lt;/LI&gt;&lt;LI&gt;Make sure you can import arcpy when running the script manually.&lt;/LI&gt;&lt;LI&gt;Make sure you're Python path is correct or you put in the whole path to the conda Python install in any batch files that gets executed in task scheduler.&lt;/LI&gt;&lt;LI&gt;Don't forget about this process when you upgrade/change license servers or make Portal changes.&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Aug 2020 13:38:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/531357#M23387</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2020-08-11T13:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Python 3.x Scheduled Task Fails</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/1059326#M41073</link>
      <description>&lt;P&gt;How do you "make sure the service account can get a Pro license"?&amp;nbsp; How do you configure that?&amp;nbsp; We have named user licenses tied to our AGOL organization.&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 07:54:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/python-3-x-scheduled-task-fails/m-p/1059326#M41073</guid>
      <dc:creator>SolanaFoo2</dc:creator>
      <dc:date>2021-05-19T07:54:22Z</dc:date>
    </item>
  </channel>
</rss>

