Error 500 after server migration

https://community.kobotoolbox.org/t/how-to-fix-references-of-old-domain-names-after-migration/13324

I know this is an old thread, but this helped me verify the error was only on our dev server (with a different domain). So it was great to find this. I noticed another error that I THINK may be related so wanted to post here for verification that it is caused by the domain change.

Recreate:
-change config to new-domain.com
-try to redeploy old form (breaks as expected, no confusion there)
-submission to old form, successful on ver 2.022.08a/b
-try to EDIT a previous submission throws the below error

Error occured during the loading of this form.

Request to https://kpi.new-domain.com/api/v2/asset_snapshots/sm9mAtuSSHMJqa2JUb2Dve/manifest.xml failed.

My assumption is this is caused by this same behavior of domain info getting stored in the metadata. I have NOT run the scripts in this thread as I can explain why the old forms on dev do not work with a temporary domain. But can anyone confirm that the submission edit error would be fixed by the same scripts?

Hello @tolexy,

What is the error you got exactly from edit?
Do you face the same issue with 2.022.16? FYI: There was an issue discovered in 2.022.08 with edit submissions fixed in 2.022.16.

1 Like

We havent tried 2.022.16 yet and i dont actually see that tag in git. Did I miss it somewhere?

Here is the error message

It’s a release branch, not a tag, but after looking at it a little bit more, I don’t think it would help anyway.

Your asumption seems to be true because edits use KPI now which proxies the request to KoBoCAT to save the data in DB. The problem must occur between KPI and KoBoCAT. KPI is just re-raising the error from KoBoCAT to Enketo.

If new forms work OK, chances are really high that you are true.

1 Like

ah i see the branch now, thanks. On our dev with the new domain, i deploy a brand new form, submit a form, but get the same error trying to edit. I will run these scripts above and try to update here if i find anything

1 Like

in case it’s mroe helpful:

enketo Unknown Error occurred during attempt to update cache Error: Request to https://collect1.eeeeeeeeee.com/api/v2/asset_snapshots/snCADhFURga3SKPRf5YyQA/manifest.xml failed.
enketo at Request._callback (/srv/src/enketo_express/app/lib/communicator/communicator.js:271:25)
enketo at Request.self.callback (/srv/src/enketo_express/node_modules/request/request.js:185:22)
enketo at Request.emit (events.js:314:20)
enketo at Request. (/srv/src/enketo_express/node_modules/request/request.js:1154:10)
enketo at Request.emit (events.js:314:20)
enketo at IncomingMessage. (/srv/src/enketo_express/node_modules/request/request.js:1076:12)
enketo at Object.onceWrapper (events.js:420:28)
enketo at IncomingMessage.emit (events.js:326:22)
enketo at endReadableNT (_stream_readable.js:1241:12)
enketo at processTicksAndRejections (internal/process/task_queues.js:84:21) {
enketo status: 500
enketo }

Sound like an issue with KPI. It returns a 500 to Enketo.
If you access the URL directly with an authenticated user, does it work?

1 Like

I am able to access the asset_snapshot, but trying to access the manifest.xml file still gives a 500

Can you activate DEBUG mode and restart your uWSGI container to get the error trace?
Otherwise, you should try sentry to give a better idea what’s going on.

Please open another topic for that :wink:

1 Like

Update:

connected our dev VM to new Sentry account and found the error. See previous issue. When we tried to move to 2.021.24b, we found an error and had to roll back to 2.021.24 and manually modify the KPI DB to remove “synced_with_backend” column. This column was still missing and expected from all new versions. Added this back in, synced_kobocat_media was run on KPI, and all is working as expected.