Select to view content in your preferred language

ExportSubnetwork error : A subnetwork controller cannot be purged before disabled

343
8
Jump to solution
a week ago
PierreloupDucroix
Frequent Contributor

Hello,

I'm getting this error when trying to export a subnetwork from the ArcGIS API for Python.

A subnetwork controller cannot be purged before disabled.

It only occurs for one specific subnetwork that behaves normally in ArcGIS Pro (not dirty, can be modified and validated...)

Exporting this subnetwork is working as expected when done in ArcGIS Pro with the toolbox, with arcpy.un.ExportSubnetwork and even in the REST API.

Any idea ?

CEO of MAGIS
0 Kudos
1 Solution

Accepted Solutions
RobertKrisher
Esri Regular Contributor

If you haven't already, please log an issue for this. I've been unable to reproduce it on my end, but I suspect I know what is causing it and it may be a bug. What's happening is the utility network is seeing the active controller before the deleted controller and it thinks something has gone wrong. The only way I could do this was through some creative versioned editing.

RobertKrisher_0-1748574775072.png

 

The only workaround I can think of is to delete and purge the currently active subnetwork controller then recreating it.

View solution in original post

0 Kudos
8 Replies
RobertKrisher
Esri Regular Contributor

Can you include a snippet of your export from the ArcGIS API for Python, along with a screenshot of the same export using a GP tool.

 

Bonus point if you can include a screenshot of the corresponding rows from the subnetworks table that show the values of the Subnetwork Name, Status (ISDIRTY), and "Is deleted" columns for the subnetwork in question.

RobertKrisher_0-1748444358061.png

 

PierreloupDucroix
Frequent Contributor

So, after several tests, it appears that the error only occurs when the export_acknowledged parameter is True. I have been able to reproduce with arcpy and GPTool :

arcpy.un.ExportSubnetwork(
    in_utility_network="EEC Utility Network",
    domain_network="Electric",
    tier="Réseau HTA",
    subnetwork_name="GDN-837-07",
    export_acknowledged="ACKNOWLEDGE",
    out_json_file=r"C:\Temp\GDN-837-07.json",
    condition_barriers=None,
    function_barriers=None,
    include_barriers="INCLUDE_BARRIERS",
    traversability_scope="BOTH_JUNCTIONS_AND_EDGES",
    propagators=None,
    include_geometry="INCLUDE_GEOMETRY",
    result_types="CONTAINMENT_AND_ATTACHMENT_ASSOCIATIONS;CONNECTIVITY;FEATURES",
    result_network_attributes=None,
    result_fields=None,
    include_domain_descriptions="INCLUDE_DOMAIN_DESCRIPTIONS"
)

 

Error : https://pro.arcgis.com/en/pro-app/3.3/tool-reference/tool-errors-and-warnings/160001-170000/tool-err...

 

When setting export_acknowledged="NO_ACKNOWLEDGE" it works.

Once again this is the only subnetwork over 2000 that behave like this.

Here is the bonus subnet table where you can see there have been several subnetworks with the same name and controller, but only one is now active and clean :

PierreloupDucroix_0-1748467784857.png

Will you give me two kudos for that 😆

 

CEO of MAGIS
RobertKrisher
Esri Regular Contributor

Strange question, what happens if you turn on export w/acknowledgement but don't include the geometry? I gave you one Kudo, so someone else from the community will have to give you the second 🙂

0 Kudos
PierreloupDucroix
Frequent Contributor

Same error.

Here is the simplest code sample that gives me the error :

arcpy.un.ExportSubnetwork(
    in_utility_network="EEC Utility Network",
    domain_network="Electric",
    tier="Réseau HTA",
    subnetwork_name="GDN-837-07",
    export_acknowledged="ACKNOWLEDGE",
    out_json_file=r"C:\Temp\GDN-837-07.json",
    condition_barriers=None,
    function_barriers=None,
    include_barriers="INCLUDE_BARRIERS",
    traversability_scope="BOTH_JUNCTIONS_AND_EDGES",
    propagators=None,
    include_geometry="EXCLUDE_GEOMETRY",
    result_types=None,
    result_network_attributes=None,
    result_fields=None,
    include_domain_descriptions="EXCLUDE_DOMAIN_DESCRIPTIONS"
)

 

 

CEO of MAGIS
0 Kudos
RobertKrisher
Esri Regular Contributor

If you haven't already, please log an issue for this. I've been unable to reproduce it on my end, but I suspect I know what is causing it and it may be a bug. What's happening is the utility network is seeing the active controller before the deleted controller and it thinks something has gone wrong. The only way I could do this was through some creative versioned editing.

RobertKrisher_0-1748574775072.png

 

The only workaround I can think of is to delete and purge the currently active subnetwork controller then recreating it.

0 Kudos
PierreloupDucroix
Frequent Contributor

Thanks, Robert

I just logged a case and added you as a contact.

We will try to delete the subnetwork and recreate it.

When you say "purge", what do you mean ?

My process to recreate a subnetwork is:

- remove the device's subnetwork controller state

- update the subnetwork so that it is marked as deleted

- export it with acknowledgement

- re-enable the subnetwork controller with the same subnetwork name

- finally update the new subnetwork

CEO of MAGIS
RobertKrisher
Esri Regular Contributor

Purge isn't an officially recognized word in this context, so you won't find it in any of the online help. When I use this word I'm referring to the final export subnetwork with acknowledgement that removes all references to a subnetwork from the subnetworks table.

It can be confusing to talk about deleting a subnetwork, since it must first be marked as deleted and processed before it can be truly deleted.

PierreloupDucroix
Frequent Contributor

After deleting and recreating the subnetwork, I only have one row in the subnet table, and I was able to successfully export it with acknowledgment.

PierreloupDucroix_0-1748930051407.png

The case is still open with Esri France support, hopefully you will find the root cause and solve it.

Thanks, Robert

 

CEO of MAGIS