Select to view content in your preferred language

Error code 500 on appending data with REST API to ArcGIS Online table

1531
14
03-05-2024 09:25 AM
Labels (1)
mikAMD
by
Frequent Contributor

I have this process that runs daily, where I get some values from an external source, I transform & store them in a local DB. I then match existing values on AGOL to this local table to make sure the objectids are the same (just to make sure everything is in sync) and add new objectids sequentially locally from the last existing one on AGOL. Then I append (with python) this data to my AGOL table (upload_format = 'geojson', upsert = True, edits = the results from a query on my local DB).

This was running fine, every day, until last week, when I started getting an Exception: Unknown Error (Error Code: 500). The sync and changeTracking parameters are deactivated and I've tried deleting and recreating the table (multiple times)...

What to do?

Please help!

EDIT march 11th

Working with ESRI staff on this, will update with developments. Also noticed that I only have this problem with tables, appending to layers is working correctly.

0 Kudos
14 Replies
gmaz
by
New Contributor

Ahh...thank you. I also opened a case with ESRI about this. I'm looking into some workarounds and will let you know if anything comes of the case. 

0 Kudos
AndyHess
Emerging Contributor

Has there been an update to this? I am trying to truncate and append using a modified version of the script here: https://community.esri.com/t5/arcgis-online-documents/overwrite-arcgis-online-feature-service-using/... and I am getting the "Error appending features: Error reading features.
(Error Code: 500)" issue. I changed the script to use a shapefile because apparently using a file geodatabase also doesn't work with the arcgis for python api  for some unknown reason. (https://community.esri.com/t5/arcgis-api-for-python-questions/problem-update-hosted-feature-in-porta...). Thanks for any updates.

0 Kudos
mikAMD
by
Frequent Contributor

No update, although you're not getting the same error I was ("Error reading features"). Maybe in your case the problem is not append() ?

0 Kudos
Justin_Greco
Frequent Contributor

I just started noticing this issue with the 500 error code with one of my scripts that uses append().  But after downloading the ZIP file of the FGDB and using the Update Features on the item page, it worked with no issues.  So I tried again with the developer tools open and noticed it was sending the append_fields and field_mappings, which I was omitting in Python since they are optional.  The append in Python was successful after setting the append_fields and field_mappings.  Though it was the append_fields that fixed it, since I tried without field_mappings.

mikAMD
by
Frequent Contributor

wow thanks, will try it out!

0 Kudos