I am running several python scripts on a schedule on a virtual machine that has ArcGIS Pro 2.6.1 installed. I am using the python.exe from my Pro python environment to run all of the scripts in task scheduler. However ever since ArcGIS Pro version 2.5.2, I have been getting the message 0xF6 in the last run results. The crazy thing is that this happens sporadically. Sometimes the tasks run fine and other times they don't. All of my python scripts run fine by themselves.
Has anyone else had this issue and know of a fix?
Solved! Go to Solution.
We just started experiencing the same thing.
We are running Pro 2.6.1 on a VM running Windows Server 2019 Datacenter. The scripts have been running fine for months, and now they are sporadically getting the 0xF6 last result message. We have a few scripts which run nightly. Each night a different script gets the message, but the others run successfully.
Have you found any solution?
What I ended up doing was importing my python scripts into an ArcGIS Pro tool box and saving them as geoprocessing tools. Then I scheduled them to run nightly through Pro instead of Windows Task Scheduler and now they are running fine.
The funny thing is scheduling geoprocessing tasks through Pro just adds a task in Windows Task Scheduler. I have no idea why it working this way instead of directly through Windows Task Scheduler. My IT Department is stumped as well, but things are fine now.
I hope this helps.
Can you provide more details on how you were able to accomplish this task as I would like to try to move ArcMap scripts to Pro and maybe I can bypass using Windows Task Scheduler in the future with this same move?
Did any of your scripts involve stopping services for tasks such as Rebuilding address locators?
Hi all. I also ran into this issue recently, and we couldn't put our finger on why it was failing. We ended up going down the same route as Michael TorbettWe reverted our original task scheduler task to run pythonw.exe and since then it's been working without any problems.
Hope this helps.
I was having this issue and getting this same error code in Task Scheduler but was properly running pythonw.exe as suggested. I found changing the setting back to "Run only when user is logged in", caused it to work. Before I had it set to run even when the user is logged out. It must be some sort of a permissions issue.
My script wouldn't run via Windows Task Scheduler with any of the above suggestions, until I tried running it from Pro's scheduler. I loosely followed this Pro help page: https://pro.arcgis.com/en/pro-app/latest/help/analysis/geoprocessing/basics/schedule-geoprocessing-t...
Basically, I saved my stand-alone script as a script tool with no parameters. Before you hit Run, set up the schedule. I added a bunch of arcpy.AddMessage() print statements so I could see how it was progressing.
As MichaelTorbett said, Pro actually uses Windows Task Scheduler to run the geoprocessing tool. In the Task Scheduler, under the Actions tab, it used the pythonw.exe file as the Program/script and the argument was stuffed away here: "C:\Users\me\AppData\Local\ESRI\ArcGISPro\Geoprocessing\ScheduledTools\WasteRecyclingReport_02012022_0325PM\task.py"
I notice this topic keeps getting updated with different users having the same issue and trying different approaches to the problem with mixed results. Has anyone from ESRI ever acknowledged this issue and recommended a certain approach that entities should take to handle the issue of Scheduled Tasks that rely on Arcpy to run?