Select to view content in your preferred language

ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade

5662
12
Jump to solution
12-12-2013 09:17 AM
deleted-user-zpcJw1u0IXiO
Deactivated User
Since upgrading to 10.2 the script I ran weekly for ArcSDE maintenance fails with an "Invalid floating point operation" error during the loop shown below:

# Get a list of all the datasets. # First, get all the stand alone tables, feature classes and rasters. dataList = arcpy.ListFeatureClasses() + arcpy.ListRasters()  # Next, for feature datasets get all of the featureclasses # from the list and add them to the master list. for dataset in arcpy.ListDatasets():     print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset)     dataList += arcpy.ListFeatureClasses(feature_dataset=dataset) # Execute the ReconcileVersions tool. arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",verList,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")


I had inserted the print statement only for debugging purposes, and when I ran the script, the last few lines output by the statement were:

Adding: [u'bc.GIS_ADMIN.landuse_zoning']
Adding: [u'bc.GIS_ADMIN.dimensions', u'bc.GIS_ADMIN.dimension_2']
Adding: [u'bc.GIS_ADMIN.traffic_lights', u'bc.GIS_ADMIN.valves', u'bc.GIS_ADMIN.StormStructures', u'bc.GIS_ADMIN.signs', u'bc.GIS_ADMIN.sidewalks', u'bc.GIS_ADMIN.manholes', u'bc.GIS_ADMIN.light_standard', u'bc.GIS_ADMIN.hydro_pole', u'bc.GIS_ADMIN.hydrants', u'bc.GIS_ADMIN.decorative_light_standard', u'bc.GIS_ADMIN.curb_gutter', u'bc.GIS_ADMIN.culverts', u'bc.GIS_ADMIN.bridge']
Adding: []
Adding: []
Adding:

I'm puzzled as to why the loop prints two empty strings ([]) followed by nothing, just before raising the floating point error. All feature classes within feature datasets are successfully listed ahead of these empty ones in the print output. I suspect these blank lines might be the cause of the error, but I see lots of "Unknown function at" lines in the error details. I can't tell whether the ReconcileVersions is ever actually reached.

Is there something I need to do to make this work, or in other words, enable 10.1 python code to run at 10.2?

Thanks,
Justin
Tags (2)
12 Replies
JakeSkinner
Esri Esteemed Contributor
Iterate through each version to see if it will fail on a specific one.  You can add the following code to do this:

for version in verList:
  print version
  arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",version,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")
0 Kudos
deleted-user-zpcJw1u0IXiO
Deactivated User
I input the code you supplied, but when I run the script, it doesn't even make it to that point, failing at the same point as before. The code never makes it all the way through the
for dataset in arcpy.ListDatasets():
section. I even input some lines to skip the mosaic datasets, but it never reached them, i.e.

for dataset in arcpy.ListDatasets():
    print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset)
    if dataset == "u'bc.GIS_ADMIN.SWOOP2010'" or dataset == "u'bc.GIS_ADMIN.SWOOP2006'":
        print "skipping SWOOP2010 and SWOOP2006"
    else:
        dataList += arcpy.ListFeatureClasses(feature_dataset=dataset)


Reason I skipped those two is that SWOOP2006 remains empty, because I've not yet loaded anything into it, and it didn't help when I isolated only that one in the if statement above, hence SWOOP2010's presence there. I am curious if the empty mosaic dataset is a source of the problem, but have so far been unable to determine that.
0 Kudos
deleted-user-zpcJw1u0IXiO
Deactivated User
I isolated the code setting up for Reconcile, while excluding the actual call to reconcile, and it still failed exactly as previously described. So that's what reinforces my belief in this being a problem with either ListFeatureClasses() or ListDatasets(), and not Reconcile itself.

I then moved the empty mosaic dataset to a different database, and when running the original code afterward, it ran flawlessly. Clearly some component of the code cannot cope with an empty mosaic dataset, and that points directly to the two commands in the thread title. Thank you so much, Jake, for your long term support leading me to this discovery.

Cheers,
Justin
0 Kudos