Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

Unable to connect to “Database Connections/.sde” from python

$
0
0

I just upgraded to 10.3.1 and now I am having issues running my administrative tasks set with Python scripts.

I am unable to use the string “Database Connections/some.sde”, i.e:

arcpy.ListUsers("Database Connections/some.sde) Returns the following error:

Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
userList = arcpy.ListUsers("Database Connections/some.sde")
File "C:Program FilesArcGISServerArcPyarcpy__init__.py", line 1058, in ListUsers
return utils.listofnamedtuples(gp.listUsers(sde_workspace), 'user')
File "C:Program FilesArcGISServerArcPyarcpygeoprocessing_base.py", line 504, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
TypeError: Could not open SDE workspace.

I can use the full path string for some tasks like ListUsers, AcceptConnections,etc., but not others like reconcile and post, e.g.:

“C:Users%username%AppDataRoamingESRIDesktop10.3ArcCatalogsome.sde”

Fails without throwing error at: arcpy.ReconcileVersions_management("C:Users%username%AppDataRoamingESRIDesktop10.3ArcCatalogsome.sde","ALL_VERSIONS","DBO.QC","DBO.Chris;DBO.Joe","LOCK_ACQUIRED","NO_ABORT","BY_OBJECT","FAVOR_EDIT_VERSION","POST","KEEP_VERSION","#")

The full script is here, which worked great prior to 10.3 upgrade: reconcile and post script

In ArcCatalog I have created these database connections, they work fine, I can browse in Catolog, and the .sde files exist in my AppData/Roaming/ESRI subdirectory. I have tried copying all my old connection strings from the 10.2 into my roaming profile. Is there some environmental variable that needs to be repaired? Do I need to re-install Server and Desktop on this machine?

Question: How can I repair my “Database Connections” to run Python scripts


Viewing all articles
Browse latest Browse all 767

Trending Articles