Select to view content in your preferred language

ArcGIS Pro Runtime Error: the product license has not been initialized

27566
33
Jump to solution
02-03-2021 10:44 AM
Labels (1)
chintakandel
New Contributor III

I've issue license initialization in ArcGIS Pro 2.7. I can run python script manually via command line and batch file but encountered with following run time error with scheduled task in Windows server 2019. 

File "C:\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 14, in <module>
import arcgisscripting
File "C:\arcgis\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgisscripting\__init__.py", line 128, in <module>
from ._arcgisscripting import *
RuntimeError: The Product License has not been initialized.

Any ideas or solutions?

Thanks in advance,

Chintamani

33 Replies
Cristian_Galindo
Occasional Contributor III

I had an issue with the company Firewall rules 😞

0 Kudos
DarinaTchountcheva
Occasional Contributor II

Cristian, 

Can you provide more details on what Firewall rules?

I am having the same problem, and I suspect that the Firewall might be the issue, but not sure how to figure it out. 

 

Thank you!

0 Kudos
Cristian_Galindo
Occasional Contributor III

Hallo Darina, 

To be hones the error was solved by the IT guy that manage the corporate Firewall. I can tell you that a rule was created to allow communication with www.arcgis.com.

You can check a detailed document for your whitelist here: https://downloads.esri.com/resources/enterprisegis/AGOL_Domain_Requirements.pdf

 

0 Kudos
DarinaTchountcheva
Occasional Contributor II

Thank you, Cristian!

We whitelisted some of these a few months ago when AGOL updated and most of our python scripts stopped working. We had to add some amazon ones to the list too.

But I will ask our Network guys to add the ones we haven't. Hope that resolves the issue because I don't think logging in as the account running the process and running ArcGIS Pro is a solution for us. 

0 Kudos
LauraTateosian
New Contributor III

Yes, it wastes my time, as I have to go through this every time the machine is restarted and some other times when it just stops working for no reason that I can detect.  I hope to find a better solution.

0 Kudos
LauraTateosian
New Contributor III

Thank you to everyone who replied.  I got it working.  For the purposes of this description, I will say the user that runs the process is "batch_runner".  Here's what I did:

1) Log in to the server machine as batch_runner.  (This was a bottleneck for a while, but had nothing to do with ArcGIS) and download a single user license file executable.

2) Run the single user license file and when prompted, oog in to ArcGIS Pro as a named user with my own account credentials. 

3) Switch ArcGIS Pro to a single user license (in that log in session)

   a) Select "Configure your licensing options".

   b) Change the License Type to "Single Use License".

   c) Click Authorize and follow the steps in the Software Authorization Wizard. Click Ok.

   d) Restart ArcGIS Pro.

4) Et voila!  It worked. 🙂

I believe this created a profile under batch_runner, because after this, it could run the arcpy processes.  

I am still trying to find out what I'll need to renew the license which will expire in July.  But at least it's working for the moment.  Thank you for all the responses and helpful information!

erinheinrich
New Contributor III

I have a concurrent licence and this was the "simple" solution that worked for me, informed by everyone's responses above:

1) login to ArcPro with my MyESRI credentials, which are linked to my organisation.

2) Borrow licence, that is check "Authorize ArcGIS Pro to work offline"

Viola, simple as that, no more error... until licence expired and I then just re-borrowed 🙂

 

by Anonymous User
Not applicable

I find the following helpful:

  • Single use license
  • Use the task scheduler in Pro
  • Setup everything from installing Pro to creating a project to adding the script to the project toolbox and scheduling the task as a user who is an administrator on the machine.
  • A local admin user can work well but only if you don't need to get to network resources with your script.
  • A domain user who is part of the machine administrator group is the best. It has full rights on the machine and can interact with network resources.
  • Once your task is set to run from the script tool in your project via the Pro task scheduler, don't monkey with it in the Windows task scheduler (WTS) except:
  • You can set it to run whether or not logged in.
  • You can run with highest privileges but don't do it just to do it. Do it only if it the script won't work without it.

Overall, running scripts against Pro conda is about half as stable as  python 2.7 unless you get the recipe nailed. This has always been an issue with Pro and I am sure ESRI would rather sell us Notebook Server advanced which is very cool but $$$$$.

0 Kudos
ZachBodenner
MVP Regular Contributor

I'm also having some trouble with this exact issue. I can run python scripts just fine, but not automate them with system scheduler. Currently we operate mostly out of Enterprise (ie. no spare licenses in AGOL) using a license manager with concurrent licenses. However, this was a recent change - the user I'm attempting to run the scripts with does have a roaming Pro file. I've tried to set the license to approve for offline use, but nothing doing. Anyone with a similar setup have success?

0 Kudos
JoseSanchez
Regular Contributor

Hello everyone,

I had the same error message in our development server, and for me the solution was simple. I just opened ArcGIS Pro on the server and it behaved like I was opening it for the first time, it asked to connect to AGOL to validate the license. Then I tested again the script and the line  "import arcpy" did not return any error message.

 

Thanks

 

 

 

0 Kudos