Getting this error when running: "hosted_services = server1.services.list(folder='System')".
AttributeError: 'ServiceManager' object has no attribute '_services_list'
My GIS Enterprise version is 10.5.1 and the ArcGIS API for Python version is 1.2.4. Python version is 3.6.3
Running "server1.services.list" gives following result:
<bound method ServiceManager.list of ServiceManager at https://agsserver01.test.com:6443/arcgis/admin/services
Anyone having same error or seen this message?
What server version was your colleague using?
Hi,
We're running ArcGIS Enterprise 10.7.1
Thanks,
Clinton
Hi all,
This is also an issue I have been having this week, do we have any hint as to what might be the issue?
--------------------------------------------------------------------------- AttributeError Traceback (most recent call last) In [4]: Line 1: ArcGISServerFolders = ArcGISServer.services.folders File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\server\_common\_base.py, in __getattr__: Line 86: raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name)) AttributeError: 'Server' object has no attribute 'services' ---------------------------------------------------------------------------
I am using:
ArcGIS Pro 2.7.2
Python API (arcgis) 1.8.3
ArcGIS Server 10.7.1
Many Thanks
I have been able to recreate this issue with versions of the ArcGIS Python API from 1.8.2 to 1.9.1.
For anyone still having this issue, it seems it is caused when using a non-standard Portal Administrator account to connect with. There seems to be a way around by explicitly re-connecting using the 'portal_connection' optional argument as follows:
gis = GIS(portal_url, user_name, user_pass)
hosting_server_url = gis.admin.servers.get(role="HOSTING_SERVER")[0].url
hosting_server = Server(url=hosting_server_url,
portal_connection=gis)
For some reason, the Server Object returned from gis.admin.servers.get() is a connection, but not a true Administrative connection. I was able to return the URL, but not many other properties.
Hope this helps.
I experienced this bug when pointing to an AGS server that was down/unreachable. When pointing to an available server the following code worked.
My environment:
ArcGIS Pro 2.8.3
Python API (arcgis) 1.8.5
ArcGIS Server 10.8.1
from arcgis.gis import server
url = r"https://<server>.<domain>:6443/arcgis/admin/"
site = server.Server(url,username="<adminUser>",password="<>")
admin = site.content.admin
adminServices = admin.services
servicelist = adminServices.list(folder="<someFolderName>")
# serviceList returns list of service objects