Issue with publishing tools from ArcGIS Pro to ArcGIS Server 10.9.1

774
4
Jump to solution
07-26-2022 04:58 AM
by Anonymous User
Not applicable

We recently upgraded our test-environment from ArcGIS Server 10.5.1 to 10.9.1. Since this is the migration-version where we should start to use ArcGIS Pro we planned ahead of time and renewed our custom GeoProcessing tools. Taking advantage of the new Arcpy-library available in ArcGIS Pro's Python 3.X.

Everything runs fine in Python and ArcGIS Pro. No code issues or import issues seems to pop up, but the moment we publish the tools to the new ArcGIS Server 10.9.1 we get this response every time we run the tools: "The tool is not valid".

We have encountered this before, and it had to do with import issues and third party libraries, though we alreay fixed that previously. Now we've gone through it again and it seems like everything is as it should. We even added backwards-compatibility to some of the tools so we could test them in ArcMap, and ArcMap also runs the tools seamlessly.

We also found that by publishing the tools from ArcMap they also work on the new ArcGIS Server 10.9.1, but not when published from ArcGIS Pro. We find this rather strange, and wonder if the ArcGIS Server changes python-environments depending on which plattform is used to publish the tools...

Anyway we wish to publish ALL the tools through ArcGIS Pro, especially since some of the are dependent on the new functions and revisions done for ArcGIS Pro's Arcpy-library.

Does anyone else recognize this problem? Even better, does someone know how to fix it?

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Yeah, I had someone from Geodata in Norway show me a few tricks to force ArcGIS Server to give more informative error messages, and it would prove that ArcGIS Server doesn't use the cloned environment. It only uses the default arcgispro-py3-environment located in the <install>\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs-folder.

Which makes the instructions found in this article: https://enterprise.arcgis.com/en/server/10.9.1/publish-services/windows/deploying-custom-python-pack... a little bit misleading. Because cloning the environment, basically have no effect for the server and installing the packages in the cloned environment is kind of pointless.

So the error was that I was trying to fix the wrong environment, now that I now that ArcGIS Server 10.9.1 always defaults to the standard arcgispro-py3-environment it was easier to fix. 🙂

Bottom line, you're answer was correct and the Esri instructions kind of misleading. Maybe Esri need to clarify their instructions a bit more.

View solution in original post

0 Kudos
4 Replies
DavidSolari
Occasional Contributor III

"import issues and third party libraries" piques my interest. I'm pretty sure when you have both runtimes installed on your server site you have two Python installations as well. If you installed packages and .pth files to your ArcMap Python directories you'll have to do the same process to your Pro Python directory (using the 3.x version of the packages of course). If that doesn't fix it I'd give your support rep a call, these sorts of issues are hard to solve without someone poking around your server machines.

0 Kudos
by Anonymous User
Not applicable

Yeah, I had someone from Geodata in Norway show me a few tricks to force ArcGIS Server to give more informative error messages, and it would prove that ArcGIS Server doesn't use the cloned environment. It only uses the default arcgispro-py3-environment located in the <install>\ArcGIS\Server\framework\runtime\ArcGIS\bin\Python\envs-folder.

Which makes the instructions found in this article: https://enterprise.arcgis.com/en/server/10.9.1/publish-services/windows/deploying-custom-python-pack... a little bit misleading. Because cloning the environment, basically have no effect for the server and installing the packages in the cloned environment is kind of pointless.

So the error was that I was trying to fix the wrong environment, now that I now that ArcGIS Server 10.9.1 always defaults to the standard arcgispro-py3-environment it was easier to fix. 🙂

Bottom line, you're answer was correct and the Esri instructions kind of misleading. Maybe Esri need to clarify their instructions a bit more.

0 Kudos
ElizabethLorenaRodriguez
New Contributor III

hello @Anonymous User 

 

Do you have everything installed on the same machine? (ArcGIS Pro and ArcGIS Server?

Do you have installed data interoperability for ArcGIS Pro installed on the same machine?

 

What version of ArcGIS Pro are you using?

 

 

Best regards 

Lorena

0 Kudos
by Anonymous User
Not applicable

No, ArcGIS Pro and ArcGIS Server are on two seperate machines.

We use ArcGIS Pro 2.9.2.

0 Kudos