Feature services that create enterprise geodatabase edit versions are building version names in the format of "DOMAIN\username_servicename" I have a Python script that attempts to rename the edit version when certain conditions are met. However if the username starts with a lowercase "n", the tool interprets this as a Python newline and cannot find the version.
Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.5\arcpy\arcpy\management.py", line 18176, in AlterVersion raise e ExecuteError: ERROR 999999: Error executing function. Version not found [SRVR.DOM doe_testing] Failed to execute (AlterVersion).
DOM\ndoe_testing becomes DOM doe_testing
The Alter Version tool in ArcToolbox will let you select the edit version after identifying the database connection, but it populates as (from the example above) as "SRVR.DOMdoe_testing". That allows the tool to start executing, but fails with the error of not being able to find the version.
I've tried what I know with raw strings, double backslash, changing to all uppercase for the version name with no success. Anyone else experienced this and found a workaround?
have you tried making it a variable
dom = r"DOM\ndoe_testing" arcpy.AlterVersion_management(sdeConn, dom, "edits_ndoe", "", "PROTECTED")
and you were missing a double quote at the end of "PROTECTED" in case it was a copy issue
Sorry - poor copy/paste skills on my part... I did try making it a variable, same result:
Version not found [SRVR.DOM doe_testing] Failed to execute (AlterVersion)
I've also tried using the output of arcpy.ListVersions(sdeConn) to get the name:
u'SRVR.DOM\\ndoe_testing' so I pull that item from the returned list and use it as the input name. Same error as above. Maybe we just block users named Nick, Ned, Nancy, etc from using the system altogether.