Bug: n8n instance stopped working after upgrading from 0.121.0 to 0.122.1

Hi all.

An hour ago, I upgraded my cloud n8n instance (docker/postgres) from 0.121.0 to 0.122.1.
After bringing up the docker containers (stop > rm > up), received a Bad Gateway (502) error in the browser.

Checked the docker logs of the n8n container:

ln: /home/node/.n8n: File exists
2021-05-31T03:13:48.139Z | info     | Initializing n8n process {"file":"start.js"}
2021-05-31T03:13:53.222Z | error    | There was an error initializing DB: "syntax error at or near "s"" {"file":"start.js"}
2021-05-31T03:13:53.225Z | info     |
Stopping n8n... {"file":"start.js","function":"stopProcess"}

So, then i again pulled the earlier n8n version, 0.121.0 and recreate my instance.
Same error! :confused: Now, i’m concerned that i might lose my main n8n instance.

Kindly help/advise regarding this.
Thanks.

Very strange. Have not seen that problem before. We will try to reproduce it tomorrow.

If you say you pulled again 0.121.0. Do you mean you did simply do a docker pull or you did actually set it specifically in the docker-compose file to that version? Because only the later will work.

I pulled n8nio/n8n:0.121.0
Then rebuild my Dockerfile (which uses FROM n8nio/n8n)
And then restart the containers

That will not work. n8nio/n8n means that it uses latest. Just by pulling an old version again does not make it new and the latest again. You have to now tell Docker specifically that you want to use a specific version.

To do that set:

FROM n8nio/n8n:0.121.0

Thanks! Able to get 0.121.0 working again.

Will wait for more info regarding the issue with 0.122.1

Glad to hear that you got it working again!

We will update you here once we have an update. If there is anything else “special” in your case please report as it will be helpful to reproduce the problem you are facing. Thanks a lot!

Like i mentioned:
Cloud (DigitalOcean) droplet with Ubuntu 20.04, Docker version 20.10.6, build 370c289.

I updated the OS (sudo apt update && sudo apt upgrade)
Then:

docker pull n8nio/n8n
docker build -t my-n8n .
docker-compose stop
docker-compose rm
docker-compose up -d

and after 2-3 minutes,

docker system prune -all

and then checked my instance in the browser.
Error:

Bad Gateway

That’s about it.

Thanks a lot!

Thanks for reporting this. Could you provide the version of your postgres?

We are currently trying to reproduce it.

In my docker-compose.yml, the image for postgres is configured like so:

services:
  postgres:
    image: postgres

So, i guess whichever’s the latest version of postgress
https://hub.docker.com/layers/postgres/library/postgres/latest/images/sha256-4bca01db9119d6003c03e55843ad15c54ab5c3c1b4a374e5550ceed18b2808be?context=explore

another quick question: do you have any workflows with a name including 's ?

Yes, one workflow’s name does include 's

thanks a lot for your support and fast answers! The fix will be shipped with the next version :+1:

4 Likes

Fix by @ben @ivov released with [email protected]

1 Like

sorry to reopen this issue

same problemL

  1. workflow has s in the name
  2. running
latest: Pulling from n8nio/n8n
Digest: sha256:532425d185e97b64124f782c76e9a7e1c241679e9c90894e66099acb1f579747
  1. crashes after a few mins, then proceeds to ignore the encrpytion key on restart
  2. seems to be related to mounting the .n8n dir as i remove the volume mount and it stays runnign.
n8n_1       | 2021-06-02T06:34:47.743Z | info     | Initializing n8n process {"file":"start.js"}
n8n_1       | n8n ready on 0.0.0.0, port 5678
n8n_1       | Version: 0.122.2
n8n_1       |  ================================
n8n_1       |    Start Active Workflows:
n8n_1       |  ================================
n8n_1       |    - bit-sensors
n8n_1       | 2021-06-02T06:34:54.332Z | debug    | Initializing active workflow "bit-sensors" (startup) {"workflowName":"bit-sensors","workflowId":1,"file":"ActiveWorkflowRunner.js","function":"init"}
n8n_1       | 2021-06-02T06:34:54.390Z | verbose  | Successfully started workflow "bit-sensors" {"workflowName":"bit-sensors","workflowId":1,"file":"ActiveWorkflowRunner.js","function":"init"}
n8n_1       |      => Started
n8n_1       | 2021-06-02T06:34:54.391Z | verbose  | Finished initializing active workflows (startup) {"file":"ActiveWorkflowRunner.js","function":"init"}
n8n_1       |
n8n_1       | Editor is now accessible via:
n8n_1       | http://localhost:5678/
n8n_1       | 2021-06-02T06:34:54.812Z | debug    | Add editor-UI session {"sessionId":"bzg63pnl2ff","file":"Push.js","function":"add"}
n8n_1       | 2021-06-02T06:34:55.959Z | debug    | Add editor-UI session {"sessionId":"1z4uhz4r1wp","file":"Push.js","function":"add"}
n8n_1       | 2021-06-02T06:34:55.962Z | debug    | Add editor-UI session {"sessionId":"r9jwb47l2g","file":"Push.js","function":"add"}
n8n_1       | 2021-06-02T06:35:01.530Z | info     |
n8n_1       | Stopping n8n... {"file":"start.js","function":"stopProcess"}
n8n_1       | 2021-06-02T06:35:01.532Z | verbose  | Call to remove all active workflows received (removeAll) {"file":"ActiveWorkflowRunner.js","function":"removeAll"}
alarma_n8n_1 exited with code 0

Hey @Ross_C!

Welcome to the community :sparkling_heart:

Thank you for reporting the issue and providing the details. We will take a look into it and get back to you :slight_smile:

1 Like

@Ross_C

Cannot reproduce so far, on the latest Docker image at 0.122.2, with a volume mounted and with an active workflow.

Can you share the exact name of the workflow here or via DM? This might not be related to the migrations in 0.122.x.

downgraded to n8nio/n8n:0.121.1 and it seems to stabelise

send me a PM and ill happily share the entire docker-compose with you