AnsweredAssumed Answered

Model / Script works in ArcMap but doesn't run when in Windows Scheduler

Question asked by pan_gis on Oct 17, 2019
Latest reply on Oct 18, 2019 by CCweedcontrol

Hi everyone,

I' ve created a model that updates a table in PostgreSQL

 

The model runs perfectly as model and as tool as well.

Exported the Model into python script an it runs in Arc Python window.

I have created also a script that calls the toolbox and model inside and it works when run into Arc Python Window.

 

When I put it in Windows scheduler the task starts and completes but the table isn't updated meaning that the script doesn't run correctly.

 

I tried to run the same script in PyScripter and I get this error message:

 

Message File Name Line Position 
Traceback    
    <module> C:\Folder\script_startModel.py 15  
    TableReadings2 C:\Folder\Toolbox.tbx 75  
ExecuteError: Failed to execute. Parameters are not valid.
The value does not exist.
ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported
The value does not exist.
ERROR 000732: Output Location: Dataset Database Connections\database_publish.sde does not exist or is not supported
The value does not exist.
ERROR 000732: Input Table: Dataset database.sde.Building_Readings does not exist or is not supported
ERROR 000989: Tool CalculateField cannot use VB expressions for services
ERROR 000989: Tool CalculateField cannot use VB expressions for services
ERROR 000989: Tool CalculateField cannot use VB expressions for services
ERROR 000989: Tool CalculateField cannot use VB expressions for services
Failed to execute (ScriptReadings2).
  

I tried to run the same script in Windows CMD and I get this error message:  

 

C:\Users\username>C:\python27\Arcgis10.5\python.exe C:\Folder\Script_startModel.py
Traceback (most recent call last):
  File "C:\Folder\Script_startModel.py", line 15, in <module>
    arcpy.ModelReadings2_Toolbox()
  File "C:\Folder\Toolbox.tbx", line 75, in ModelReadings2
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
The value does not exist.
ERROR 000732: Input Table: Dataset database_publish.sde.Building_Readings does not exist or is not supported
Failed to execute (ScriptReadings2).
The main issue seems to be the database which is not recognised.
Any idea?
Thanks 

Outcomes