Export web map Internal Server Error 500 with specific layer

1249
3
05-17-2022 06:33 AM
arahman_mdmajid
Occasional Contributor

I used a secured web printing service in a custom application developed using ArcGIS JS API. It was working fine and was printing all layers present on the map. However, recently I started receiving 400 and 500 errors while executing the print functionality. 

Issue 1: FeatureLayer, MapImageLayer, and GraphicsLayer are displayed on the map with ArcGIS Online basemap imagery as the basemap. When executing the print, it gives the error: Unable to complete the operation (400). Whenever I exchange the imagery with another basemap, like the Light Gray Canvas, the service generates a map. After inspecting the Server Log, I cannot connect to the ArcGIS Online imagery service due to an invalid certificate error, as seen in the image below.

Connect Error webmap ArcGIS server 15 May 2022.PNG

 

Issue 2: There is a result graphics layer where I add features intersecting with the users' input feature. The print functionality works whenever the result has a few features added to the layer. But when there are many intersecting features in the result layer, the print function gives a 500 (Internal Server Error), as seen in the image below.

print internal server error 500.png

 

If I hide the results layer, the print functionality works again, so it seems like there is a problem with the result layer, but I am not sure what it is. Is there a limit to the number of features the print function can print?

The print service is published as a secure service on a standalone ArcGIS Server instance of version 10.6.1

Abdur Rahman
GIS Developer
3 Replies
TanuHoque
Esri Regular Contributor

@arahman_mdmajid 

for the first issue, this what I'd recommend you to do:

  • log on to the server machine (that is hosting the print service) as the ArcGIS SOC user
  • open a web browser
  • try to access services from https://services.arcgisonline.com/ArcGIS/rest/services without it prompting you accept some certificates.
  • if it asks for certificates to accept or you can't access for some reasons, you need to check with your network/system admin to resolve this from your side.
    • please note that the 'Light gray' basemap is a 'vector tile service' where as World_Imagery is a cached map service. And they live in two different locations.

 

on the 2nd one:

- do you have any proxy server in between your webapp and the print service?

one thing you can do is this:

  • open your browser's Developer Tools and then switch to Network tab,
  • click print button from your web app
  • in the Network tab, look for the request made to the print service
  • look for the value for WebMap_as_JSON paramter... which should be a pretty large json string.
  • browse to your print service REST end point
  • copy/paste the WebMap_as_JSON string in there
  • execute it and see if it works
  • if it works, that means there must the some kind of middleware such as proxy etc. is causing the issue
  • if it does NOT work, please contact Esri Support with that json and they should be able to log a bug for that (if that turns out to be a bug) and we will look into this.

 

I hope you will find this helpful.

 

0 Kudos
arahman_mdmajid
Occasional Contributor

@TanuHoque Thanks for the reply.

  • try to access services from https://services.arcgisonline.com/ArcGIS/rest/services without it prompting you accept some certificates.
  • if it asks for certificates to accept or you can't access for some reasons, you need to check with your network/system admin to resolve this from your side.

After talking to the network department about the ArcGIS Online URL, I opened it in an incognito window on my server where our ArcGIS Server is residing. It opened without prompting to accept the risk of no/invalid certificate.

arcgis online basemap service.PNG

So I guess the issue is resolved for now. Is there a way to permanently add this to a whitelist that will trust this link directly and not prompt the user for invalid certificates?

For the second issue,

- do you have any proxy server in between your webapp and the print service?



I do have a proxy server which I use to access these services. I used the urlUtils' addProxyRule method to add the service URL to our custom application.

I found the 'WebMap_as_JSON' and other parameters inside the error response.

print task issue parameters 18 May 2022.PNG

 

Copied these parameters to the service in ArcGIS Server.

print task issue input18 May 2022.PNG

 

Getting a blank screen after pressing the Execute Task (GET) button, as shown below.

print task issue output 18 May 2022.PNG

 

I also inspected the developer tool, and it is blank. What does this infer?

The same service generates results with the same layer but with lesser features in the result layer.

Abdur Rahman
GIS Developer
arahman_mdmajid
Occasional Contributor

@TanuHoque 

Can this be an issue with the webserver where the proxy application is hosted? 

I came across this post and modified some IIS configurations, like 'maxAllowedContentLength' and 'uploadReadAheadSize,' but still, the issue persists. The adjusted values can be seen below.

proxy uploadReadAheadSize IIS Config after.png

 

proxy maxAllowedContentLength IIS Config after.png

There is another post suggesting modifying server properties, like 'maxPostSize ',  'socMaxHeapSize', and 'appServerMaxHeapSize.' Will changing these properties affect the issue I am facing?

Abdur Rahman
GIS Developer
0 Kudos