SQLITE_ERROR: no such index: IDX_

All of sudden, I’m getting this weird error after updating n8n to the latest version (Got this log via Portainer)

Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,ln: /home/node/.n8n: File exists
,Initializing n8n process
,Migrations in progress, please do NOT stop the process.
,There was an error initializing DB: "SQLITE_ERROR: no such index: IDX_ca4a71b47f28ac6ea88293a8e2"
,
,Stopping n8n...
,

Also, I’m getting 502 error when I check in browser

1 Like

This sounds like a previous database migration might have failed or got interrupted and the database is now in an unexpected state.

Do you have a backup of your workflows/credentials? If so, could you try simply creating a fresh database and import your backup?

1 Like

any steps for docker?

actually, it happened while updating the n8n to the latest version

having DB backup (sqlite3)

Hey there,

What versions did you upgrade from?

updated to [0.168.2 ] from February released version

Can you try installing 167 and seeing if you have the same issue?

0.167.0 working well omg :no_mouth:

docker run -d --net n8n \
--ip 172.12.0.4 \
-it \
--name n8n-hi  \
-p 5678:5678 \
 -v ~/.n8n:/root/.n8n \
n8nio/n8n:0.167.0
3 Likes

seems the issue on 0.168.2 - older versions are working well

1 Like

Did you try 168.0 and 168.1 as well? I updated mine to 168.2 on portainer today and didn’t hit the issue so we might need to do some more testing on it.

sure i will tested it

Happened to me going straight to 170.
I think the key is upgrading to 167 before going on.
167 contains a migration on that index with a “create if not exists”. Subsequent versions assume that this index exists and the migration cannot be completed if you come from previous versions.

Btw guys, you created the ACL, this is HUGE! Congrats!

3 Likes

Fix got released with [email protected]

2 Likes

Awesome. Thanks @jan