Error importing Metadata

Skip to first unread message

John O'Donnell

Jan 31, 2023, 1:23:16 PMJan 31
to ACPF Forum
Hi all,

So I've been hitting my head against a problem that has stopped me at step one. I have prepared my DEM and am trying to run the first steps and I am getting a weird error where the tool works but it fails when trying to import metadata.

I was worried that it was an issue with naming and have moved my files to a location directly on C Drive with no spaces in the name. I uninstalled and reinstalled ArcPro from 3.0.2 to 3.0.3 and still the same error. I reprojected the DEM and uninstalled an old version if python from my computer and still no change.

I hope someone here can help explain what I'm missing! Here's the full output from running the tool with the error code highlighted in red at the end.

a.  DEM: Pit Fill / Hole Punch

Input DEM     DEM_0711000904
Output DEM     C:\ACPF\PDS_ACPF1\PDS_ACPF1.gdb\USGS_13_n40w09_P_proj_Resample
Input Maximum Fill Depth (Z-units)     .5

Start Time: Tuesday, January 31, 2023 12:02:47 PM
Hole-punching: DEM_0711000904
Find Pits...
Fill everything else...
Current maximum depth: 81.65434265136719
Punch holes...
Total holes punched: 8008677.0
Current maximum depth: 19.348129272460938
Punch holes...
Total holes punched: 8009835.0
Current maximum depth: 5.140251159667969
Punch holes...
Total holes punched: 8010544.0
Current maximum depth: 3.1234664916992188
Punch holes...
Total holes punched: 8010623.0
Current maximum depth: 0.9244232177734375
Punch holes...
Total holes punched: 8010630.0
Current maximum depth: 0.4998779296875
Saving Output...
updataing metadata...
Exception: Failed to import metadata from 's'.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\ACPF\ACPF_V4_Pro_Hub_01092023\Scripts\", line 255, in <module>
    addMetadata(outDEM, paraDict)
  File "C:\ACPF\ACPF_V4_Pro_Hub_01092023\Scripts\", line 69, in addMetadata
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\", line 191, in fn_
    return fn(*args, **kw)
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\", line 127, in importMetadata
    return _convertArcObjectToPythonObject(arcgisscripting.metadata.Metadata.importMetadata(*_gp_fixargs((self, sourceUri, metadata_import_option, customStylesheetPath), True)))
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\", line 67, in convertArcObjectToPythonObject
SystemError: <class 'type'> returned a result with an error set

Failed script a.  DEM: Pit Fill / Hole Punch...
Failed to execute (PitFillHolePnch).
Failed at Tuesday, January 31, 2023 12:05:06 PM (Elapsed Time: 2 minutes 19 seconds)

Obrecht, Joshua D [IDRO]

Feb 2, 2023, 8:53:10 AMFeb 2
to ACPF Forum



I will be reaching out to you to try and resolve this issue.



Josh Obrecht

GIS Analyst  Iowa State University

National Hub for the Agricultural Conservation Planning Framework



The ACPF Forum is an online group for discussing technical issues related to using the ACPF tools. Anyone can view the discussions at Only members can participate in discussions. Join the group by sending an email to
You received this message because you are subscribed to the Google Groups "ACPF Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

John O'Donnell

Feb 2, 2023, 10:15:11 AMFeb 2
to ACPF Forum,

Thank you for reaching out! I look forward to getting some insight on the problem.

David James

Feb 2, 2023, 10:16:01 AMFeb 2
to John O'Donnell, ACPF Forum
Hi John
It appears that the problem is due to the non-ACPF database structure that you are using. Typically, the ACPF tools expect to see the naming conventions developed to support the standard HUC12-based data structure. Yours does not. I would suggest that you edit the scripts\ and comment out the very last line (255), which makes the call to import the metadata xml for this tool. I suspect that should resolve the issue. Alternatively, you could assemble a traditional ACPF fgdb, e.g.  acpf070801040203.gdb.

DAve JAmes

Reply all
Reply to author
0 new messages