Select to view content in your preferred language

Unable to access ArcGIS Server via .ags from stand-alone script

124
4
Tuesday
Yanu
by
Emerging Contributor

Hey,

 

when I am using .ags file with ArcGIS Pro I can e.g. run this function via Notebook/PythonWindow:

https://pro.arcgis.com/en/pro-app/latest/arcpy/functions/listdatastoreitems.htm

 

However, when I am running standalone script, I am receiving:

RuntimeError: Cannot open AGS Server connection.

 

This is stand-alone AGS server.

Any ideas?

 

Regards,

Yanu

4 Replies
JoshuaBixby
MVP Esteemed Contributor

How are you running the script exactly?  Is it running from the same machine with the same user credentials?

0 Kudos
Yanu
by
Emerging Contributor

Exactly the same user, there is no issue with the license. I guess ArcGISPro is setting some additional params...

0 Kudos
HaydenWelch
MVP Regular Contributor

Seems like you've got some sort of error in how you're passing the connection file to the function. You're using the correct environment since the error is related to the AGS connection and not the arcpy import, but the connection is failing in the standalone. Mind sharing the ListDataStoreItems call that's failing?

0 Kudos
Yanu
by
Emerging Contributor

My code is

import arcpy

ags_file = 'path_tofile.ags'

print(arcpy.ListDataStoreItems(ags_file, "DATABASE"))

 

 

0 Kudos