Select to view content in your preferred language

Batch Trace Script: ExecuteError: 'in-table' is not table or a featureclass

1734
20
06-28-2025 06:30 AM
MichaelParma
Regular Contributor

Greetings,

I'm trying to run a batch trace via script in an attempt to speed up processing time on nearly 50,000 records outside of a map, writing summary statistics back to a text field. This is in a FGDB UN with attribute rules disabled. The trace configuration works fine individually and when executed from the Batch Trace dialogue. It fails when this is run from a Python Notebook.

My code:

arcpy.ImportToolbox(r"C:\Path\To\My\UtilityDataManagementSupport_33.atbx", "udms")
arcpy.udms.BatchTrace(
in_utility_network=r"C:\Path\To\My.gdb\Water\UtilityNetwork",
trace_locations=r"C:\Path\To\My.gdb\Water\WaterLine",
result_types="CALCULATE",
trace_config="Trace Config:: Isolating Features",
expression="ASSETGROUP = 1 and AssetType IN (0, 1, 2) and OBJECTID < 6", #OBJECTID is only for testing purposes
output_folder=None,
key_field="GLOBALID",
summary_store_field="analyticnotes",
fields=None,
calc_on_start="UPDATE_START_ROWS",
history_field=None,
default_terminal_id=None,
code_block=""
)

Executing this results in: 

ExecuteError: 'in_table' is not a table or a featureclass

In the traceback, I find this line which leads me to believe it might be related to the summary_store_field, though this field exists in the WaterLine feature class.

File "C:\Path\To\My\UtilityDataManagementSupport_33.atbx\udms\logic\un_trace.py", line 1291, in update_starting_points_with_summaries
    logger.exception(e, stack_info=True)

Any thoughts are appreciated!

0 Kudos
20 Replies
RobertKrisher
Esri Regular Contributor
0 Kudos
JohnGoat
Regular Contributor

Yes @MikeMillerGIS pls help me 🙂

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Are you running this in Pro or outside of pro?  You are listing the describe name of the UN Layer "

 in_utility_network="L8Network_Utility_Network Utility Network",

 

Can you change that to the full url path?

 

How did you get that name in the tool?

0 Kudos
JohnGoat
Regular Contributor

Yes, I am running this tool from within ArcGIS Pro. If the Utility Network layer is present in the active map, it appears in the dropdown with its name.

When I try using the full URL path as suggested, I still get the same error.

@MikeMillerGIS 

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

If you run the same Batch Trace via the GP tool and not the notebook, same error?  I have a lot of debug statements around this code area.  Can you turn on debug logging and run it through GP(not a notebook) and share the results?

 

To enable debug logging

- First open the toolbox and open any tool.  Fill it out and run it.  You can immediately cancel it.  This loads the embedded python module in memory

- Open the Python window in ArcGIS Pro(not a notebook)

- Enter the following

import udms
udms.logger.setLevel('DEBUG')

 

MikeMillerGIS_0-1775733825275.png

 

0 Kudos
JohnGoat
Regular Contributor

Yes, I get the same error when running it with notebooks and the GP tool as well.

 

Start Time: Thursday
ArcGIS Pro 3.6.1.59527
udms 3.5
Executing from ArcGIS Pro, 1 map(s), activeMap = True
****PARAMETERS****
	Input Utility Network: https://unw-server.com/server/rest/services/EA_Test/FeatureServer/8
	Trace Locations: Electric Device
	Result Types: ['CALCULATE']
	Trace Configuration Name or Field: Trace Config:: Adresses
	Expression: None
	Output Folder: None
	Group Field: None
	Store Summary Information on Starting Points: None
	Fields to update: [['Test', 'Electric Device', 'UNTest', 'FIRST']]
	Calculate on Starting Point Features: False
	JSON Result file folder: None
	Aggregated GDB: None
	Historical Date Field: None
	Stat Table: None
	Default Terminal ID: 6
	Code Block: None
****ENVIRONMENTS****

udms.logic.batch_trace(
    utility_network=<arcpy._mp.Layer object at 0x0000021628AC77A0>,
    trace_locations=<arcpy._mp.Layer object at 0x0000021628B07750>,
    result_types=['CALCULATE'],
    output_folder=None,
    summary_store_field=None,
    field_mapping=[['Test', 'Electric Device', 'UNTest', 'FIRST']],
    key_field=None,
    expression=None,
    trace_config='Trace Config:: Adresses',
    calc_on_start=False,
    history_field=None,
    default_terminal_id=6,
    user_code=None,
)
In Path: https://unw-server.com/server/rest/services/EA_Test/FeatureServer/8
URL: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
workspace: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
Path: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
UN Loaded
Collecting Trace Configs
Validating the inputs
Trace Config:: Adresses
Setting up parameters
Opening Data Element
Verifying calc fields
Verifying Lookup Fields and Target Tables
Source ID: 9
udms.logic.batch_trace	73.46496698597912

 

