1

I have a script that was previously working but just started throwing an error out of the blue. Here is the traceback:

Traceback (most recent call last):

  File "<ipython-input-68-be384b1c4968>", line 4, in <module>
    nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]

  File "<ipython-input-68-be384b1c4968>", line 4, in <listcomp>
    nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]

RuntimeError: General function failure

I have checked the code at every step and the paths and workspace all seem valid. Is there anything obvious that might be causing my code to throw this error? Everything works correctly up to the line where I run SearchCursor:

import arcpy, sys, os
path = "T:/CCSI/TECH/FEMA/Datasets/NFHL/NFHL_06122018"
masterdict = {'13': ['13245'], '06': ['06007'] }

for k, v in masterdict.items():
    stateFips = k #1st iteration is '13'
    fipsList = v # first iteration is ['13245']

    for root, dirs, filename in os.walk(path):
        for dir in dirs:
            if('NFHL_' + stateFips in dir and '.gdb' in dir):
                temp_path = os.path.join(root, dir)
                arcpy.env.workspace = temp_path

                featureclasses = arcpy.ListFeatureClasses()
                for fc in featureclasses:
                    if fc == 'S_FIRM_Pan':
                        S_FIRM_Pan = fc
                        arcpy.env.workspace = S_FIRM_Pan
                        field_names = [f.name for f in arcpy.ListFields(S_FIRM_Pan)]
                        for fip in fipsList:
                            fipC = fip + 'C'
                            firm_field = "DFIRM_ID"
                            nfhl_selectorz = [row[0] for row in arcpy.da.SearchCursor(S_FIRM_Pan, firm_field)]

1 Answer 1

2

Your code is probably correct.

This is most likely the result of a database disconnect or a change in your database administration. Our IT dept. upgraded our systems recently and none of our scripts would work. We were getting the general function failure error for all of the scripts that accessed our databases. They identified and fixed an issue with the database connection and we stopped getting the general function failure error.

We were using ArcGIS through citrix.

1
  • Yep. That seems to have been the issue. I gdb's were in a network drive. I shut down ArcMap and my entire computer, reboot and ran it again. Worked fine. Thanks for the heads up.
    – gwydion93
    Commented Sep 28, 2018 at 0:36

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.