I've found that when I run a python toolbox tool as a geoprocessing task on our ArcGIS server (11.3.0), it fails when I try to access a public layer from the ESRI living atlas (https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer) with this message:
esriJobMessageTypeError: Traceback (most recent call last): File "<string>", line 58, in execute File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\__init__.py", line 1335, in Describe return gp.describe(value, data_type) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 384, in describe self._gp.Describe(*gp_fixargs(args, True))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: "https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer" does not exist
It doesn't appear to be a connectivity problem. I works when run from my client. Is there a server configuration option preventing this sort of connection?
def execute(self, parameters, messages):
import requests
url = 'https://landscape10.arcgis.com/arcgis/rest/services/USA_NLCD_Land_Cover/ImageServer'
arcpy.AddMessage("Status code: " + str(requests.head(url).status_code)) # Prints 302 (redirect)
arcpy.Describe(url)
return