Select to view content in your preferred language

Geoprocessing service works when run in Experience Builder or Pro, fails as task?

31
1
3 hours ago
AlfredBaldenweck
MVP Frequent Contributor

I have a geoprocessing service that basically does a bunch of field calculations.

It has one input parameter, which the user does not see. This parameter takes a json file that points the tool to the right tables. When tool was published as a service, that json file went with it.

I got it uploaded and it works great. I'm using it in Experience Builder.

AlfredBaldenweck_0-1783697520540.png

In Pro, when I open the tool from the Portal, it displays that input parameter and it shows the original file path, rather than what that file should be on the Portal's server. 

AlfredBaldenweck_1-1783697967558.png

In any case, the GP service works great in Pro, too.

However.

I heard that you can make an automated task via Pro by clicking the dropdown on the Run button. So I did that, and set it to run every night at midnight. 

AlfredBaldenweck_2-1783698038980.png

(Note that the exclamation points are from my project not being saved)

AlfredBaldenweck_3-1783698119071.png

 

Unfortunately, when I go to check the task the next morning, it has always failed.
I was able to change the time a touch (from like 5AM to 5:15) and that appeared to largely work, but when I changed the time to 5:30, it didn't work anymore

What's the deal, here?

On a related note, how can I get more information about the task's run? Only seeing "Succeeded" or "Failed" is really not helpful, and I have print statements (or even a specific error) would be helpful.

AlfredBaldenweck_0-1785946618433.png

 

 

0 Kudos
1 Reply
ShareUser
Esri Community Manager

Can you try setting up a Windows Scheduled Task outside of Pro to see if you can get it to run in that environment?  You would need to have it run whether user is logged on or not and with highest privileges.

I would also suggest calling the python script (exported from the geoprocessing tool) from a bat file in this scenario with logging from both that bat file that calls the python script and from within the script itself.  In  this way you can tell if the bat file is running but somehow the python portion is not if logging from the python script does not get written.

0 Kudos