Geoprocessing scheduler failing

254
2
03-17-2021 07:31 AM
JohnBrand
New Contributor III

I created a model that runs fine when I tell it to.  I set it up to automatically run nightly via the scheduler feature in ArcPro.  It fails every time and doesn't provide any errors or info.

JohnBrand_0-1615991077843.png

I have successfully used the scheduler to run a geoprocessing tool nightly for quite some time.

Anybody have a similar experience?  The model that is failing to run via the scheduler starts out with a script.  Could this be part of the problem?

 

I'm using Pro 2.6.3

 

Thanks,

 

John

 

0 Kudos
2 Replies
jcarlson
MVP Frequent Contributor

It will be very hard to say without seeing at least part of the script / model, but I think it's safe to say there's something in how you've written your script that isn't being handled properly in the standalone script.

What that might be can vary quite a bit. Please share your code if you can.

Barring that, I'd add some messages to your script so that you can get a better sense of where and perhaps why it's failing.

- Josh Carlson
Kendall County GIS
0 Kudos
JohnBrand
New Contributor III

The model is pretty basic

JohnBrand_0-1615992534062.png

 

Here is the code from the script tool

 

from urllib.request import urlopen
from zipfile import ZipFile

# Path to Oil Gas Locations - Conventional
zipurl = "https://opendata.arcgis.com/datasets/5e27625cb6df4d068de935958ad2f3f6_54.zip?outSR=%7B%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%7D"

# Download the file from the URL
zipresp = urlopen(zipurl)

# Create a new file on the hard drive
tempzip = open(r"G:\jbrand\ArcPro Projects\Current Operator Cleanup\PADEP_Master_Wells\Oil_Gas_Locations_-_Conventional.zip", "wb")

# Write the contents of the downloaded file into the new file
tempzip.write(zipresp.read())

# Close the newly-created file
tempzip.close()

# Re-open the newly-created file with ZipFile()
zf = ZipFile(r"G:\jbrand\ArcPro Projects\Current Operator Cleanup\PADEP_Master_Wells\Oil_Gas_Locations_-_Conventional.zip")

# Extract its contents into <extraction_path>
# note that extractall will automatically create the path
zf.extractall(path=r"G:\jbrand\ArcPro Projects\Current Operator Cleanup\PADEP_Master_Wells")

# close the ZipFile instance
zf.close()
0 Kudos