2

We are running ArcGIS Desktop 10.1 SP1, and also have ArcFM installed.

I have this simple code:

workspace = "C:\\my.sde"
arcpy.env.workspace = workspace
edit = arcpy.da.Editor(arcpy.env.workspace)
edit.startEditing(False, True)
edit.startOperation()
with arcpy.da.InsertCursor("C:\\my.sde\\dataset\\feature", ("Comments")) as icur:
 try:
 icur.insertRow(["Test comment"])
 except Exception as e:
 print e
edit.stopOperation()
edit.stopEditing(True)

I receive the very specific (/s) error:

SystemError: error return without exception set

I've tried the same code on a different feature class in the same geodatabase and I get:

RuntimeError: Field is not editable.

But I can't think of any reason why it's not editable. I can edit the data in ArcMap just fine. Any idea what could be wrong?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Aug 22, 2014 at 22:24
6
  • Is your dataset registered as versioned? Can you create a new row manually in ArcMap? Commented Aug 22, 2014 at 22:30
  • Would you be able to remove your try/except statement to let Python display more of an error message and then post that, please? And something else I often recommend doing is to try substituting your ArcSDE feature class for a file geodatabase feature class to see if this is the Python code rather than ArcSDE. Commented Aug 22, 2014 at 22:31
  • @Dowlers yes it's versioned and I can create new data just fine in ArcMap. Commented Aug 22, 2014 at 22:32
  • @PolyGeo it just sends the same message but in a popup window. Commented Aug 22, 2014 at 22:32
  • Where's the popup window coming from? Try running it from an IDE like IDLE to keep the test as simple as possible. Commented Aug 22, 2014 at 22:34

2 Answers 2

2

It had to do with ArcFM, which I had a feeling was the problem.

The script needs to checkout a license.

They have a sample script available:

How-To - Work with ArcFM features in Python

Solution

As when working with ArcFM features in VBA, ArcGIS for Desktop, or anywhere else, an ArcFM license is required to edit the features...

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
answered Aug 22, 2014 at 23:28
3
  • The reason for this is because of the com objects in the database. I have seen earlier the use of removing the arcfm objects, run the esri script and rebiild the arcfm. It is nice to know they now have script license checkout to enable esri functionality and not have to remove arcfm objects. Commented Aug 23, 2014 at 20:40
  • 1
    I found the python snippet near the bottom of this page to be helpful to checkout an ArcFM license. Commented Aug 23, 2014 at 23:01
  • @BradNesom yeah, it's still a bit of a pain though. They really have their hands on everything in the database. Commented Aug 24, 2014 at 7:36
1

Field Lengths

Insufficient length in a field can cause this. Especially when using cursors to copy values from one feature class to another, it can be tricky to see what fields may be short in length.

Here is a helpful geonet thread on the issue as well: https://community.esri.com/thread/91717

answered Jan 10, 2018 at 21:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.