Failed to upload service definition

1751
7
12-05-2021 11:31 PM
JasonHuang
New Contributor II

When I try to code the process of publishing web layer, it counters some problems. I can publish it manually, but it alerts the 'ERROR 002901: Sharing related error during geo-processing (Unable to check if service exists. (webtest/Map))' when I ran my python script. It did finish the process of 'Stage Service', and generate the file with the end of '.sd'.  Is there any mistakes related to my codes?

JasonHuang_0-1638775759184.png

 

0 Kudos
7 Replies
JasonHuang
New Contributor II

I found that the problem happened when I tried to upload service definition. There always be weird problems with arcpy api in this section. I can manually do this in geoprocessing tool but not with the same parameters for python code. (I am sure that the sd file is new for each uploading try)

JasonHuang_0-1638784329947.pngJasonHuang_1-1638784341284.png

 

0 Kudos
DavidColey
Frequent Contributor

you have an extra space between the sharing.draft_summary =  service.  otherwise  I don't see anything from this example

0 Kudos
Brian_Wilson
Occasional Contributor III

A week ago I posted about the same problem with very similar code here

https://community.esri.com/t5/python-questions/uploadservicedefinition-gets-the-good-old-error/m-p/1...

I got no responses. I am hoping you get something. I will look at it again sometime today probably.

0 Kudos
JasonHuang
New Contributor II

I got it, here is some problems with the url name of portal and server. I have dealt with it !

Brian_Wilson
Occasional Contributor III

I'm back looking at this again, thanks to you @JasonHuang  I reexamined the setting you used for the server and found a combination that works for me. That in_server arg is absurdly complicated; you have to use different values based on the type of content being shared. Another painful learning moment for me. Maybe I can go answer my own question now!

 

0 Kudos
JasonHuang
New Contributor II

Glad to hear that 🙂

0 Kudos
geeblr
by
New Contributor II

Hello jason can u please post the solution with image file.

0 Kudos