I am unable to publish the web layer in ArcGIS Pro 2.4. Below are the issues are getting when publishing the service:
Please help me out to resolve this issue.
If you don't mind me asking, did you ever sort this issue out? We're having the same or very similar problems.
A couple things to try/consider - from several previous Esri Support Services cases"
Cleared out user Pro Roaming Profile and AppData and tried to publish map. Publishing succeeded without issue. Dismantled standalone site and rejoined server to original site. We believe the issue was a corrupt profile, though no definitive log entries were identified. (To clear out or rename, go to C:\Users\<user profile>\AppData\Roaming\ and C:\Users\<user profile>\AppData\Local\ and rename the Esri folder to Esri_Old
Hope this helps!
No recent changes to the credentials, so no issues there. However, I just tried renaming the Esri folders in AppData, removing and recreating the Portal connection, and re-publishing.... and it worked!!!
I should point out that the issue has been pretty sporadic, hit or miss when publishing from Pro for me and other members of my team. But hopefully this workflow -- which isn't all that bad -- is a way to fix it when the errors start popping up again. Question: Do you think just renaming the ArcGISPro subfolders would suffice? As opposed to the entire Esri folder, which has profile information for Desktop as well, things like my Normal.mxt and .sde files.
In any case, thanks so much for the suggestions! I will try to remember to update you in the future to let you know if this is a long-term solution to something that has been plaguing me for weeks.
Justin - glad it worked! I'm fairly confident that renaming just ArcGISPro to ArcGISPro_Old in both the local and roaming directories should suffice. You are correct that it "resets" ArcMap, ArcCatalog, the normal.mxt and *.sde files to factory settings. Or you can copy/paste those *.mxt and *.sde files to the "new" folder for Desktop 10.x.
Great, I will try that next time... if there is one (hopefully not ). Thanks again!
I was also having this problem with publishing my map through ArcGIS Pro (2.9.5) to ArcGIS Enterprise (10.8.1). This was trying to publish a map service to my federated server.
Instead of deleting all my settings (although I do like to do this from time to time to clean things up), I created a little script that will create the sddraft, sd and publish to my federated server. I thought I would share this (run this from the python window in ArcGIS Pro and signed in to your Portal). One thing I noticed is that the item is not created in the "portal_folder_name" that is set, it just creates it in the user's root folder for Portal.
import os
portal_url = "https://[domain_name]/portal"
federated_server_url = "https://[domain_name]/server"
portal_folder_name = "Planning"
server_folder_name = "Planning"
aprx = arcpy.mp.ArcGISProject("CURRENT")
m = aprx.listMaps(aprx.activeMap.name)[0]
sd_draft_file_path = os.path.join(os.path.dirname(aprx.filePath), m.name + ".sddraft")
sd_file_path = sd_draft_file_path.replace(".sddraft", ".sd")
service_name = m.name
server_type = "FEDERATED_SERVER"
print(f"Creating SD Draft file: \"{sd_draft_file_path}\"")
tags = ""
if m.metadata.tags:
tags = ", ".join([tag_list.strip()for tag_list in m.metadata.tags.split(",")])
sddraft = m.getWebLayerSharingDraft(server_type, "MAP_IMAGE", service_name)
sddraft.federatedServerUrl = federated_server_url
sddraft.credits = m.metadata.credits
sddraft.description = m.metadata.description
sddraft.summary = m.metadata.summary
sddraft.tags = tags
sddraft.portalFolder = portal_folder_name
sddraft.serverFolder = server_folder_name
try:
sddraft.exportToSDDraft(sd_draft_file_path)
except Exception as err:
print(f"ERROR: {err}".replace("\n", " "))
print(f"Creating SD file: {sd_file_path}")
try:
arcpy.server.StageService(sd_draft_file_path, sd_file_path)
except Exception as err:
print(f"ERROR: {err}".replace("\n", " "))
# Share to portal
print(f"Uploading service to {federated_server_url}...")
try:
arcpy.server.UploadServiceDefinition(sd_file_path, federated_server_url)
except Exception as err:
print(f"ERROR: {err}".replace("\n", " "))