Failed login for API python fieldmaps script

219
0
03-21-2024 08:53 AM
Labels (2)
Marcus77
New Contributor

When trying to duplicate forms with the python-script. The scrips seems not possible to run due to the error code "Exception: A general error occurred: Invalid username or password. "


I have followed the instructions and installed the field-maps-scripts environment using conda. Just to try the script I have set up two new empty field maps. With one map just having one form question added to test the form transfer. Te other destination map is completely empty of any forms.

 

The following command was written to start the script.

python copy_form_between_maps.py -org https://my-org.maps.arcgis.com -u myorgUserName -p myorgPassword -source-map-id (ID see marked Green arrow here, 33char long) -dest-map-id (ID see marked Green arrow here, 33char long) --overwrite

 

This photo below is the web address line when browsing maps in fieldmaps. I took the organisation address here (green arrow in photo). Also both the map id for -source-map-id and dest-map-id I took from respective maps address line ( blue arrow in photo) written in the command above. Now blacked out boxes are there to hide organisation details.

here is where i took my organisation and map details:

Marcus77_1-1711035517232.png

Have tested with two separate account in my organisation with no working results. What could be the cause for this?




Here is the erorr message when running in powershell: \auth\_auth\_token.py", line 841, in token | self._init_response_type_token() | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\auth\_auth\_token.py", line 560,
in _init_response_type_token | raise ArcGISLoginError() | arcgis.auth._error.error.ArcGISLoginError: Invalid username or password. | | During handling of the above exception, another exception o
ccurred: | | Traceback (most recent call last): | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 1466, in post | resp = s
elf._session.post( | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\auth\api.py", line 525, in post | return self._session.post( | File "C:\Users\myuser\.
conda\envs\field-maps-scripts\lib\site-packages\requests\sessions.py", line 637, in post | return self.request("POST", url, data=data, json=json, **kwargs) | File "C:\Users\myuser\.conda\en
vs\field-maps-scripts\lib\site-packages\requests\sessions.py", line 575, in request | prep = self.prepare_request(req) | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-pack
ages\requests\sessions.py", line 486, in prepare_request | p.prepare( | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\requests\models.py", line 372, in prepare |
self.prepare_auth(auth, url) | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\requests\models.py", line 603, in prepare_auth | r = auth(self) | File "C:\U
sers\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\auth\_auth\_token.py", line 857, in __call__ | r.headers["X-Esri-Authorization"] = f"Bearer {self.token}" | File
"C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\auth\_auth\_token.py", line 847, in token | self._init_token_auth_handshake() | File "C:\Users\myuser\.c
onda\envs\field-maps-scripts\lib\site-packages\arcgis\auth\_auth\_token.py", line 679, in _init_token_auth_handshake | raise ValueError(",".join(sign_json["messages"])) | ValueError:
Invalid username or password. | | During handling of the above exception, another exception occurred: | | Traceback (most recent call last): | File "C:\path\pyscripts\field
-maps-scripts\scripts\copy_form_between_maps.py", line 141, in <module> | main(args) | File "C:\path\pyscripts\field-maps-scripts\scripts\copy_form_between_maps.py", line
87, in main | gis = GIS(arguments.org_url, | File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\gis\__init__.py", line 609, in __init__ | raise e
| File "C:\Users\myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\gis\__init__.py", line 548, in __init__ | self._portal = _portalpy.Portal( | File "C:\Users\
myuser\.conda\envs\field-maps-scripts\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 232, in __init__ | self.get_properties(True) | File "C:\Users\myuser\.conda
\envs\field-maps-scripts\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 1300, in get_properties | raise e | File "C:\Users\myuser\.conda\envs\field-maps-scripts\l
ib\site-packages\arcgis\gis\_impl\_portalpy.py", line 1280, in get_properties | resp = self.con.post(path, self._postdata(), ssl=True) | File "C:\Users\myuser\.conda\en
vs\field-maps-scripts\lib\site-packages\arcgis\gis\_impl\_con\_connection.py",
line 1515, in post | raise Exception("A general error occurred: %s" % e) | Exception: A general error occurred: Invalid username or password. |

 

 

 

 

 

0 Kudos
0 Replies