Select to view content in your preferred language

ModelBuilder web tool fails

1670
4
Jump to solution
06-05-2019 06:14 AM
by Anonymous User
Not applicable

I'm starting to learn how to publish web tools from Pro to our portal and have made a simple ModelBuilder tool.

Tool works just like it should in Pro. However, after I publish it to our portal it always fails and I get the following error;

Not very descriptive and after searching for about half a day on Google it seems no one has the answer to this.

I'm running Pro 2.3.3 publishing to Portal for ArcGIS 10.6.1

0 Kudos
1 Solution

Accepted Solutions
ShingLin
Esri Contributor

This is a bug for the tool SelectLayerByLocation published as a web tool from ArcGIS Pro 2.3 to Enterprise 10.6.1. You have two workarounds:

1. For SelectLayerByLocation, don't use the tool directly, make a script tool with the following code (You have to include copyfeatures):

  

      import arcpy

      import os

 

      layer1= arcpy.GetParameterAsText(0)

      layer2= arcpy.GetParameterAsText(1)

      outfc= arcpy.GetParameterAsText(2)

 

      arcpy.management.SelectLayerByLocation(layer1, "INTERSECT", layer2, "", "NEW_SELECTION")

      arcpy.CopyFeatures_management(layer1, outfc)

2. Update ArcGIS Pro and Enterprise to 2.4 and 10.7 respectively, then run your model.

View solution in original post

4 Replies
SMW_GIS
Occasional Contributor

I'm running into the same issue. Very simple model with one parameter.  The model simply runs the select by attribute tool and calculates a field. That process is repeated 5 times with different sql selections.  Did you ever get help with this?

0 Kudos
by Anonymous User
Not applicable

Nope, not a peep.

0 Kudos
Katie_Clark
MVP Regular Contributor

Hi - I'm sorry you haven't heard anything here on Geonet, I know it can be hit or miss. I'm not super knowledgeable about this workflow but I can link to a few web pages that discuss this (you likely already ran into these, but can't hurt to share anyway) 

https://community.esri.com/thread/177000

https://gis.stackexchange.com/questions/170239/how-to-solve-error-000816-the-tool-is-not-valid-with-...

https://tutel.me/c/gis/questions/247989/esrijobmessagetypeerror+error+000816+the+tool+is+not+valid

More importantly, have you tried contacting Esri support about this? They can likely be of much more help if you aren't finding an answer on Geonet.

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
ShingLin
Esri Contributor

This is a bug for the tool SelectLayerByLocation published as a web tool from ArcGIS Pro 2.3 to Enterprise 10.6.1. You have two workarounds:

1. For SelectLayerByLocation, don't use the tool directly, make a script tool with the following code (You have to include copyfeatures):

  

      import arcpy

      import os

 

      layer1= arcpy.GetParameterAsText(0)

      layer2= arcpy.GetParameterAsText(1)

      outfc= arcpy.GetParameterAsText(2)

 

      arcpy.management.SelectLayerByLocation(layer1, "INTERSECT", layer2, "", "NEW_SELECTION")

      arcpy.CopyFeatures_management(layer1, outfc)

2. Update ArcGIS Pro and Enterprise to 2.4 and 10.7 respectively, then run your model.