Select to view content in your preferred language

Unable to publish the Web layer in ArcGIS Pro 2.4

2295
6
10-12-2019 10:28 PM
rajeshkumarg1
Occasional Contributor

I am unable to publish the web layer in ArcGIS Pro 2.4. Below are the issues are getting when publishing the service:

  • ERROR 001426: Failed to retrieve the job status from hosted services.
  • Token renewal failed (No credentials available).
  • Server-side publishing failed
  • Failed to publish web layer ErrorMessage: Failed to publish web layer

Please help me out to resolve this issue.

6 Replies
JustinChapman2
Emerging Contributor

If you don't mind me asking, did you ever sort this issue out? We're having the same or very similar problems.

0 Kudos
Robert_LeClair
Esri Notable Contributor

A couple things to try/consider - from several previous Esri Support Services cases"

  • Error was most likely coming from password change and/or token authentication expiring. Users need to re-login to Portal after a password change to refresh the credentials. Users also need to re-login to obtain a new token. However, token expiration times can be set to a custom length through this work flow:
  • 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

  • Remove and add the Portal connection again in ArcGIS Pro.  Sign back into the Portal using your credentials.

 

Hope this helps!

JustinChapman2
Emerging Contributor

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.

Robert_LeClair
Esri Notable Contributor

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.

JustinChapman2
Emerging Contributor

Great, I will try that next time... if there is one (hopefully not ). Thanks again!

julian_svcs
Frequent Contributor

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", " "))
0 Kudos