AnsweredAssumed Answered

Work Space wrong type Error 000301

Question asked by LarryAdgate on Jul 20, 2017
Latest reply on Jul 20, 2017 by Dan_Patterson

#Post and Reconcile script:

#My perpetual Error: "Work Space wrong type Error 000301" is frustrating and I need some help. Thank You  

 

import arcpy
import time, datetime

 

# Current Day
Day = time.strftime("%m-%d-%Y", time.localtime())
# Current Time
Time = time.strftime("%I:%M:%S %p", time.localtime())


editDB = "Database Connections\\Arden_Admin.sde"
Post_Reconcile_Log1_txt = "\\\\Client\\R$\\Engineering and Planning\\GIS\\813 - Post_Reconcile Log\\Post_Reconcile_Log1.txt"


# Set workspace
workspace = editDB

# Set the workspace environment
arcpy.env.workspace = workspace
arcpy.env.overwriteOutput = True

   
# Start Time
print 'Process Started at ' + str(Day) + " " + str(Time)

# block new connections to the working and prod database.
print "Blocking Connections..."
arcpy.AcceptConnections(editDB, False)

 

# disconnect all users from the working and prod database.
print "Disconnecting Users..."
arcpy.DisconnectUser(editDB, "ALL")

 

#Get a list of all versions besides QAQC and DEFAULT to pass into the ReconcileVersions tool.
ver1List = [ver1.name for ver1 in arcpy.da.ListVersions(editDB) if ver1.name != 'GSWC_SDE.Quality Control' and ver1.name != 'sde.DEFAULT']
print ver1List

 

arcpy.ReconcileVersions_management(editDB, "ALL_VERSIONS", "GSWC_SDE_Quality Control", ver1List, "LOCK_ACQUIRED", "ABORT_CONFLICTS", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION", Post_Reconcile_Log1_txt)


# Extract QAQC version from the list of versions to pass to ReconcileVersions tool.
ver2List = [ver2.name for ver2 in arcpy.da.ListVersions(editDB) if ver2.name == 'GSWC_SDE.Quality Control']
print ver2List

 

arcpy.ReconcileVersions_management(editDB, "ALL_VERSIONS", "sde.DEFAULT", ver2List, "LOCK_ACQUIRED", "ABORT_CONFLICTS", "BY_OBJECT", "FAVOR_EDIT_VERSION", "POST", "KEEP_VERSION", Post_Reconcile_Log1_txt)

 

#Allow the database to begin accepting connections again
print "Set databases to allow connections..."
arcpy.AcceptConnections(editDB, True)

 

#My Error message is below:
#Runtime error  Traceback (most recent call last):   File "<string>", line 41, in <module>   File "d:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\management.py", line 16193,
#in ReconcileVersions     raise e ExecuteError: ERROR 000301: The workspace is of the wrong type Failed to execute (ReconcileVersions). 

Outcomes