<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341518#M26783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Iterate through each version to see if it will fail on a specific one.&amp;nbsp; You can add the following code to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for version in verList:
&amp;nbsp; print version
&amp;nbsp; arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",&lt;STRONG&gt;version&lt;/STRONG&gt;,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:07:48 GMT</pubDate>
    <dc:creator>JakeSkinner</dc:creator>
    <dc:date>2021-12-11T16:07:48Z</dc:date>
    <item>
      <title>ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341508#M26773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# Get a list of all the datasets. # First, get all the stand alone tables, feature classes and rasters. dataList = arcpy.ListFeatureClasses() + arcpy.ListRasters()&amp;nbsp; # Next, for feature datasets get all of the featureclasses # from the list and add them to the master list. for dataset in arcpy.ListDatasets(): &amp;nbsp;&amp;nbsp;&amp;nbsp; print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset) &amp;nbsp;&amp;nbsp;&amp;nbsp; 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")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: [u'bc.GIS_ADMIN.landuse_zoning']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: [u'bc.GIS_ADMIN.dimensions', u'bc.GIS_ADMIN.dimension_2']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;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']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Justin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 17:17:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341508#M26773</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2013-12-12T17:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341509#M26774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is the dataList used in a later part of&amp;nbsp; your script?&amp;nbsp;&amp;nbsp; The ReconcileVersions tool does not use this&amp;nbsp; list.&amp;nbsp; It will use a list of versions that you have set to the&amp;nbsp; variable 'verList'.&amp;nbsp; If the dataList is not used in a later&amp;nbsp; part of you script, you can comment it out and you should be able to&amp;nbsp; reconcile all of your versions successfully.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2013 17:19:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341509#M26774</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-12-12T17:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341510#M26775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your reply, Jake. My late reply is because I hadn't been notified of yours, finding it only today when I decided I should check the forum.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;dataList is indeed used later for Analyze. I do see that ReconcileVersions is using verList, so thank you for pointing that out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I moved the print statement to handle verList, and found its content as it should be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So by your prompt I commented out each line referencing dataList and ran the script again. It succeeded, but I noticed afterward that dataList had remained in the parameters for AnalyzeDatasets called later on in the script, yet it reported no errors. On that note I un-commented the dataList lines and ran the script once more, and it still worked! I have no idea why it works now with everything coded exactly as it was before, but thank you for the help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Justin,&lt;BR /&gt;&lt;BR /&gt;Is the dataList used in a later part of&amp;nbsp; your script?&amp;nbsp;&amp;nbsp; The ReconcileVersions tool does not use this&amp;nbsp; list.&amp;nbsp; It will use a list of versions that you have set to the&amp;nbsp; variable 'verList'.&amp;nbsp; If the dataList is not used in a later&amp;nbsp; part of you script, you can comment it out and you should be able to&amp;nbsp; reconcile all of your versions successfully.&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 14:41:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341510#M26775</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2013-12-18T14:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341511#M26776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Apparently I may have been too hasty in my marking this as answered, because when I tried just now to run the script, it threw the floating point error once again. So I commented out the dataList lines again to try running the script once more, and it ran without error! I'm okay with removing dataList, but only if I can know how the results of Analyze Datasets will differ now when called with the in_datasets parameter as an empty dataList string, compared to when calling it specifying the populated dataList. Do I even need to be concerned? What is the impact?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 16:06:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341511#M26776</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2013-12-18T16:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341512#M26777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Justin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you post the entire script?&amp;nbsp; This will help understand what exactly is going on.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 16:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341512#M26777</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-12-18T16:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341513#M26778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jake,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you. I've been away and just came back to this forum today (and I just discovered my subscription notices were set to "my control panel only"!) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yesterday as I was preparing to head home, I launched the code for the first time since my last post, and left it running. This morning I found it had failed, with PyScripter reporting: "exceptions.NameError: name 'dataList' is not defined" (line 139). Strange that it only reported this error now, when it did not do so the last time, despite nothing having changed in code. It makes total sense for the error, though, given the lines that populate dataList are commented out, but what makes no sense is why it ever did work with these lines commented. I'm curious what you can find in the code below. For clarity, the debugOn is simply for running the code without disconnecting users and doing the compress. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your interest. I can respond more readily to any replies.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# sde_maint.py
# Created on: 2012-10-22 13:54:03.00000
#&amp;nbsp;&amp;nbsp; (generated by Justin)
# Usage:
# Description: runs Analyze, Compress, and Analyze on the specified
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcSDE geodatabase
# ---------------------------------------------------------------------------

