Solved

FME Workbench with Python Startup/Shutdown fails on task scheduler but works when ran with command line manually

  • 17 August 2020
  • 3 replies
  • 13 views

Badge +6

My FME Workbench has a python startup and shutdown script (Esri ArcGIS 3.6 python interpreter) that works fine when running in the software or in command line with arguments.

 

When I put the workbench on a windows task scheduler, the workbench does not run and I get a 0x1 error in task scheduler. If I remove the python startup/shutdown the job runs fine on scheduled task.

 

Any ideas on how to resolve this? Thanks in advance!

 

More detail:

FME Desktop Version: FME 2020.1.0.1 (20200710 - Build 20596 - WIN64)

FME_HOME is 'C:\\Program Files\\FME_64\\'

 

Command line to run workspace: "C:\\Program Files\\FME_64\\fme.exe" "D:\\SOE\\FME Workbenches\\GRI\\GRI_Guardrail_AssetID_Creator.fmw"

 

Python Interpreter: Using Python interpreter from `C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\python36.dll' with PYTHONHOME `C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3'

 

 

icon

Best answer by sashal 21 October 2020, 23:24

View original

3 replies

Badge +6

We resolved this issue by setting the env variables path for FME_HOME and PYTHONHOME, then running the job and scheduling it with the service account.

We resolved this issue by setting the env variables path for FME_HOME and PYTHONHOME, then running the job and scheduling it with the service account.

Can you be more specific on how you did it?

Badge +6

Can you be more specific on how you did it?

Sure. Here all of the things a few things I did to get things working:

  1. Set the python interpreter in the Tools menu to the python home path and dll file (noted above)
  2. Use 64 bit FME Desktop - since the python interpreter used was the ArcGIS Pro python interpeter (because were were using attribute rules we needed that python interpreter)
  3. Made sure that the user that is running the schedule task has access to the .fmw files (right click fmw file - properties, security)
  4. Used the newer version of FME Desktop which has bug fixes to use the ArcGIS Pro Python interpreter

 

Also, when I moved the FME Workspaces to FME Server, I had to do the following:

  1. Make sure FME Server Windows Service is running with a windows AD account
  2. On the Server that is hosting the FME Server software
    1. Make sure ArcGIS Pro is installed and licensed on the Server that is hosting the FME Server software
    2. Make sure that the account that is running the FME Server Windows Service has access to the python interpreter (python home) `C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3'

 

I hope this helps!!

 

-Sasha

Reply