Hello,
I'm trying to export a JPEG with a geoprocessing task running on an Arcgis server.
The ExportToJPEG line of code crashes with an error with ArcGIS Server python, but works fine with local ArcGIS Pro python.
I can't figure out what's wrong.
Here is the error:
Job Messages:
esriJobMessageTypeInformative: Submitted.
esriJobMessageTypeInformative: Executing...
esriJobMessageTypeError: Failed.
esriJobMessageTypeInformative: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.RuntimeException: com.esri.arcgis.discovery.admin.rediscovery.util.ArcGISServiceException: Impossible de traiter la requête.
Here's a simple code test I did, it crashes at the last line:
import arcpy
aprx = arcpy.mp.ArcGISProject(r"D:\path\myAPRX.aprx")
layout = aprx.listLayouts('layout_name')[0]
mf = layout.listElements('MAPFRAME_ELEMENT', '*')[0]
extent = arcpy.Extent(446998.96875, 214866.71875, 446579.875, 215163.046875)
mf.camera.setExtent(extent)
mf.exportToPDF('path\out.jpg')