# Set the necessary product code
#import arceditor
#debugOn = True


# Import arcpy module
import arcpy, os, datetime, time, SynchronizeReplica
from time import localtime, strftime

# Script arguments
##Log_file = arcpy.GetParameterAsText(0)
##if Log_file == '#' or not Log_file:
##&amp;nbsp;&amp;nbsp;&amp;nbsp; Log_file = "G:\\Administration\\Reconcile logs\\test5.log" # provide a default value if unspecified
startTime = datetime.datetime.now()
print startTime.strftime("%Y-%m-%d %H:%M:%S")

debugOn = arcpy.GetParameter(1)
if debugOn == '#' or not debugOn or (debugOn != 'y'):
&amp;nbsp;&amp;nbsp;&amp;nbsp; debugOn = bool(False)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Full SDE geodatabase maintenance begins...'
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; debugOn = bool(True)
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Debug mode is enabled. Partial SDE geodatabase maintenance begins...'

gdb = arcpy.GetParameterAsText(0)
if gdb == '#' or not gdb or (gdb != 'bc' and gdb != 'bc_dev' and gdb != 'bcwa'):
&amp;nbsp;&amp;nbsp;&amp;nbsp; gdb = 'bc_dev'

# set the workspace
#arcpy.env.workspace = 'Database Connections\\gis_admin@bc@winston.sde'
if gdb != 'bcwa':
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = 'Database Connections\\sde@' + gdb + '@winston.sde'
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.env.workspace = 'Database Connections\\sde@' + gdb + '@WA-IO-TIMMY.sde'

# set a variable for the workspace
workspace = arcpy.env.workspace
#admin_workspace = 'Database Connections\\sde@bc@winston.sde'

# set up logfile parameters
stateTableList = arcpy.ListTables("*statecount*")
lineageTableList = arcpy.ListTables("*StateLineage*")
logfilePath = 'C:\\Users\\kraemerj\\AppData\\Roaming\\ESRI\\Desktop10.1\\ArcToolbox\\My Toolboxes\\'
logfile = logfilePath + gdb + '_compress_history.csv'
if os.path.isfile(logfile):
&amp;nbsp;&amp;nbsp;&amp;nbsp; writeHeader = False
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; writeHeader = True

#if not debugOn:
with open(logfile,'a') as f:
&amp;nbsp;&amp;nbsp;&amp;nbsp; if writeHeader:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #Insert column headings
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write("DateTime,Status,StateCount,LineageCount\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp; stateTableList = arcpy.ListTables("*statecount*")
&amp;nbsp;&amp;nbsp;&amp;nbsp; dateTime = time.strftime("%d %b %Y %H:%M:%S", localtime())
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Insert the date and time, and the compress status
&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(dateTime + ",pre,")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for table in stateTableList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tabcur = arcpy.SearchCursor(workspace + os.sep + table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for t_row in tabcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cntStates = t_row.getValue("StateCount")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(cntStates) + ",")
&amp;nbsp;&amp;nbsp;&amp;nbsp; lineageTableList = arcpy.ListTables("*StateLineage*")

&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(lineageTableList) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for table in lineageTableList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tabcur = arcpy.SearchCursor(workspace + os.sep + table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for t_row in tabcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cntLineages = t_row.getValue("LineageCount")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(cntLineages) + "\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del table
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(0) + "\n") # this doesn't get written for whatever reason

#block new connections to the database.
arcpy.AcceptConnections(workspace, False)
print 'Connections to ' + gdb + ' are now being blocked.'

if not debugOn:
&amp;nbsp;&amp;nbsp;&amp;nbsp; #disconnect all users from the database.
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.DisconnectUser(workspace, "ALL")
&amp;nbsp;&amp;nbsp;&amp;nbsp; print 'Users have been disconnected.'

now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "Finding versions and reconciling them..."

# Process: Reconcile Versions
# Get a list of versions to pass into the ReconcileVersions tool. Use a list comprehension to get a list of version names and make sure sde.default is not selected
verList = arcpy.ListVersions(workspace)
#for ver in verList:
#&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Version:", ver

# 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():
#&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset)
#&amp;nbsp;&amp;nbsp;&amp;nbsp; 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_OBJECT","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")
arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",verList,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")

now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "Reconcile complete for all",len(verList), "versions. Now synchronizing replicas..."
replicaName = "GIS_ADMIN.BndFCs1way"
now = datetime.datetime.now()
print "Synchronizing 1-way replica " + replicaName + "..."
SynchronizeReplica.SyncReplica(replicaName)

