<?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: Trace (Utility Network) error in custom GP Enterprise in ArcGIS Utility Network Questions</title>
    <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1666091#M5992</link>
    <description>&lt;P&gt;Makes sense. Two more questions (I'm trying to reproduce your scenario on my environment):&lt;BR /&gt;&lt;BR /&gt;1 - Assuming your UN service is secured, are you setting the active portal and signing in before executing the Trace?&lt;BR /&gt;2 - What's the content of the temp_starting variable?&lt;/P&gt;</description>
    <pubDate>Sat, 15 Nov 2025 01:19:39 GMT</pubDate>
    <dc:creator>robertopepato_bizpoke</dc:creator>
    <dc:date>2025-11-15T01:19:39Z</dc:date>
    <item>
      <title>Trace (Utility Network) error in custom GP Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665091#M5969</link>
      <description>&lt;P&gt;I'm customizing a geoprocessing tool that runs an arcpy.un.Trace.&lt;/P&gt;&lt;P&gt;I can successfully run the GP tool in ArcGIS Pro, but when I publish it to ArcGIS Enterprise, I receive the following message:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"Parameters are not valid. ERROR 000840: The value is not a String. Failed to execute (Trace)."&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;g_ESRI_variable_4 = 'https://myportal/server/rest/services/Water/Water/FeatureServer/8'        

arcpy.un.Trace(
        in_utility_network=g_ESRI_variable_4,
        trace_type="ISOLATION",
        starting_points=temp_starting,
        domain_network="Water",
        tier="Distribuição",
        out_json_file=trace_json
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does someone once made an GP tool that runs a Trace and worked?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 13:46:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665091#M5969</guid>
      <dc:creator>CeciliaAtos</dc:creator>
      <dc:date>2025-11-12T13:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trace (Utility Network) error in custom GP Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665689#M5977</link>
      <description>&lt;P&gt;I'm not confident that using a service URL directly in the in_utility_network works for this call. Have you tried to use the&amp;nbsp;arcpy.management.MakeFeatureLayer to create a temporary layer object from the URL, and then pass it to the in_utility_network parameter?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 22:09:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665689#M5977</guid>
      <dc:creator>robertopepato_bizpoke</dc:creator>
      <dc:date>2025-11-13T22:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trace (Utility Network) error in custom GP Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665892#M5986</link>
      <description>&lt;P&gt;I cannot create a temporary layer using a specific sublayer such as “FeatureServer/8” (my network layer).&lt;/P&gt;&lt;P&gt;Temporary layers created from individual sublayers cannot be used as in_utility_network, since they are not recognized as a Utility Network.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Nov 2025 16:20:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1665892#M5986</guid>
      <dc:creator>CeciliaAtos</dc:creator>
      <dc:date>2025-11-14T16:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trace (Utility Network) error in custom GP Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1666091#M5992</link>
      <description>&lt;P&gt;Makes sense. Two more questions (I'm trying to reproduce your scenario on my environment):&lt;BR /&gt;&lt;BR /&gt;1 - Assuming your UN service is secured, are you setting the active portal and signing in before executing the Trace?&lt;BR /&gt;2 - What's the content of the temp_starting variable?&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2025 01:19:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1666091#M5992</guid>
      <dc:creator>robertopepato_bizpoke</dc:creator>
      <dc:date>2025-11-15T01:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Trace (Utility Network) error in custom GP Enterprise</title>
      <link>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1666106#M5994</link>
      <description>&lt;P&gt;Thank you very much, Roberto.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 - Assuming your UN service is secured, are you setting the active portal and signing in before executing the Trace?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A:&lt;/STRONG&gt; That’s a good question. I'm currently not signing in because all the services are in registered datastores, so I thought I didn’t need to log in within my GP tool. However, I will set the login and test it again.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;2 - What's the content of the temp_starting variable?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A:&lt;/STRONG&gt; I’ll paste below the relevant part of my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#start by creating my startingpoint in scratch
temp_starting = arcpy.management.CreateFeatureclass(
            out_path=scratch_gdb,
            out_name="UN_TEMP_STARTING_POINT",
            geometry_type="POINT",
            spatial_reference=arcpy.SpatialReference(31983), 
            has_z="DISABLED",
            has_m="DISABLED"
            ).getOutput(0) 

        fields = [
            ("LAYERNAME", "TEXT", 255, None, None, None),
            ("FEATUREGLOBALID", "GUID", None, None, None, None),
            ("TERMINALID", "LONG", None, 10, 0, None),
            ("PERCENTALONG", "DOUBLE", None, 38, 8, None),
        ]


        for name, ftype, length, precision, scale, domain in fields:
            arcpy.management.AddField(
                in_table=temp_starting,
                field_name=name,
                field_type=ftype,
                field_precision=precision if precision else None,
                field_scale=scale if scale else None,
                field_length=length if length else None,
                field_alias=name,
                field_is_nullable="NULLABLE",
                field_is_required="NON_REQUIRED",
                field_domain=domain if domain else ""
            )


        # search global id parameter (the user must input)


        where_clause = f"GLOBALID = '{globalid}'"
        layer_name = "pipe_selection"

        arcpy.env.preserveGlobalIds = True
        filtro_inicial = arcpy.management.MakeFeatureLayer(pipe_input, layer_name, where_clause)
        arcpy.AddMessage(f"Feições copiadas para: {filtro_inicial}")

        
        with arcpy.da.SearchCursor(filtro_inicial, ["GLOBALID", "SHAPE@"]) as s_cursor, \
            arcpy.da.InsertCursor(temp_starting,
                                ["SHAPE@", "LAYERNAME", "FEATUREGLOBALID", "TERMINALID", "PERCENTALONG"]) as i_cursor:

            for globalid, shape in s_cursor:
                centroid = shape.positionAlongLine(0.5, use_percentage=True)
                percent_along = 0.5
                i_cursor.insertRow((centroid, "Tubulação", globalid, "-1", percent_along))

        arcpy.AddMessage(f"Trace location criada: {temp_starting}")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, when the user enters the pipe’s GlobalID, this part of the code automatically calculates all the &lt;EM&gt;starting_point&lt;/EM&gt; parameters. Then I use this &lt;EM&gt;temp_starting&lt;/EM&gt; feature class as the &lt;EM&gt;starting_point&lt;/EM&gt; input in the Trace tool.&lt;/P&gt;&lt;P&gt;I’m no longer receiving any errors related to this parameter (I was struggling with that before, haha).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Nov 2025 13:21:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-utility-network-questions/trace-utility-network-error-in-custom-gp/m-p/1666106#M5994</guid>
      <dc:creator>CeciliaAtos</dc:creator>
      <dc:date>2025-11-15T13:21:36Z</dc:date>
    </item>
  </channel>
</rss>

