Share python script with 'the GIS object' from Pro to Portal

730
3
02-04-2019 02:42 PM
DSIProvince_Nord
New Contributor III

Hello,

Trying to create and share a simple python script as a GP service, I keep having a "staging failed" error when sharing from AGPro to Portal. And a suspicious warning "Data source used by Script XXXX is not registered with the server and will be copied to the server : My Hosted Services"

My script connects to the portal via the GIS object (from arcgis.gis import GIS) and look for a feature service (gis.content.search), then update one field in one object.

From what I understand, it is due to "the GIS object" in my script, for example I'm having the same issue with a very simple script that does nothing but connect to the portal and look for a web map :

from arcgis.gis import GIS
import arcpy
gis = GIS("my_portal_url" , "user", "pass")
search_result = gis.content.search("title:SIG Intempéries", item_type = "Web Map")
print(search_result[0].type)

Both scripts run well in AGPro and Jupyter Notebook but when I try to share the result as a Web Tool : same warning and same staging failed error

Any idea ?

0 Kudos
3 Replies
MarisaClaggett
Occasional Contributor II

Hi,

I attempted to publish the same script to my Portal from ArcGIS Pro and it published successfully.  I was then also able to run the web tool successfully.  What version Pro and Portal do you have?  Also, can you publish anything referenced to the Portal?  Let me know!

Thanks,

Marisa

0 Kudos
DSIProvince_Nord
New Contributor III

Hi Marisa,

I use AGPro 2.3 and publish to portal 10.6.1

I usually publish web maps, feature services and even printing services without any problem.

To be clear, what I'm doing is :

- In AGPro on my desktop, I load my python script in the default toolbox as a script. I don't check the "import script" option. The python script is located on my desktop as well.

- With AGPro connected to my portal, I open and run the script normally

- In the catalog pane, in history, I right-click the result and share as a web tool

- I check "copy all data", set up the location folders on my portal and hosting server. Under configuration, I don't check Upload and leave Asynchronous.

When analyzing I have this warning "Data source used by Script XXX is not registered with the server and will be copied to the server : My Hosted Services"

And when publishing I have this Staging error and log :

Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:34 Status: InProgress StatusMessage: Successfully wrote sharing info file
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:34 Status: InProgress StatusMessage: Creating thumbnail from map
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:34 Status: Pending StatusMessage: Sharing process started
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:35 Status: InProgress StatusMessage: Sharing process started
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:35 Status: InProgress StatusMessage: Successfully obtained a license from the licensing portal
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:36 Status: InProgress StatusMessage: Creating thumbnail from map
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:37 Status: InProgress StatusMessage: Publishing process started
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:37 Status: InProgress StatusMessage: Loading manifest
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:37 Status: InProgress StatusMessage: Consolidating data and staging web tool
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:47 Status: InProgress StatusMessage: Using ArcGIS Version 12.3 for staging (Source for version: GP Staging Parameters)
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:47 Status: InProgress StatusMessage: Stage Tool initialized
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:47 Status: InProgress StatusMessage: Consolidate data
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:47 Status: InProgress StatusMessage: Staging GP service
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:50 Status: Failed StatusMessage: Consolidation failed ErrorMessage: Consolidation failed
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:50 Status: Failed StatusMessage: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds. ErrorMessage: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:50 Status: Failed StatusMessage: Failed to execute (StageService). ErrorMessage: Failed to execute (StageService).
Script 204 WebTool "Portal url" "user" 2019-02-28 11:11:50 Status: Failed StatusMessage: Staging failed ErrorMessage: Staging failed

0 Kudos
AlexBriggs1
New Contributor II

I am seeing the same issue - the service will publish with anonymous or ‘pro’ authentication, but as soon as you specify a portal url and built in creds the staging failed occurs.

did you manage to get a solution to this?

Thanks,

Alex

0 Kudos