Error: There was an error running database migrations QueryFailedError: syntax error at or near ":"

im trying to upgrade n8n from 0.193.5 to 1.3.1. i have n8n deployment and worker deployment, running with docker in k8s with postgres db instance.

UserSettings were generated and saved to: /home/node/.n8n/config

n8n ready on 0.0.0.0, port 5678
Migrations in progress, please do NOT stop the process.
Error: There was an error running database migrations
QueryFailedError: syntax error at or near “:”


the most relevant table i was able to find in postgresbd is n8nmigrations_id_seq

SELECT “last_value”, log_cnt, is_called

FROM n8n.n8nmigrations_id_seq;

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • **Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • **Operating system: linux, eks

Hi @Nargiza_Fernandez, I am very sorry you are having trouble.

Based on the information provided I was not able to reproduce the problem I am afraid and I suspect this could come down to a previously failed/interrupted migration of some kind.

Perhaps you want to consider exporting your workflows and (decrypted) credentials using the n8n CLI? You can then start n8n against a fresh database (so previous migrations wouldn’t cause any trouble) and import your workflows and credentials on this fresh instance.