Arcpy Database Connection from Server Failing

1951
6
Jump to solution
03-03-2016 11:30 AM
by Anonymous User
Not applicable

Hello -

I have some Python scripts on our GIS server. Suddenly, actually just this morning, the SDE connections have stopped working. The scripts use .sde files located in a folder on a shared drive to set the python workspace to a database on our database server:

arcpy.env.workspace = os.path.join(sdeFolder,'test.sde')
testFiles = arcpy.ListFeatureClasses()
print testFiles

The arrays are empty rather than showing all feature classes. Any idea how to fix/debug?

Thanks!

Sarah

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RebeccaStrauch__GISP
MVP Emeritus

just to make sure, did you try the simple things like rebooting all the machines involved?  Just to make sure it isn't just a hiccup in your system/network.  If it worked yesterday, unless something was installed overnight, that usually fixes many things.

View solution in original post

0 Kudos
6 Replies
JamesCrandall
MVP Frequent Contributor

Likely not a python issue if it had been working.

What is the sdeFolder variable set to?

Is it an actual valid path?

Does test.sde actual exist in that folder?

I'd think you could do some quick checks directly in ArcCatalog.

0 Kudos
by Anonymous User
Not applicable

Thanks James - It's a relative path to a server (e.g. "\\\SERVERNAME\Folder\sdeFolder"). It's valid and test.sde exists. The script and connection work fine from my desktop as well.

0 Kudos
RebeccaStrauch__GISP
MVP Emeritus

just to make sure, did you try the simple things like rebooting all the machines involved?  Just to make sure it isn't just a hiccup in your system/network.  If it worked yesterday, unless something was installed overnight, that usually fixes many things.

0 Kudos
by Anonymous User
Not applicable

Hm, indeed. I don't have control to reboot the server but I will contact IT to give that a try and ask if they made any changes.

0 Kudos
by Anonymous User
Not applicable

So the error came back, quickly. After talking more to IT they had done some updating and the connection to our database server was being attempted through an old DNS server that was gone. I don't know what they did to fix it, but they updated something and it's working again.

0 Kudos
VinceAngelo
Esri Esteemed Contributor

The most relevant question in all "All of a sudden, it's not working" situations is "What has changed?"

Unfortunately, with the modern division of IT, DBA, and geodatabase admin, the answer may not be all that obvious. 

Then there's the counter-example -- I once had a mail server stop working when I changed the domainname, and eventually it was tracked down to the SunOS4 box being up for over 2 billion (2^31) milliseconds without reboot, and the OS bug just happened to occur while I was dorking with the system.

- V