Arcpy - starting edit session on Geodatabase Enterprise raises an error randomly

73
0
06-02-2020 12:02 PM
Highlighted
Occasional Contributor III

I am using arcpy v10.6.1 to update, in an edit session, a table stored on a Geodatabase Enterprise installed on Postgres.

The python code is used via a toolbox in ArcMap

Times to times, I have this weird error when running the tool: Runtimeerror: The operation was attempted on an empty geometry

import arcpy, os

WORKSPACE = os.path.join(r"C:\\", "Script", "Connections", "PostgrSQL.sde")
SURVEY_FC = os.path.join(WORKSPACE, "SoumissionsEncombrants")

edit = arcpy.da.Editor(WORKSPACE)
edit.startEditing(False, False) #this line raises the error
edit.startOperation()

#here I use an update cursor on SURVEY_FC table

edit.stopOperation()
edit.stopEditing(True)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

The error is raised by the edit.startEditing(False, False) line

I have try to set the edit.startEditing multiuser and undo parameters to True, but the same error is raised randomly.

I have to close and re-open ArcMap/ArcCatalog and run the tool again to make it works.

What could be the cause of the error?

Tags (2)
Reply
0 Kudos
0 Replies