AttributeError: 'ServiceManager' object has no attribute '_services_list'

4015
14
11-21-2017 02:49 AM
KjellTimalm
New Contributor III

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?

14 Replies
JasonLee9
New Contributor II

Kjell,

I also have this issue. I can see the folders when I make a call for a list. Maybe someone from ESRI can chime in on this.

Error message

KeyError                                  Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\arcgis\gis\server\_common\_base.py in __getattr__(self, name)
82         try:
---> 83 return self._properties.__getitem__(name)
84         except:

C:\ProgramData\Anaconda3\lib\site-packages\arcgis\_impl\common\_mixins.py in __getitem__(self, key)
339         """
--> 340 return self._mapping[key]
341

KeyError: '_services_list'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-6-2884d629327a> in <module>()
----> 1 server0.services.list()

C:\ProgramData\Anaconda3\lib\site-packages\arcgis\gis\server\admin\_services.py in list(self, folder, refresh)
122             self._currentFolder = folder
123             self._folder = folder
--> 124 return self._services_list
125
126         return self._services_list

C:\ProgramData\Anaconda3\lib\site-packages\arcgis\gis\server\_common\_base.py in __getattr__(self, name)
86                 if k.lower() == name.lower():
87                     return v
---> 88 raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name))
89     #----------------------------------------------------------------------
90     def __getitem__(self, key):

AttributeError: 'ServiceManager' object has no attribute '_services_list'

0 Kudos
PeterKnoop
Occasional Contributor III

Esri Support reports this is a known issue with version 1.2.4:

BUG-000109673: Using the 'services.list()' function from the Python API fails with a traceback error.

The bug does not affect previous versions of the API, so one suggested workaround is to use version 1.2.3 instead.

0 Kudos
PeterKnoop
Occasional Contributor III

This has been fixed in the 1.3.0 release, and services.list() now works as expected again.

0 Kudos
JasonLee9
New Contributor II

Looks like it may be broke again in 1.6.2. Anyone else seeing this?

0 Kudos
EmilianoPetrelli
New Contributor III

Hai all,

I have a similar problem with version 1.8.0 when I try to get list of ags's services:

ags = Server(urlAdminAgsMaster, None, username=adminUser, password=adminPasswd)
print(type(ags))
ags.services.list()

Output:
<class 'arcgis.gis.server.admin.administration.Server'>
'Server' object has no attribute 'services'

The same code works with version 1.6.0

I'm using Python API on a Conda Environment (no ESRI Products installed instead the API)

Anyone else?

Thanks in advance

Emiliano

by Anonymous User
Not applicable

I'm also getting this error.

0 Kudos
EmilianoPetrelli
New Contributor III

Hello,

Do you have found a solution for this issue?

 

Thanks

0 Kudos
PhilLarkin1
Regular Contributor

I am also seeing this at 1.8.1

We recently upgraded our servers to 10.7.1

 

from arcgis.gis import server
url = r"https://<root>.<host>.org:<port>/arcgis/admin/"
site = server.Server(url,username=<user>,password=<pw>)

site.services

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
In  [99]:
Line 1:     admin = site.services

File C:\<...>\arcgispro-py3-clone\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'

 

0 Kudos
ClintonBallandis1
Occasional Contributor

Hi,

I've also been getting 'Server' object has no attribute 'services'. I'm using ArcGIS Pro 2.5.0 and version 1.7.0 of the python API

I asked my colleague to try the same script using his ArcGIS Pro 2.6.1 and version 1.8.1 of the python api and there is no error.