ArcPy fails to initialize Python 3

452
9
06-19-2020 11:33 AM
by Anonymous User
Not applicable

When launching a python script from a SQL Server Agent Job I am unable to initialize a product license (We are using ArcPro) which is causing my import arcpy statement to fail. I know its a long shot but do any of y'all have an idea on how to fix this? 

-Ben

0 Kudos
9 Replies
JoeBorgione
MVP Esteemed Contributor

How are you managing your licenses?  It gets a little tricky when using AGOL named users.  I'm curious as to why you are using sql server agent to fire an arcpy script: we have a system user do it, and that system user is also a named user at agol so it can grab the license.

That should just about do it....
0 Kudos
MichaelVolz
Esteemed Contributor

Is this script gong to be part of an on-going process that will be run as a Windows Scheduled Task?

0 Kudos
JoeBorgione
MVP Esteemed Contributor

Michael Volzl ; all of our scripts run as scheduled tasks not through sql server agent...

That should just about do it....
0 Kudos
by Anonymous User
Not applicable

So we are running this script after an insert trigger is fired. We currently run it as a scheduled task but have received requests to have it run after records are inserted into a database. We have a named user license that is authorized to work offline on the machine.

0 Kudos
JoeBorgione
MVP Esteemed Contributor

I don't know how you would convince the license part that sql server agent is the same as the user name that runs your scheduled tasks. That's a funky one.

Would you consider an attribute rule that fires upon insert?

That should just about do it....
0 Kudos
by Anonymous User
Not applicable

I would. Can you provide documentation for me to go down that rabbit hole? I really appreciate the help. 

0 Kudos
MichaelVolz
Esteemed Contributor

Is this an enterprise geodatabase?  If so, would that require that the Attribute Rule be run against a feature service where the enterprise geodatabase is the source?

by Anonymous User
Not applicable

It is an enterprise gdb yes. As for your second question technically I think so?

0 Kudos
JoeBorgione
MVP Esteemed Contributor

Attribute rules:  Introduction to attribute rules—Geodatabases | Documentation 

 would that require that the Attribute Rule be run against a feature service where the enterprise geodatabase is the source?

Any attribute rule(s) are assigned to a specific attribute in the specific feature class.  I believe if that feature class is a published, editable feature layer/service the attribute rules are fired back in the enterprise gdb, so you'd be good to go.

That should just about do it....
0 Kudos