AnsweredAssumed Answered

Calling arcpy.FeatureClassToFeatureClass_conversion with annotation feature class crashes Python

Question asked by craigpatterson on Nov 9, 2018

I'm creating a simple script that copies feature classes from SDE to a file geodatabase. For all point and line  and all but one annotation feature classes, I just call FeatureClassToGeodatabase and the script handles them perfectly. 

 

I was having a problem including an annotation feature class. I was receiving an error saying that it used a different projection than the target feature dataset (even though I was copying it from a feature dataset that uses the same projection). After some research, I found I could call Feature Class to Feature Class from toolbox without it crashing, so I copied the Python snippet and added it to my script. 

 

When my script calls arcpy.FeatureClassToFeatureClass_conversion for that annotation layer, it runs for a while then eventually I receive this message 

 

When I check the FGDB, the annotation layer has been copied there and it has all of the features. It seems like it just can't complete that command gracefully. I've put a try: except: block around the method, but it doesn't catch any errors.

 

Here is the code in question.

try:
arcpy.FeatureClassToFeatureClass_conversion(
in_features='{0}/{1}.PWS/{1}.pwValveAnno'.format(sourceGdb, schema),
out_path=workingGdb + "/PWS",
out_name="pwValveAnno",
where_clause="",
field_mapping= 'FeatureID "FeatureID" true true true 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,FeatureID,-1,-1; \
ZOrder "ZOrder" true true true 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,ZOrder,-1,-1; \
AnnotationClassID "AnnotationClassID" true true true 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,AnnotationClassID,-1,-1; \
Element "Element" true true true 0 Blob 0 0 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Element,-1,-1; \
SymbolID "SymbolID" true true true 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,SymbolID,-1,-1; \
Status "Status" true true true 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Status,-1,-1; \
TextString "TextString" true true false 255 Text 0 0 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,TextString,-1,-1; \
FontName "FontName" true true false 255 Text 0 0 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,FontName,-1,-1; \
FontSize "FontSize" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,FontSize,-1,-1; \
Bold "Bold" true true false 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Bold,-1,-1; \
Italic "Italic" true true false 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Italic,-1,-1; \
Underline "Underline" true true false 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Underline,-1,-1; \
VerticalAlignment "VerticalAlignment" true true false 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,VerticalAlignment,-1,-1; \
HorizontalAlignment "HorizontalAlignment" true true false 2 Short 0 5 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,HorizontalAlignment,-1,-1; \
XOffset "XOffset" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,XOffset,-1,-1; \
YOffset "YOffset" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,YOffset,-1,-1; \
Angle "Angle" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Angle,-1,-1; \
FontLeading "FontLeading" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,FontLeading,-1,-1; \
WordSpacing "WordSpacing" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,WordSpacing,-1,-1; \
CharacterWidth "CharacterWidth" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,CharacterWidth,-1,-1; \
CharacterSpacing "CharacterSpacing" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,CharacterSpacing,-1,-1; \
FlipAngle "FlipAngle" true true false 8 Double 8 38 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,FlipAngle,-1,-1; \
Override "Override" false true false 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,Override,-1,-1; \
oldFID "oldFID" true true false 4 Long 0 10 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,oldFID,-1,-1; \
SHAPE_STArea__ "SHAPE_STArea__" false false true 0 Double 0 0 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,SHAPE.STArea(),-1,-1; \
SHAPE_STLength__ "SHAPE_STLength__" false false true 0 Double 0 0 ,First,#,{0}/{1}.PWS/{1}.pwValveAnno,SHAPE.STLength(),-1,-1'.format(sourceGdb, schema),
config_keyword="")
except MemoryError,error:
log_exception(error)
except Exception, exception:
log_exception(error, false)

 

When I look in Windows Event Log, I find the following error. I believe that the Exception code indicates a memory issue

Faulting application name: python.exe, version: 0.0.0.0, time stamp: 0x59bd8919
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x000007fe7f11124b
Faulting process id: 0x1aec
Faulting application start time: 0x01d477aa6a534388
Faulting application path: C:\Python27\ArcGISx6410.6\python.exe
Faulting module path: unknown
Report Id: d3b9d9f2-e39e-11e8-833b-eeb56407000d

Has anyone run into this before? Any advice is appreciated.

 

- Craig

Outcomes