Select to view content in your preferred language

Unable to complete operation. Error executing tool. Export Web Map : ConvertWebMapToArcGISProject() takes from 1 to 4 positional arguments but 5 were

3543
9
Jump to solution
01-10-2024 02:44 AM
RamaRaomalisetti
Occasional Contributor

Hi I have published the Custom print service in 10.9.1 using ArcGIS Pro 2.9 (Before i was tried to publish from ArcGIS pro 3.2, But cannot able to publish asking giving some parameter error, Mapservices are published using 3.2 ArcGIS pro)

Now after publishing using ArcGIS Pro 2.9 giving the below error.

Unable to complete operation. Error executing tool. Export Web Map : ConvertWebMapToArcGISProject() takes from 1 to 4 positional arguments but 5 were

 

I have given the below Json . I hide the url due to confidential. Please help

{"operationalLayers":[{"layerType":"ArcGISMapServiceLayer","layers":[{"id":0,"name":"Al batha Part 01","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":0}}},{"id":1,"name":"Al batha Part 02","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":1}}},{"id":2,"name":"Al Hadithah","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":2}}},{"id":3,"name":"Al Khafji","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":3}}},{"id":4,"name":"Al Raqi","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":4}}},{"id":5,"name":"Jadedet Arar","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":5}}},{"id":6,"name":"Salwa Part 01","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":6}}},{"id":7,"name":"Salwa Part 02","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":7}}}],"url":"URL","id":"Droneimageslayer","title":"Drone Images Data","opacity":1,"minScale":0,"maxScale":0},{"layerType":"ArcGISMapServiceLayer","layers":[{"id":5,"name":"Post Offices","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":5}}},{"id":4,"name":"Ports","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":4}}},{"id":8,"name":"Branches","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":8}}},{"id":10,"name":"Ports Survey Boundary","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":10}}},{"id":6,"name":"Port Divisions","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":6}}},{"id":3,"name":"Supervisory Boundaries","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":3}}},{"id":1,"name":"KSA Boundary","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":1}}},{"id":2,"name":"Secured Area","layerDefinition":{"source":{"type":"mapLayer","mapLayerId":2}}}],"url":"URL","id":"Boundarieslayer","title":"Boundaries Data","opacity":1,"minScale":0,"maxScale":0}],"mapOptions":{"extent":{"spatialReference":{"latestWkid":3857,"wkid":102100},"xmin":3207062.2095940383,"ymin":2094098.2837775515,"xmax":6964095.023866023,"ymax":3498093.6193192955},"spatialReference":{"latestWkid":3857,"wkid":102100},"showAttribution":true},"exportOptions":{"dpi":96},"layoutOptions":{"titleText":"test","authorText":"admohamed-c","copyrightText":"","customTextElements":[{"date":"1/10/2024"}],"scaleBarOptions":{"metricUnit":null,"nonMetricUnit":null},"legendOptions":{"operationalLayers":[{"id":"Droneimageslayer","subLayerIds":[7,6,5,4,3,2,1,0]},{"id":"Boundarieslayer","subLayerIds":[2,1,3,6,10,8,4,5]}]}}}
2 Solutions

Accepted Solutions
RamaRaomalisetti
Occasional Contributor

Hi everyone,

I forgot to update you on the issue.

I have resolved it by creating another export web map tool by duplicating the existing one. I copied the same Python script to another location and created a new toolbox with the same parameters. After publishing the print tool, it worked.

It seems there might be some compatibility or overwrite issues between ArcGIS Server and ArcGIS Pro.

Finally, it worked. Sorry for the late reply

View solution in original post

AnandChinnathambi
New Contributor

@RamaRaomalisetti 

When using ArcGIS Pro 3.2 or 3.3 on an ArcGIS Server 11.1 machine, or ArcGIS Pro 3.1 and later versions on an ArcGIS Server 10.9.1 machine, you may encounter failures with the default ArcGIS Print tool located in the utilities folder. This issue also affects custom print tools published.

