N8n server (docker compose) keeps restarting after upgrade?

dear all

I upgraded my n8n with the classical command lines (did this before, but haven’t upgraded in a while)
docker pull n8nio/n8n
sudo docker-compose stop
sudo docker-compose rm
sudo docker-compose up -d

in portainer I see the log stating “Started with migration for wait functionality. Depending on the number of saved executions, that may take a little bit.”


  1. it takes veeeery long
  2. n8n it seems to restart without me doing anything
  3. can’t access the app (Bad Gateway)

Here are the logs with the time stamps
2021-11-21T11:21:32.994888972Z Initializing n8n process
2021-11-21T11:21:32.997742486Z ****************************************************
2021-11-21T11:21:32.997768115Z * *
2021-11-21T11:21:32.997791411Z * n8n now sends selected, anonymous telemetry. *
2021-11-21T11:21:32.997813355Z * For more details (and how to opt out): *
2021-11-21T11:21:32.997835410Z * Telemetry | Docs *
2021-11-21T11:21:32.997856928Z * *
2021-11-21T11:21:32.997878001Z ****************************************************
2021-11-21T11:21:33.586649455Z INFO: Started with migration for wait functionality.
2021-11-21T11:21:33.586673028Z Depending on the number of saved executions, that may take a little bit.
2021-11-21T12:08:36.835061094Z Initializing n8n process
2021-11-21T12:08:36.838036413Z ****************************************************
2021-11-21T12:08:36.838064227Z * *
2021-11-21T12:08:36.838089578Z * n8n now sends selected, anonymous telemetry. *
2021-11-21T12:08:36.838114059Z * For more details (and how to opt out): *
2021-11-21T12:08:36.838137707Z * Telemetry | Docs *
2021-11-21T12:08:36.838161429Z * *
2021-11-21T12:08:36.838184947Z ****************************************************
2021-11-21T12:08:37.389792796Z INFO: Started with migration for wait functionality.
2021-11-21T12:08:37.389817573Z Depending on the number of saved executions, that may take a little bit.
2021-11-21T12:55:57.625654637Z Initializing n8n process
2021-11-21T12:55:57.627712504Z ****************************************************
2021-11-21T12:55:57.627739003Z * *
2021-11-21T12:55:57.627763817Z * n8n now sends selected, anonymous telemetry. *
2021-11-21T12:55:57.627786965Z * For more details (and how to opt out): *
2021-11-21T12:55:57.627810187Z * Telemetry | Docs *
2021-11-21T12:55:57.627833427Z * *
2021-11-21T12:55:57.627910203Z ****************************************************
2021-11-21T12:55:58.171215669Z INFO: Started with migration for wait functionality.
2021-11-21T12:55:58.171239002Z Depending on the number of saved executions, that may take a little bit.

do you know that is going wrong ?
thanks for your help and advice

Hey @cie172,

Not seen it do that before without more of a clue, do you know what version you were previously running and have you tried enabling more logging in the environment variables to see if that shows anything else?

It could be that you bin off the database and start again but that could be a bit extreme, do you happen to have a backup of your workflows?

hi Jon
I have backups for only some of them :frowning:
I upgraded to the last version, and the previous one must’ve been from august or so
could you please tell me how to change logging level ?


You can find the info here: Logging in n8n | Docs

Add N8N_LOG_LEVEL=debug To your environment variables then restart the container and use the up -d option and see if it outputs a lot more.

I tend to use docker logs container_name to view them but I think Portainer might have a built in option.

for now only log I see :
2021-11-21T13:56:04.563Z | debug | No codex available for: N8nTrainingCustomerDatastore.node.js {“file”:“LoadNodesAndCredentials.js”,“function”:“addCodex”}

2021-11-21T13:56:04.568Z | debug | No codex available for: N8nTrainingCustomerMessenger.node.js {“file”:“LoadNodesAndCredentials.js”,“function”:“addCodex”}

could it be that I have a problem with traefik and not with n8n ? :face_with_monocle:

traefik log states :
time=“2021-11-21T14:13:23Z” level=error msg=“Error renewing certificate from LE: {pmyn8n.xxxx.fr []}, error: one or more domains had a problem:\n[pmyn8n.xxx.fr] [pmyn8n.xxx.fr] acme: error presenting token: timeout 2021-11-21 14:13:22.585441739 +0000 UTC m=+9.441251106\n” providerName=mytlschallenge.acme

I guess that depends, I wouldn’t have thought the n8n container would restart if the traefik container has an issue.

You could try disabling the traefik container and just running n8n to see if you can load it with port 5678.

Was there anything else in the n8n log?

got rid of traefik message by renewing certificate properly

but nothing new on the n8n front, no additional log messages :frowning:

should I try reverting to a previous version of n8n ?

You can give it a go to see if it helps, Maybe try 149.

139 you mean ? (149 is the last one, right ?)

going down as far as v134 did the trick, I’m back online
perhaps I should try going up one version after another ?

150 is the latest, I guess while at 134 if you are using SQLite it may be worth setting some options to remove the older executions from the database then trying again with the latest release.

you were right. I pruned most of the saved executions and upgraded. waited “a bit” and it was ok.
thanks for your help!

1 Like