replicaName = "GIS_ADMIN.BCmaintained2way"
now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "1-way synchronization complete. Synchronizing 2-way replica " + replicaName + "..."
SynchronizeReplica.SyncReplica(replicaName)
now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "2-way synchronization complete. Now analyzing..."

# RebuildIndexes was here pre-UC

# Process: Analyze gdb
arcpy.AnalyzeDatasets_management(workspace, "SYSTEM", dataList, "ANALYZE_BASE", "ANALYZE_DELTA", "ANALYZE_ARCHIVE")
print "Analysis complete."

# Process: Compress bc
# Run the compress tool.
if not debugOn:
&amp;nbsp;&amp;nbsp;&amp;nbsp; now = datetime.datetime.now()
&amp;nbsp;&amp;nbsp;&amp;nbsp; print now.strftime("%Y-%m-%d %H:%M:%S"), "Compressing..."
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Compress_management(workspace)

&amp;nbsp;&amp;nbsp;&amp;nbsp; now = datetime.datetime.now()
&amp;nbsp;&amp;nbsp;&amp;nbsp; print now.strftime("%Y-%m-%d %H:%M:%S"), "Compression complete."
# Update the logfile post-compress
with open(logfile,'a') as f:
&amp;nbsp;&amp;nbsp;&amp;nbsp; dateTime = time.strftime("%d %b %Y %H:%M:%S", localtime())
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Insert the datetime and the compress status
&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(dateTime + ",post,")
&amp;nbsp;&amp;nbsp;&amp;nbsp; for table in stateTableList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tabcur = arcpy.SearchCursor(workspace + os.sep + table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for t_row in tabcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cntStates = t_row.getValue("StateCount")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(cntStates) + ",")
&amp;nbsp;&amp;nbsp;&amp;nbsp; if len(lineageTableList) &amp;gt; 0:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for table in lineageTableList:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tabcur = arcpy.SearchCursor(workspace + os.sep + table)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for t_row in tabcur:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cntLineages = t_row.getValue("LineageCount")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(cntLineages) + "\n")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; del table
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; f.write(str(0) + "\n") #this doesn't get written for whatever reason

# pass in the list of datasets to the rebuild indexes and analyze datasets tools
# Note: to use the "SYSTEM" option the user must be an administrator.
print now.strftime("%Y-%m-%d %H:%M:%S"), "Re-indexing..."
arcpy.RebuildIndexes_management(workspace, "SYSTEM", "", "ALL")
print now.strftime("%Y-%m-%d %H:%M:%S"), "Indexes rebuilt."

#Allow the database to begin accepting connections again
if gdb != 'bcwa':
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AcceptConnections('Database Connections\\sde@' + gdb + '@winston.sde', True)
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AcceptConnections('Database Connections\\sde@' + gdb + '@WA-IO-TIMMY.sde', True)
#now = datetime.datetime.now()
print 'Connections to ' + gdb + ' are being accepted once again.'

# Process: Re-analyze bc
now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "Re-analyzing..."
arcpy.AnalyzeDatasets_management(workspace, "SYSTEM", dataList, "ANALYZE_BASE", "ANALYZE_DELTA", "ANALYZE_ARCHIVE")

