Select to view content in your preferred language

ERROR 000837: The workspace is not the correct workspace type

21270
12
11-20-2012 01:14 PM
GaryEhrhardt
Deactivated User
I have a very simple python script that does a compress on one of our enterprise GDB's. The script used to successfully run every night but is now receiving the following error:
"ERROR 000837: The workspace is not the correct workspace type"

There have been 2 recent changes to our environment - one of which must be a contributing factor to this script now erroring out. The first is upgrading from ArcGIS 10.0 SP4 to ArcGIS 10.1 SP1. The other is that we are now running this script on a new server where the old server had 32 bit processing, and the new server is 64 bit.

Here is the script that worked on our old server:

import arcgisscripting
gp = arcgisscripting.create()
gp.toolbox = "management"
gp.compress("Database Connections\sde_loader@bierstadt.sde")

Running the same script on the new server (only change being the db connection) errored out.

I tried updating the python code as follows:

import arcpy
arcpy.ClearWorkspaceCache_management()
arcpy.Compress_management("Database Connections\saxon2_bierstadt_sde_loader.sde")

This also received the same error (000837)

Any ideas on what may be causing this error would be much appreciated.

Gary
12 Replies
T__WayneWhitley
Honored Contributor
Good to know - Server 2008 R2 is on my test machine, soon-to-be production server.  So in case I have a similar problem I'll refer to this.
Also, if it helps, when running 'admin' type of scripts on the server, esp as scheduled tasks, I think it's better to store the connection file in a separate 'non-user-profile' location anyway and specify the UNC pathname.  Could create the connection dynamically too.

Anyway, thanks for passing along the info.
0 Kudos
HarshalGharat
Emerging Contributor

I am not sure if I might get any response on this thread as it looks to be quite an old thread. I am facing a very weird issue in setting the workspace. When I setup the workspace inside python window in ArcMap/ArcCatalog, it just works fine.

But the moment I do the same in a standalone script, the things do not work at all. I tried other options like creating connection file in scratch folder and then setting it as a workspace but still no luck.

This is driving me crazy and any help in this regard is really appreciated.

0 Kudos
Chris_Kell
Occasional Contributor

Harshal,

I'm experiencing the same, what was your solution?

Thanks

 

0 Kudos