Bad gateway after n8n update to version 2.0

Hi everyone,

My n8n instance is self hosted from Hostinger (Docker Compose).
My current n8n version is to 1.123.5

I’ve tried to update my instance 4 times but i’ve reached the same message each time : “bad gateway”

Is somenone get problems too with the SQLite base in which there are double versionID from the table workflow_history ?

Could you please provide me some guidances to execute it as per the investigations of the Hostinger bot :

“Log analysis shows that the n8n container attempts to start but consistently fails due to a database migration error: > “SQLITE_CONSTRAINT: UNIQUE constraint failed: workflow_history.versionId” This means there are duplicates in the versionId field of the workflow_history table, preventing the migration from being applied and blocking n8n from launching. Next step: Manually remove the duplicates from the workflow_history table to unblock the migration and allow n8n to start correctly.”

Hi @lumert, did you follow the migration guide?

There is also a migration tool to see what will maybe cause problems

I see they dropped support for the sqlite driver. I am not sure if this is the cause to your problem. It’s now recommended to use postgres as your db

Hi @Wouter_Nigrini Thank you for sharing with me the migration guide. It has been more or less usefull to clean some instance issues (low and medium) detected through the migration report tool.
Finally, i’ve found the pb that i’ve identified in my compose.yaml at the n8n/image line :
→ Before, i have set up like this :

image: docker.n8n.io/n8nio/n8n:latest

I understood that If the latest image hasn’t yet switched to v2.x, I still remain on v1. For a clean migration, i’ need to force the v2.x image :

image: docker.n8n.io/n8nio/n8n:2.0.0

I made several investigations and testing different changes and approach in my docker compose (commands, SQL queries etc..) but the solution was only the image ahah !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.