I'm publishing a webtool to our portal server. In the webtool i'm coping multiple feature classes pack them in a zip file and use this path for as output paramter for a later download. If I'm using my webtool with one feature class it works fine:
source = os.path.join(r"G:\1_Projekte\ALG\SDE-Connections\AGIS_309_U_ALG_APP.sde","AGIS_309_Prod.U_ALG_APP.alg_floraapp_saatgut_edit_f")
print(source)
gp.AddMessage(source)
arcpy.FeatureClassToGeodatabase_conversion([source],str(gdbPath))
gp.AddMessage("Data copied")
If I try to advance the script to multiple feature classe like this it fails on the server. The paths to the registered enterprise geodatabase is not resolved:
sources = []
sources.append(os.path.join(r"G:\1_Projekte\ALG\SDE-Connections\AGIS_309_U_ALG_APP.sde","AGIS_309_Prod.U_ALG_APP.alg_floraapp_massnahm_edit_f"))
sources.append(os.path.join(r"G:\1_Projekte\ALG\SDE-Connections\AGIS_309_U_ALG_APP.sde","AGIS_309_Prod.U_ALG_APP.alg_floraapp_saatgut_edit_f"))
scratchFolder = arcpy.env.scratchFolder
uid = uuid.uuid4().hex
tempPath = Path(scratchFolder).joinpath(uid)
if not tempPath.exists():
tempPath.mkdir()
gdbPath = arcpy.CreateFileGDB_management(str(tempPath), "{0}.gdb".format("floraapp"))
arcpy.FeatureClassToGeodatabase_conversion(sources,str(gdbPath))
I also tried to iterate over the workspace like this. It failed too on the server:
arcpy.env.workspace = 'G:/1_Projekte/ALG/SDE-Connections/AGIS_309_U_ALG_APP.sde'
gp.AddMessage(str(arcpy.env.workspace))
names = []
names.append("AGIS_309_Prod.U_ALG_APP.alg_floraapp_massnahm_edit_f")
names.append("AGIS_309_Prod.U_ALG_APP.alg_floraapp_saatgut_edit_f")
sources = []
for fc in arcpy.ListFeatureClasses():
if str(fc) in names:
sources.append(fc)
scratchFolder = arcpy.env.scratchFolder
print(scratchFolder)
The output from line 2 is expected to be be a path to the registered connections but looks like this:
\\arcgisserver\\directories\\arcgissystem\\arcgisinput\\ALG\\DownloadFloraAppDataToFGDB.GPServer\\extracted\\p30