I am having a problem updating a couple of my Survey123 forms. The original S123 form was published a few months ago. Today, I tried adding a new text question/field to the survey. When republishing it in S123 Connect, it gets stuck when trying to add the new field to the hosted feature service. The dialog box saying that it is adding the new field just keeps spinning and spinning. After waiting 20+ minutes, I just close out of S123 Connect because it's clear nothing is happening. When I look in server manager, I see the following error message: Error executing tool: Manage Feature Service Job ID: (some random ID): ERROR: Adding field to the table failed. Failed to execute (Manage Feature Service).
Unfortunately, after doing that, it corrupts the associated hosted feature service. We get a generic error message when submitting new S123 forms and we can't create new points in the hosted feature service directly through Portal.
One thing I noticed after that is that there was a record in the hosted feature service with an ObjectID of -220. There is also a corresponding error message in server manager stating that it fails to create a new record because of a duplicate key issue. This is the error message: 0 : ERROR: duplicate key value violates unique constraint "gdb_ct2_54" Detail: Key (objectid, gdb_to_date)=(-220, 9999-12-31 23:59:59) already exists. Where: SQL statement (SQL statement here) PL/pgSQL function nvv_update_54() line 11 at SQL statement.
Note that the record was created after attempting to republish the form. And I am able to delete the record. After deleting, I am able to create a new record, but it gives it an ObjectID of -220 and then I can't create any new records after that until I delete it again.
I was able to replicate this issue with a different, but very similar form/feature service. We're running ArcGIS Enterprise 10.9.1. However, I was able to publish a new S123 form (the same as the one causing issues) and add a new field to it and it was fine.
Does anyone know why this issue is happening, and where/why in the world negative ObjectIDs are being created? That shouldn't even be possible.