now = datetime.datetime.now()
print now.strftime("%Y-%m-%d %H:%M:%S"), "Maintenance complete!"
elapsedTime = now - startTime
seconds = elapsedTime.seconds
minutes, seconds = divmod(seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)
if minutes == 1:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Elapsed time:", "%d hours, %d minute, %d seconds" % (hours, minutes, seconds)
else:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Elapsed time:", "%d hours, %d minutes, %d seconds" % (hours, minutes, seconds)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341513#M26778</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2021-12-11T16:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341514#M26779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you ran the script once and it failed, and then commented out the code and re-ran the script, the 'dataList' variable was probably still defined since you did not close the script. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;'dataList' will need to be defined in order to analyze the datasets and feature classes since you are calling this variable:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;arcpy.AnalyzeDatasets_management(workspace, "SYSTEM", dataList, "ANALYZE_BASE", "ANALYZE_DELTA", "ANALYZE_ARCHIVE")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Uncomment the lines defining this variable and re-run the script and see if you receive a new error message.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 13:16:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341514#M26779</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-01-03T13:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341515#M26780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;&lt;BR /&gt;Uncomment the lines defining this variable and re-run the script and see if you receive a new error message.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Doing so returns me to the floating point error I had reported originally (here with some more detail):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception class: EInvalidOp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception message: Invalid floating point operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exception address: 000007FED87FD6A3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PyScripter version : 2.5.3.0 x64&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python DLL : python27.dll&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python Engine : peInternal&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;------------------------------------------------------------------------------&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wonder if it might be a 64 bit or 10.2-related issue? Everything ran well before upgrading to 10.2. I do need to get this working again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 13:28:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341515#M26780</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2014-01-03T13:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341516#M26781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does it report what line it is failing at?&amp;nbsp; If not, can you use PyScripter to debug the code and find out?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 13:31:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341516#M26781</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2014-01-03T13:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341517#M26782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;PyScripter does not report the line where the error occurs. The script right now prints each feature class being added to dataList, and after printing the last few lines: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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']&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding: []&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;it then immediately reports the floating point error. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I next ran the code in PyScripter Debug mode, and found it raised a more useful error message: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'ERROR 000622: Failed to execute (Reconcile Versions). Parameters are not valid. \nERROR 000800: The value is not a member of ABORT_CONFLICTS | NO_ABORT.\n'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know if this points to two separate problems, or if it's just indicating there's an invalid parameter and then explaining which one it is. It appears to correspond to the call to arcpy.ReconcileVersions_management(), specifically the line&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;retval = convertArcObjectToPythonObject(gp.ReconcileVersions_management(*gp_fixargs((input_database, reconcile_mode, target_version, edit_versions, acquire_locks, abort_if_conflicts, conflict_definition, conflict_resolution, with_post, with_delete, out_log), True)))&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and the values for these parameter variables are:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;input_database: unicode u'Database Connections\\sde@bc@winston.sde'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;reconcile mode: str 'ALL_VERSIONS'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;target_version: str 'SDE.Default'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;edit_versions: list of 15, with item 0 being u'sde.DEFAULT' (item 11 has an ampersand in its version name, and was new when trouble started...)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;acquire_locks: str 'NO_LOCK_ACQUIRED'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;abort_if_conflicts: str 'NO_ABORT'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;conflict_definition: str 'BY_ATTRIBUTE'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;conflict_resolution: str 'FAVOR_TARGET_VERSION'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with_post: str 'NO_POST'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;with_delete: str 'KEEP_VERSION'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out_log: NoneType None&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;All parameters appear to be valid, so might it be related to the item 11 version name "Peirson &amp;amp; Buckby rd extension"? Before I rename it to troubleshoot I'd like to know. If so, it seems weird the error would point to "The value is not a member of ABORT_CONFLICTS | NO_ABORT" when the variable's content clearly is one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 14:30:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341517#M26782</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2014-01-03T14:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341518#M26783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Iterate through each version to see if it will fail on a specific one.&amp;nbsp; You can add the following code to do this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for version in verList:
&amp;nbsp; print version
&amp;nbsp; arcpy.ReconcileVersions_management(workspace,"ALL_VERSIONS","SDE.Default",&lt;STRONG&gt;version&lt;/STRONG&gt;,"NO_LOCK_ACQUIRED","NO_ABORT","BY_ATTRIBUTE","FAVOR_TARGET_VERSION","NO_POST","KEEP_VERSION")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:07:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341518#M26783</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T16:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341519#M26784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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 &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for dataset in arcpy.ListDatasets():&lt;/PRE&gt;&lt;SPAN&gt; section. I even input some lines to skip the mosaic datasets, but it never reached them, i.e.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for dataset in arcpy.ListDatasets():
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Adding:", arcpy.ListFeatureClasses(feature_dataset=dataset)
&amp;nbsp;&amp;nbsp;&amp;nbsp; if dataset == "u'bc.GIS_ADMIN.SWOOP2010'" or dataset == "u'bc.GIS_ADMIN.SWOOP2006'":
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "skipping SWOOP2010 and SWOOP2006"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dataList += arcpy.ListFeatureClasses(feature_dataset=dataset)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:07:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341519#M26784</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2021-12-11T16:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: ListFeatureClasses() or ListDatasets() fails since 10.2 upgrade</title>
      <link>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341520#M26785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Justin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jan 2014 17:41:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/listfeatureclasses-or-listdatasets-fails-since-10/m-p/341520#M26785</guid>
      <dc:creator>deleted-user-zpcJw1u0IXiO</dc:creator>
      <dc:date>2014-01-03T17:41:45Z</dc:date>
    </item>
  </channel>
</rss>

