Hello,
I am facing an issue with publishing a webmap composed of 8 point layers with each one having a unique value renderer of 4 values: so nothing crazy...
When publishing it, ArcGIS Pro says it fails and the following message is displayed:
Status: Failed ErrorMessage: Failed to add web item
Debugging the issue with Fiddler, it is failing on the following request:
POST /portalwebadaptor/sharing/rest/content/users/foo/additem
An error occurred while processing the request.
If I remove a single layer, it works. So I thought the issue was specific to this one layer, but when I added it back and removed another one, it worked as well.
I then thought about a size limitation thinking my CIMSymbols were too complicated and the JSON generated was too big but it is actually only 10MB and according to the documentation "Add Item" operation should be able to handle up to 5GB:
https://developers.arcgis.com/rest/users-groups-and-items/considerations-and-limitations/
I debugged a little more and try to upload my webmap directly on the HTML Sharing API copy/pasting the parameters send by ArcGIS Pro captured from Fiddler ('title', 'type', 'typeKeywords', 'extent', and of course the 'text' one which contains the webmap) and surprise... it worked ! So what could be the difference ?
The answer is the type of POST !
- ArcGIS Pro is sending the webmap using 'x-www-form-urlencoded'
while
- ArcGIS HTML Sharing API using 'multipart/form-data'
I then wrote a simple Python script (attached) with 2 methods:
- one POSTing the webmap using 'x-www-form-urlencoded': it fails
- one POSTing the webmap using 'multipart/form-data': it works. And the webmap then is fully functionnal on the MapViewer.
I then wonder whether it was an IIS WebAdaptor issue or a Portal for ArcGIS issue but it actually fails on both:
- on IIS: the error is: An error occurred while processing the request.
- on Portal for ArcGIS: ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)
But I am now stuck and I can't upload a relatively simple webmap except manually on the Sharing API after having captured the webmap JSON generated by ArcGIS Pro with Fiddler which is really not scalable...
Any experts around having an idea ?
Thanks,
Nicolas
Solved! Go to Solution.
So troubleshooting the case with support, there is actually a 10MB limit when posting to Portal for ArcGIS with 'x-www-form-urlencoded' just like ArcGIS Server:
https://developers.arcgis.com/rest/enterprise-administration/server/serverproperties/
Unfortunately, this parameter is not exposed on Portal for ArcGIS Admin API... Thus my case ended up with the following enhancement:
ENH-000175387: Add support for changing the maximum size in bytes for POST requests sent to Portal for ArcGIS through the addition of a maxHttpPostSizeInBytes property in the ArcGIS Portal Administrator API.
But to me ArcGIS Pro should be clever enough to switch by itself to 'multipart/form-data' to allow bigger webmap to be publish rather than modifying the maxHttpPostSizeInBytes configuration. As a consequence, I created the following idea:
Please vote 🙂
So troubleshooting the case with support, there is actually a 10MB limit when posting to Portal for ArcGIS with 'x-www-form-urlencoded' just like ArcGIS Server:
https://developers.arcgis.com/rest/enterprise-administration/server/serverproperties/
Unfortunately, this parameter is not exposed on Portal for ArcGIS Admin API... Thus my case ended up with the following enhancement:
ENH-000175387: Add support for changing the maximum size in bytes for POST requests sent to Portal for ArcGIS through the addition of a maxHttpPostSizeInBytes property in the ArcGIS Portal Administrator API.
But to me ArcGIS Pro should be clever enough to switch by itself to 'multipart/form-data' to allow bigger webmap to be publish rather than modifying the maxHttpPostSizeInBytes configuration. As a consequence, I created the following idea:
Please vote 🙂