I have a script that loads a vector layer from an enterprise geodatabase (PostgreSQL database).
I have also tried
as suggested in How does one access a featurelayer in SDE via Python?
It works on Desktop. The published tool returns the error:
File "\...\hosting-root-directories\arcgissystem\arcgisinput\toolName.GPServer\extracted\p20\services_test\skriptName.py", line 5 g_ESRI_variable_1 = os.path.join(arcpy.env.packageWorkspace,'\\...\hosting-root-directories\arcgissystem\arcgisinput\toolName.GPServer\extracted\p20\[email protected]\SDE.ven.x.y"'') ^ SyntaxError: EOL while scanning string literal
I have registered the database in the Manage Registered Datastores via add -> database -> import. The connection link is
It is the same for publisher and server. I can uncheck "same as publisher", but then I cannot enter anything, as I did for registering the folders (C:).
How do I need to address the file in an EGDB so that it is recognized as being in the registered database? Or do I maybe have to run "Enable Enterprise Geodatabase" (right click on database in catalog pane)? It says that the authorization file is on "\Program Files\ESRI\License<release#>\sysgen folder on Windows". I cannot find this path, does it refer to the server. In the server manager in the browser I could also not find it. Where do I access the sript on the server? I read in some posts here that people did that and just fixed the paths there. Do I have to ask an admin to do it or could I do it as publisher?
When I hover over the database in catalog, it shows up "Type: Enterprise Connection".
When I replace the path to the EGDB with a path to a shapefile, (the folder where the shapefile is in being registered as a datastore), the published tool returns the error:
File "\...\hosting-root-directories\arcgissystem\arcgisinput\toolName.GPServer\extracted\p20\folderName\script.py", line 7 g_ESRI_variable_3 = 'C:\shapefileName.shp'00.shp' ^ SyntaxError: invalid syntax