Select to view content in your preferred language

ExportToJPEG crash with error on ArcGIS Server python

2080
17
10-30-2024 06:18 AM
mgeom
by
Emerging Contributor
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')

 

 

0 Kudos
17 Replies
GeorgetaPopa10
New Contributor

Hi,

 

did you find a solution? what was it? I have same error after upgrading arcgis server ..worked fine before.

Thank you,

Georgeta

0 Kudos
mgeom
by
Emerging Contributor

Hello,

No, it still doesn't work! I contacted esri support, but the topic is still pending. 

What are your previous and current versions of ArcGIS Server ? In which environment are you? single machine or cluster?

Thanks !

0 Kudos
mgeom
by
Emerging Contributor

I set the log level to 'info' as you indicate, but it doesn't give me much infos in the logs, just  very vague information

I will create a ticket at esri as you say

Thank you very much for your help

0 Kudos
West-d-gis
Emerging Contributor

Was this ever solved? I'm running into a similar issue and would like to know what was discovered.

JoshuaGray
New Contributor

I am having the same issue, same error with a GP service that exports a map series. Anyone been able to find a solution? 

0 Kudos
MatthewDriscoll
MVP Alum

What version of Pro are you using?  I think in 2.x you cannot export a map series to .jpg, but in 3.x you can.

0 Kudos
ShawnShao1
New Contributor

I'm experiencing the same issue. I published a geoprocessing service that uses layout.exportToPDF, but it fails at the exportToPDF line. I also tried switching to exportToPNG and exportToJPEG, but the issue persists. Below are the job messages I encountered:

  • 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: Could not service request.
0 Kudos
SunnySanders
New Contributor

We contacted ESRI Support Services with this issue and they had a fix that worked for us! Our affected servers had updated to VMWare Tools 12.5.0, and that version caused the issue. We upgraded to 12.5.1 and that took care of it, though downgrading is apparently also an option. 

https://support.vertigis.com/hc/en-us/articles/22271790365074-Updating-VMWare-Tools-to-v12-5-0-may-c...

Hope everyone has the same luck with it!

0 Kudos