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

696
1
10-17-2019 03:47 AM
PanGIS
by
Occasional Contributor III

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 
0 Kudos
1 Reply
CCWeedcontrol
Occasional Contributor III

I've ran into this and for me I have to put the full path of the database\featuredataset\featureclass. It might be helpful if you posted your python code.

C:\Users\***\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\***_***_***.sde\yourfeaturedataset\featureclass