To resolve this, you need to remove ArcGIS Pro from the ArcGIS Server machine, which will fix the default Print Tool error. If you need to publish a Custom Print GP tool, use ArcGIS Pro 3.0.3 or 2.9 with ArcGIS Server 11.1 or 10.9.1, as these versions work without issues.

It appears that upgrading ArcGIS Pro to 3.1 or 3.2 alters or upgrades the server print tool parameters, causing these compatibility issues.

View solution in original post

9 Replies
TanuHoque
Esri Regular Contributor

@RamaRaomalisetti 

can you pls elaborate on 'custom print service' part? Did you write you own arcpy based print service? Or you simply run Export Web Map gp tool in ArcGIS Pro 2.9 and publish the result out as a print service?

0 Kudos
RamaRaomalisetti
Occasional Contributor

Hi TanuHoque

I have created the one Layout template kept in one folder, using the  Server-Print Tools (Get Layout Template info and Export WebMap, Published the Export Web map) I have published the custom print service with Copy all function. 

I did not write the ArcPy . I hope i have detailed about the issue.

Note : If i run the Webmap as Json data in ArcGIS pro its working fine, But in web app builder not working. 

0 Kudos
TanuHoque
Esri Regular Contributor

Thanks @RamaRaomalisetti 

a few questions:

  1. do you have both Pro and Server installed on the same machine?
  2. did I understand correctly that you published your print service from Pro 2.9 to Server 10.9.1?
  3. can you pls right-click on Export Web Map gp tool in Pro (as seen in the screenshot below), and select Edit command? It will open the script behind the tool in an editor. Pls find the line that executes "ConvertWebMapToArcGISProject" function. And see how many parameters are passed to this function?

TanuHoque_1-1705024724008.png

 

 

0 Kudos
RamaRaomalisetti
Occasional Contributor

Sorry for late reply, ConvertWebMapToArcGISProject  function in the Python ArcGIS pro 3.2 have the custom parameters are 5 . For the 2.9 Custom parameters are 2.

Its worked when i install once again 2.9 arcgis pro in another machine , then Published as a new service. But i do not understand why it not worked on that machine. I hope if i overwrite the layout once again might be not work.

0 Kudos
RamaRaomalisetti
Occasional Contributor

Hi everyone,

I forgot to update you on the issue.

I have resolved it by creating another export web map tool by duplicating the existing one. I copied the same Python script to another location and created a new toolbox with the same parameters. After publishing the print tool, it worked.

It seems there might be some compatibility or overwrite issues between ArcGIS Server and ArcGIS Pro.

Finally, it worked. Sorry for the late reply

DOTPGIS
Emerging Contributor

Hi there, how did you get around the additional parameters that are not compatible with 11.1? Could you share your python script and/or some pictures? I tried making a copy of the tool as well but it is still not publishing correctly, not sure what I'm doing wrong.

0 Kudos
TanuHoque
Esri Regular Contributor

hello all,

like to share a good news. If everything goes as planned, a fix for this should be included in the upcoming Enterprise release 11.3.

0 Kudos
AnandChinnathambi
New Contributor

@RamaRaomalisetti 

When using ArcGIS Pro 3.2 or 3.3 on an ArcGIS Server 11.1 machine, or ArcGIS Pro 3.1 and later versions on an ArcGIS Server 10.9.1 machine, you may encounter failures with the default ArcGIS Print tool located in the utilities folder. This issue also affects custom print tools published.

To resolve this, you need to remove ArcGIS Pro from the ArcGIS Server machine, which will fix the default Print Tool error. If you need to publish a Custom Print GP tool, use ArcGIS Pro 3.0.3 or 2.9 with ArcGIS Server 11.1 or 10.9.1, as these versions work without issues.

It appears that upgrading ArcGIS Pro to 3.1 or 3.2 alters or upgrades the server print tool parameters, causing these compatibility issues.

RamaRaomalisetti
Occasional Contributor

@AnandChinnathambi 

 

Thank you for the Suggestion.