Select to view content in your preferred language

Append only available on ArcGIS Online

848
2
05-27-2022 07:07 AM
MatejVrtich
Esri Contributor

Hi,

I'm using ArcGIS Python API v2.0.0 and trying to append data to hosted feature layer in ArcGIS Enterprise v10.9.1.

It fails with a message "Append only available on ArcGIS Online".

MatejVrtich_0-1653660440538.png

Regarding the documentation: "The append method is only available in ArcGIS Online and ArcGIS Enterprise 10.8.1+".

Am I missing something?

Thanks,

Matej

 

2 Replies
MatejVrtich
Esri Contributor

It seems this should be resolved in 2.0.1: https://github.com/Esri/arcgis-python-api/issues/1265.

However trying to append data into ArcGIS Enterprise using the 2.0.1 version, it throws another exception:

Exception Traceback (most recent call last)
in

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\features\layer.py in append(self, item_id, upload_format, source_table_name, field_mappings, edits, source_info, upsert, skip_updates, use_globalids, update_geometry, append_fields, rollback, skip_inserts, upsert_matching_field, upload_id, return_messages, future)
2376 url = self._url + "/append"
2377 del cparams
-> 2378 res = self._con.post(path=url, postdata=params)
2379 if future:
2380 executor = concurrent.futures.ThreadPoolExecutor(1)

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis_impl_con_connection.py in post(self, path, params, files, **kwargs)
1410 file_name=file_name,
1411 try_json=try_json,
-> 1412 force_bytes=kwargs.pop("force_bytes", False),
1413 )
1414

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis_impl_con_connection.py in _handle_response(self, resp, file_name, out_path, try_json, force_bytes, ignore_error_key)
898 return data
899 errorcode = data["error"]["code"] if "code" in data["error"] else 0
--> 900 self._handle_json_error(data["error"], errorcode)
901 return data
902 else:

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis_impl_con_connection.py in _handle_json_error(self, error, errorcode)
921
922 errormessage = errormessage + "\n(Error Code: " + str(errorcode) + ")"
--> 923 raise Exception(errormessage)
924
925 def post_multipart(

Exception: Error downloading item from Portal.
(Error Code: 500)

Nobody is doing a programmatic data append against ArcGIS Enterprise?

Matej

0 Kudos
Joshua-Young
Frequent Contributor

I just wanted to let you know that Esri did fix the append issue in ArcGIS API for Python 2.1.0. Unfortunately, ArcGIS API for Python would not update for me in my ArcGIS 3.0.3 conda environment. To get around that I downloaded the code from Esri's conda repository. The append function is in .\Lib\site-packages\arcgis\features\layer.py and I copied it from the 2.1.0 version. Then in the layer.py file in my 2.0.1 version conda environment I deleted the append function and pasted in the newer version. Finally I saved the layer.py file. Now my appends are working again in my scripts.

It would be nice if Esri would add fixes like this to version of the ArcGIS API for Python that are used by their current products instead of making us wait for the next product release.

"Not all those who wander are lost" ~ Tolkien