I just tried to update an n8n instance I am running on Digital Ocean droplet. The URL where I run the page is now showing as bad gateway or 404 not found.
I checked the logs of the n8n instance and I am getting
Stopping n8n…
Initializing n8n process
Migrations in progress, please do NOT stop the process.
There was an error initializing DB: “SQLITE_ERROR: table “temporary_user” already exists”
which just repeats and repeats. Any ideas on how I can get this working again? My technical skills are fairly limited but I am happy to try anything. I was using this for quite some processes so the downtime is super unfortunate.
Hi @stuart, I am sorry to hear you’re having trouble.
This sounds like a previous database migration might have been interrupted and now the migration fails because a command (presumably this one) fails to run.
One option to recover would be to:
Stop n8n
Export your current workflows and credentials using the CLI (documented here)
Move the old database file (usually lives in ~\.n8n\database.sqlite) to a new location (you could also delete it, but it could be good to have a backup just in case)
Start n8n again (which will create a new database file)
Import your workflows and credentials using the CLI
Restart n8n, make sure all required workflows are active
If you know which previous migration failed and you have backups from before that time, you could also consider recovering a backup and then simply re-running the upgrade without interrupting the migration.
Lastly, you could also try manually deleting the temporary_user table from your database and then restart n8n, but make sure to take a backup before changing the db.