Unable to update / delete user in ArcGIS Python API - HTTP 404 error

2086
15
02-03-2020 05:20 AM
PhillipGiraud
New Contributor II

I am trying to update a user's description in our ArcGIS Portal instance but the below code is giving me an HTTP 404 error:

from arcgis.gis import GIS

gis = GIS("my_portal_url", "my_user", "my_password")
user = gis.users.get(username="chris.buckmaster")
user.update(description="Chris's Bio")

The error I receive is as follows:

Traceback (most recent call last):
File "test.py", line 5, in <module>
user.update(description="Chris's Bio")
File "C:\ProgramData\Anaconda3\lib\site-packages\arcgis\gis\__init__.py", line 5700, in update
files=files)
File "C:\ProgramData\Anaconda3\lib\site-packages\arcgis\_impl\connection.py", line 1107, in post
resp = opener.open(url, data=encoded_postdata.encode())
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 531, in open
response = meth(req, response)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 569, in error
return self._call_chain(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 503, in _call_chain
result = func(*args)
File "C:\ProgramData\Anaconda3\lib\urllib\request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404:

I can connect fine to the Portal and have been able to extract data out and produce reports etc so I am wondering why I might be receiving this error? I am using v1.6 of the ArcGIS Python API and Portal v10.6.

I am connecting as an administrator account so have full privileges.

Thanks

0 Kudos
15 Replies
ChrisBuckmaster2
New Contributor III

Jake Skinner‌ should I not be receiving the above when trying to install v1.7?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Try upgrading to the latest version of ArcGIS Pro (2.5), and this should upgrade your API to 1.7.1.

0 Kudos
ChrisBuckmaster2
New Contributor III

Jake Skinner‌ I have upgraded ArcGIS Pro to version 2.5 and using version 1.7 of the ArcGIS Python API it is still giving me the same error message?

I am connecting with an administrator account and have been able to update item descriptions so I should have the necessary permissions, is there anything else I can try / suggestions on how to troubleshoot the issue?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

What version of Portal are you using?  I tested this with 10.7.1.  If you are using a previous version, I would recommend upgrading. 

0 Kudos
ChrisBuckmaster2
New Contributor III

I am using Portal 10.6 and am hesitant to upgrade as it will impact upon users.

We are on fairly recent versions for all software so I would have thought something this simple shouldn't be an issue with the version?

0 Kudos
JakeSkinner
Esri Esteemed Contributor

I've only tested this with 10.7.1, and, unfortunately, I don't have access to 10.6 to test.  Yes, there will be some down-time when you perform the upgrade.  ArcGIS Enterprise 10.8 is slated for release later this month.  If you are planning to upgrade, you may want to wait for the 10.8 release so you can be at the latest version.

0 Kudos