Can publish GP Service, but cannot run it - 000816 'Tool is not valid'

5527
14
11-01-2013 02:55 PM
TamiOnstad
New Contributor III
[ATTACH=CONFIG]28808[/ATTACH]

I am unable to get any published GP Service to run if it was created with a model or script that I created from scratch.

I AM able to publish the Clip and Ship models/scripts provided with the 10.2 Tutorial data, and these run successfully as GP Services.

I have pared down to the most basic model I can devise, which basically runs GetCount_management on one of my SDE feature classes (the database is registered with ArcGIS Server 10.2).  I can run this either with the SDE fc as a parameter of the model, or with no parameters and the fc basically hard-coded.  I have also tried making a feature layer out of the fc and getting the count on that.  Either way it bombs with the 000816 error 'Tool is not valid'. 

I'm thinking I must be missing some basic first step in creating these models, something I am required to do if I want to use them as GP tools?  I can't see anything obvious as far as the way the Clip and Ship models/scripts are set up vs my own models.  Is there some registry step I need to take, some licensing I need to validate?  I'm using ArcInfo on both local machine and server machine. 

Any thoughts?  Image of model is above, you can see how simple it is.  What am I missing?

Tami
0 Kudos
14 Replies
KevinHibma
Esri Regular Contributor
Tool is invalid for a model tool mean it's probably broken.

With ArcMap, if you navigate to this directory on Server:
C:\arcgisserver\directories\arcgissystem\arcgisinput\{service name}.GPServer\extracted\v101\{folder name}
And open the toolbox, and the model - can you run it?
I'm assuming the answer is no, can you edit it? Can you see anything that might be wrong with it? (paths wrong, something inside model is broken, etc)
0 Kudos
SergioFernandez1
New Contributor II

Hi Kevin,

I'm also getting the 000816 error when running my published service.  But when I try your suggestion (running it from C:\arcgisserver\directories\arcgissystem\arcgisinput\{service name}.GPServer\extracted\v101\{folder name}) I'm getting the following error: 

The value does not exist.
ERROR 000732: Template Feature Class: Dataset ServiceName\LayerA does not exist or is not supported.

That occurs in the Create Feature Class function in my model. 

I dragged a layer from a mxd to be assigned to the template feature class parameter of this function in the model. Its data source uses a database connection that is registered in the server.

In the C:\arcgisserver\directories\arcgissystem\arcgisinput\{service name}.GPServer\extracted\v101\{folder name} folder I see that the connection file (.sde) is copied so I don't know why it can't found the Layer.  Also in the original model, since the MXD is opened when I run it, the reference to the layer is only "LayerA", but in the tool in the published folder the reference changes to "ServiceName\LayerA". 

Do you have an idea of what could be happening?

Regards 

0 Kudos
KevinHibma
Esri Regular Contributor

Sergio,

Based on the error - I'm going to guess you're using the tool in that directory, not the result. The only way you could test run this would be from that directory to drag the RLT into the results window -- this should also add data the the map, then you'd be able to run the tool inside the toolbox, or the result inside the Shared node of the result window. (You need to do this when you've used layers). The ServiceName\LayerA that the GP services expects is correct; the service internally changes this and knows where the data is. As I said, if you add the RLT to your session, you should see a GroupLayer\Layer Name in this way get added. If that layer is broken, you're on your way to identifying your issue. However I suspect this layer will connect fine.

Without knowing much more about your situation, I'd go back and evaluate if you actually need the CreateFeatureClass tool. This tool can be tricky to use in a GP Service as it takes a workspace input parameter and creates derived output. Could you instead use another tool to achieve your goal, maybe CopyFeatures?

SergioFernandez1
New Contributor II

Thanks Kevin for your prompt answer. Now I understand better how the published service works.  As you said, I tried dragging the RLT to the session and the tool connected fine to the layer and executed correctly.

I was trying to change the use of CreateFeatureClass to CopyFeatures, but I don't think it works, since what I want the tool to do is to receive a SHP file (that can have custom attributes) and append it to my layer so it would have only the attributes of my layer.  That's why I was using CreateFeatureClass to create an empty feature class based on my layer, then append the received SHP file, use the CalculteField tool to complete one field and then append this result to the actual layer.

When I use CopyFeatures the features from the SHP file keep their custom attributes and cannot be appended to my layer.

Do you know how can I set the workspace via parameter or other way to the CreateFeatureClass tool to work? Or another way to get the same result with the CopyFeatures or different tools?

Thanks!

0 Kudos
KevinHibma
Esri Regular Contributor

How about you just have an empty featureclass already created and have that hardcoded in your model/script as project data. The append works off this data + the data the user supplies to the service. 

You cannot supply a workspace parameter to a tool in a GP Service. This will always become hardcoded.

0 Kudos
SergioFernandez1
New Contributor II

Thanks Kevin, I'll try your suggestion.  But also I have a question about the workspace, because I was using "in_memory" as Feature Class Location for the CreateFeatureClass tool.  Is this not kind of setting "in_memory" as the workspace for the tool?

0 Kudos
TamiOnstad
New Contributor III
When I run my tool from within the folder below, the tool runs without any errors. 

\arcgissystem\arcgisinput\ExtractDataTask22.GPServer\extracted\v101


When I run it from my GIS Server connection in Catalog it still errors out and says ERROR 000816 The tool is not valid.

Thanks!

Tami
0 Kudos
KevinHibma
Esri Regular Contributor
Hmm.
One more test. Start with a new session of ArcMap

If you goto this folder: \arcgissystem\arcgisinput\ExtractDataTask22.GPServer\extracted\v101 there is a .RLT file in there.
Double click it, it'll get put into your Results Window. If you expand the shared node, there will be a tool there. Can you run that?
Additionally, because this is the extract data task, do you see layers get added to your ToC after you open the RLT file?
0 Kudos
MatthewMurray1
New Contributor III
I am experiencing the exact same behavior and have tried all the above tests which all ran with success.

However I cannot get past this error when running the tool from the server.
0 Kudos