<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CreateVersion tool doesn't like my workspace in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733990#M24190</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does it work when you do it manually? There seems to be a lot of bugs in v10 SP0, so it wouldn't suprise me if was ArcGIS itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Per the error and warning, are there "invalid" values? Are you sure DefaultSdeGDB points to a .sde file, and are you sure that .sde file exists?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Nov 2010 20:18:19 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2010-11-02T20:18:19Z</dc:date>
    <item>
      <title>CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733989#M24189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've written a Python script that pulls a bunch of feature classes out of SDE into a file GDB on my C: drive, performs a bunch of analysis, then creates a new version on SDE (a child of default), puts the analysis results in the database, reconciles, posts, etc...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.CreateVersion_management(DefaultSdeGDB, "sde.DEFAULT", VersionName, "PROTECTED")&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;used to work fine, but something must have changed somewhere because suddenly the CreateVersion tool fails with the following messages:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;arcpy.CreateVersion_management(DefaultSdeGDB, "sde.DEFAULT", VersionName, "PROTECTED")&lt;BR /&gt;File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 9192, in CreateVersion&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;BR /&gt;arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.&lt;BR /&gt;ERROR 000837: The workspace is not the correct workspace type.&lt;BR /&gt;WARNING 000379: The value may not be valid because of empty domain or does not exist in the domain&lt;BR /&gt;Failed to execute (CreateVersion).&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The "DefaultSdeGDB" variable is a reference to a connection file in ArcCatalog's "Database Connections" folder, and it works when creating references to feature classes earlier in the script.&amp;nbsp; And it &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;used to&lt;/SPAN&gt;&lt;SPAN&gt; work in this function as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This happens regardless of whether I'm pointing at our production database or testing database (but they're on the same machine and they're both still running 9.3 while 10 is on my desktop--but that didn't create a problem earlier).&amp;nbsp; If I delete all the earlier code from the script and run it again (starting with "CreateVersion..."), it works fine.&amp;nbsp; With that in mind, I've tried setting the "DefaultSdeGDB" variable to 'None,' waiting five seconds, resetting the variable, and retrying the version creation; but that doesn't work either.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other ideas?&amp;nbsp; Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 15:57:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733989#M24189</guid>
      <dc:creator>DanNarsavage</dc:creator>
      <dc:date>2010-11-02T15:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733990#M24190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does it work when you do it manually? There seems to be a lot of bugs in v10 SP0, so it wouldn't suprise me if was ArcGIS itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Per the error and warning, are there "invalid" values? Are you sure DefaultSdeGDB points to a .sde file, and are you sure that .sde file exists?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 20:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733990#M24190</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-02T20:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733991#M24191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Chris.&amp;nbsp; Yes and yes--it works manually and the variable holds a reference to an existing connection file.&amp;nbsp; I'm kinda thinking the same thing about a bug, but my lack of faith in my own skills prevents me from writing this off until a patch or service pack.&amp;nbsp; Thanks again!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 20:30:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733991#M24191</guid>
      <dc:creator>DanNarsavage</dc:creator>
      <dc:date>2010-11-02T20:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733992#M24192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is on line 9192 of C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Nov 2010 21:19:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733992#M24192</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2010-11-02T21:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733993#M24193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"raise e"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's just what's in the "except" statement for when something fails.&amp;nbsp; Here's the whole function that's in there (but just to be clear, this is ESRI code, not mine):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;@gptooldoc('CreateVersion_management', None)
def CreateVersion(in_workspace=None, parent_version=None, version_name=None, access_permission=None):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """CreateVersion_management(in_workspace, parent_version, version_name, {access_permission})

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Creates a new version in the specified geodatabase.

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INPUTS:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; in_workspace (RemoteDatabase):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The ArcSDE geodatabase that contains the parent version and will contain the new
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version. The default is to use the workspace defined in the environment
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; settings.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parent_version (String):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The geodatabase, or version of a geodatabase, on which the new version will be
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; based.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version_name (String):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The name of the version to be created.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; access_permission {String}:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The permission access level for the version."""
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retval = convertArcObjectToPythonObject(gp.CreateVersion_management(*gp_fixargs((in_workspace, parent_version, version_name, access_permission), True)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return retval
&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception, e:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not gonna hunt down what went wrong in the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;convertArcObjectToPythonObject&lt;/SPAN&gt;&lt;SPAN&gt; function.&amp;nbsp; If there's a problem there then that's certainly an ESRI issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733993#M24193</guid>
      <dc:creator>DanNarsavage</dc:creator>
      <dc:date>2021-12-12T07:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733994#M24194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dan, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try running this line right before creating the version. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.ClearWorkspaceCache_management()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have seen some cases in my testing where connection properties were cached and caused issues when trying to create new workspaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 14:16:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733994#M24194</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2010-11-03T14:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733995#M24195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did it (at least in our testing database)!&amp;nbsp; Thanks Russell!&amp;nbsp; I've never quite understood what that tool was supposed to accomplish.&amp;nbsp; Now I know . . . sorta.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Did ESRI do away with the "This post answered my question" thingamajig for these new forums?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 15:14:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733995#M24195</guid>
      <dc:creator>DanNarsavage</dc:creator>
      <dc:date>2010-11-03T15:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733996#M24196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Glad to hear that helped.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Did ESRI do away with the "This post answered my question" thingamajig for these new forums?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The thingamajig is gone for now. I *think* there are plans to bring it back at some point but am not 100% sure.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Nov 2010 15:25:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733996#M24196</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2010-11-03T15:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733997#M24197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using ArcGIS V10.0 SP2.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used ClearWorkspaceCache_managment tool before CreateVersion.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I got this error 000837(above mentioned).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 07:03:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733997#M24197</guid>
      <dc:creator>LalitArora1</dc:creator>
      <dc:date>2012-06-21T07:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: CreateVersion tool doesn't like my workspace</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733998#M24198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've finally found a fix to the ERROR 000837 in this context.&amp;nbsp; I was getting this error when reconciling and posting a number of versions in a loop.&amp;nbsp; It would work the first time but on the second loop, I get the 000837.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found that I needed to basically reconnect to SDE on each loop (it appears to disconnect after each Rec and Post), so I use the arcpy.ClearWorkspaceCache_management() to clear the connection and reconnect using a simple function. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set up database connection as a repeatable process to prevent connection problems during looping &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;def connectWorkspace (cw):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = originalWksp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; theWS = arcpy.env.workspace&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return theWS&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Set original workspace variable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; originalWksp = arcpy.GetParameterAsText(0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;# Then just before each occurance of the "Reconcile and Post" line of code &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;# Clear connection and reconnect to avoid "ERROR 000837: The workspace is not the correct type"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ClearWorkspaceCache_management ()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; theWS = connectWorkspace (originalWksp)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bruce&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;PS Note that the 3 lines of function code need to be indented, but just don't disply that way on this web page.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 00:03:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/createversion-tool-doesn-t-like-my-workspace/m-p/733998#M24198</guid>
      <dc:creator>BruceCotton</dc:creator>
      <dc:date>2013-05-07T00:03:16Z</dc:date>
    </item>
  </channel>
</rss>