@MikeMillerGIS  

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

That is only the first 52 lines, can I get all the messages?

0 Kudos
JohnGoat
Regular Contributor

 

I didn't add it because the error message is the same; all the error messages are like this, Mike.

Start Time: Thursday
ArcGIS Pro 3.6.1.59527
udms 3.5
Executing from ArcGIS Pro, 1 map(s), activeMap = True
****PARAMETERS****
	Input Utility Network: https://unw-server.com/server/rest/services/EA_Test/FeatureServer/8
	Trace Locations: Electric Device
	Result Types: ['CALCULATE']
	Trace Configuration Name or Field: Trace Config:: Adresses
	Expression: None
	Output Folder: None
	Group Field: None
	Store Summary Information on Starting Points: None
	Fields to update: [['Test', 'Electric Device', 'UNTest', 'FIRST']]
	Calculate on Starting Point Features: False
	JSON Result file folder: None
	Aggregated GDB: None
	Historical Date Field: None
	Stat Table: None
	Default Terminal ID: 6
	Code Block: None
****ENVIRONMENTS****

udms.logic.batch_trace(
    utility_network=<arcpy._mp.Layer object at 0x0000021628AC77A0>,
    trace_locations=<arcpy._mp.Layer object at 0x0000021628B07750>,
    result_types=['CALCULATE'],
    output_folder=None,
    summary_store_field=None,
    field_mapping=[['Test', 'Electric Device', 'UNTest', 'FIRST']],
    key_field=None,
    expression=None,
    trace_config='Trace Config:: Adresses',
    calc_on_start=False,
    history_field=None,
    default_terminal_id=6,
    user_code=None,
)
In Path: https://unw-server.com/server/rest/services/EA_Test/FeatureServer/8
URL: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
workspace: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
Path: https://unw-server.com/server/rest/services/EA_Test/FeatureServer
UN Loaded
Collecting Trace Configs
Validating the inputs
Trace Config:: Adresses
Setting up parameters
Opening Data Element
Verifying calc fields
Verifying Lookup Fields and Target Tables
Source ID: 9
udms.logic.batch_trace	73.46496698597912
Traceback (most recent call last):
  File "D:\...\UtilityDataManagementSupport_3_5.atbx\BatchTrace.tool\tool.script.execute.py", line 23, in <module>
  File "D:\...\UtilityDataManagementSupport_3_5.atbx\udms\esri.py", line 557, in wrapper
    f = func(*args, **kwargs)
  File "D:\...\UtilityDataManagementSupport_3_5.atbx\udms\logic\__init__.py", line 232, in batch_trace
    return ts.main(
           ~~~~~~~^
        where_clause=expression,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    ...<3 lines>...
        history_field=history_field,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "D:\...\UtilityDataManagementSupport_3_5.atbx\udms\logic\un_trace.py", line 727, in main
    layer = self.un.create_table(source_id=source_id)
  File "D:\...\UtilityDataManagementSupport_3_5.atbx\udms\un_helper.py", line 954, in create_table
    result = arcpy.MakeTableView_management(in_table=path, out_view=out_layer, where_clause=where_clause)[0]
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 16735, in MakeTableView
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\management.py", line 16731, in MakeTableView
    gp.MakeTableView_management(*gp_fixargs((in_table, out_view, where_clause, workspace, field_info), True))
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 533, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
                         ~~~^^^^^^^^^^^^^^^^^^^^^^^^^
arcgisscripting.ExecuteError: ERROR 000358: Invalid expression
Failed to execute (MakeTableView).


Failed script Batch Trace...
Failed to execute (BatchTrace).
Failed at Thursday, April 9, 2026 5:00:10 PM (Elapsed Time: 1 minutes 30 seconds)

 

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Can you try with 3.5.1 version of the tools.  I am expecting to see more info in the debug log.  There should be a message above the error with info that can help track down what is going on.  Your issue is different than the original post.  This is failing to create a table view on the UN class.

https://github.com/Esri/Utility-Data-Management-Support-Tools/releases/download/3_30_2026_3_5_1/Util...

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

actually hold off, let me add a few more debug statements, the lower level function does not have any

0 Kudos