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.
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.
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.
No update, although you're not getting the same error I was ("Error reading features"). Maybe in your case the problem is not append() ?
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.
wow thanks, will try it out!