Describe workspace noodle scratcher

774
5
Jump to solution
01-29-2014 12:12 PM
Highlighted
Occasional Contributor
Here's a funny one.  I've got a python script that runs the arcpy.Describe method on an sde connection file.  When I run the script from the command line, it runs fine (script is attached).

However, when I run it from the command line as a different user (a local user)* it returns an error that says:

"AttributeError: DescribeData: Method connectionString does not exist"

Why would the different user matter?  I think it has an issue with the sde connection fine in question, because it can run it on other connection files w/ no problem.  But that still leaves the question of why it would run ok as one user and return an error as another.

*On the command prompt:
runas /noprofile /user:garfield python
In the python command line
>>>execfile('C:\\<folderwherepythonscriptlives>\\<nameofpythonscrip>.py')
Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Frequent Contributor
Most likely cause is the local user isn't authorized to access the database using their OS credentials.

View solution in original post

Reply
0 Kudos
5 Replies
Highlighted
Frequent Contributor
Does your SDE connection use OS authentication or database authentication? And is the path in your script the actual path to the SDE connection file? Not something like "Database Connections\SDE_admin.sde"?
Reply
0 Kudos
Highlighted
Occasional Contributor
Does your SDE connection use OS authentication or database authentication? And is the path in your script the actual path to the SDE connection file? Not something like "Database Connections\SDE_admin.sde"?


Thanks for responding.  The SDE uses OS authentication and that is the path to the connection file.  In fact, I made the connection file using the local user account (with the arcpy.CreateDatabaseConnection_management method).  This is all on a Windows 2008 R2 machine, running Server 10.1.
Reply
0 Kudos
Highlighted
Occasional Contributor
More info: the problem seems to be that with the local user, arcpy doesn't recognize the sde connection file as an sde connection file.  If I run a describe on it (see below) it says it's a DEFile, which is just a generic file on disk.*

Code to describe file:
desc = arcpy.Describe(r"C:\python_sde_scripts\gbd_connection.sde")
print desc.dataElementType
>>>DEFile

*http://resources.arcgis.com/en/help/main/10.1/index.html#/Defining_parameter_data_types_in_a_Python_...
Reply
0 Kudos
Highlighted
Frequent Contributor
Most likely cause is the local user isn't authorized to access the database using their OS credentials.

View solution in original post

Reply
0 Kudos
Highlighted
Occasional Contributor
Most likely cause is the local user isn't authorized to access the database using their OS credentials.


Yep, that was it.  Thank you.
Reply
0 Kudos