Error: Docker image @0.74 won't start

Just updated to the latest docker image 0.74. This one keeps restarting. The log file shows

(node:6) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined
    at NodeTypesClass.getByName (/usr/local/lib/node_modules/n8n/dist/src/NodeTypes.js:21:41)
    at new Workflow (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:16:39)
    at WebhookModel1592445003908.up (/usr/local/lib/node_modules/n8n/dist/src/databases/sqlite/migrations/1592445003908-WebhookModel.js:21:38)
(node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:6) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:6) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:6) UnhandledPromiseRejectionWarning: Error: There was an error: Cannot read property 'type' of undefined
    at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
    at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23)
    at /usr/local/lib/node_modules/n8n/dist/commands/start.js:114:22
(node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
ln: /home/node/.n8n: File exists

The error does not show up when I revert to 0.73.0 or 0.73.1.

@vco1 just tested it without docker and worked fine. Investigating.

I also just tested in docker with:

docker run -it --rm \
	--name n8n \
	-p 5678:5678 \
	-v ~/.n8n:/home/node/.n8n \
	n8nio/n8n:0.74.0

which also stars fine for me. If you run the above does it also error?

Ah and what database do you use? And do you have any custom nodes?

No custom nodes, no database.

This is what I use to upgrade my image:

docker stop n8n
docker rm n8n
docker pull n8nio/n8n:latest
docker run -d \
  --name n8n \
  -p 5678:5678 \
  -e TZ="Europe/Amsterdam" \
  --env-file /.n8n.env \
  -v ~/.n8n:/root/.n8n \
  --restart unless-stopped \
  n8nio/n8n

The above worked fine, until 0.74.

And to be sure I tested it again. From a working 0.73.1 to latest (0.74). Same result. The container keeps restarting. Back to 0.73.1 again.

What seems to be happening is that n8n does not know one of the nodes in one of your active workflows.

Can you please check the breaking changes documented here:

Are you using one of those nodes? If so please make sure that you proceed as documented. It would also have made problems in version 0.73.1 but n8n would still have started. It only crashes with 0.74.0 as we made some bigger changes (to how Webhook-Nodes function) and for that database changes were required. This changes get executed on startup and for those changes does n8n have to get the node-types and if one of them is not known it crashes.

You can easily see in your workflow if a node-type is not known as it displays as an icon a question mark.

Same here.

UserSettings got generated and saved to: /home/node/.n8n/config
(node:1531) UnhandledPromiseRejectionWarning: Error: There was an error: Cannot read property ‘type’ of undefined
at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15)
at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23)
at /usr/local/lib/node_modules/n8n/dist/commands/start.js:114:22
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1531) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see Command-line API | Node.js v21.5.0 Documentation). (rejection id: 1)
(node:1531) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code

Welcome to the community @AGPDev!

Did you try what I described above?

Thanks for the help. It’s appreciated. I checked all my WF’s, but don’t see any questionmarks.

Also, the breaking changes are from 0.69. Everything went fine since then. Also see my first remark. No questionmarks.

My next steps will be to set up a VM and install n8n on that. From there I will import my WF’s one at a time and see what happens.

By the way, did you notice that the errors that @AGPDev has are exactly the same?

I explained in my post why it would break now with 0.74.0 and not before on startup (even though that specific change was in 0.69.0).

Ah yes, saw that he has a similar error. Also that one seems to be caused by an unknown node-type.

Something else you could try it to deactivate all your workflows in 0.73.1, then upgrade to 0.74.0 and then activate them again. This should theoretically work.

1 Like

Well, this is strange.

In 0.73.1 I deactivated all workflows.
Then I upgraded to 0.74 (latest) via the script that I posted before.
N8N started without issues.
I activated all my workflows again. And opened them to make a visual check.
And everything is running fine now it seems.

Can’t explain this. But for now I’m up and running again.

No is actually not really strange. If all the workflows are deactivated then the script (the one which is currently crashing because one node in one of your active workflows is not known) does not have to do anything. So it does not crash and so it works. As that script runs only one time after upgrading it then keeps on working also once you activate the workflows again.

Works to me too, ty guys

1 Like

Hey.
Sorry to bring this up again.

I was running 0.73.0 and upgraded to 0.75.0. I also had to disable all workflows for this to work.

These were the errors I got:

(node:6) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘type’ of undefined at NodeTypesClass.getByName (/usr/local/lib/node_modules/n8n/dist/src/NodeTypes.js:21:41) at new Workflow (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:16:39) at WebhookModel1592445003908.up (/usr/local/lib/node_modules/n8n/dist/src/databases/sqlite/migrations/1592445003908-WebhookModel.js:21:38) (node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:6) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:6) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1) (node:6) UnhandledPromiseRejectionWarning: Error: There was an error: Cannot read property ‘type’ of undefined at Object.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/errors/lib/index.js:26:15) at Start.error (/usr/local/lib/node_modules/n8n/node_modules/@oclif/command/lib/command.js:60:23) at /usr/local/lib/node_modules/n8n/dist/commands/start.js:114:22 (node:6) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

When I upgraded to 0.75.0 and went to activate the workflows again, there was one that was not possible, because it did not have a trigger-node (for some reason this was active, I may have cheated…). Not sure if this was the problem, but I’m posting here so you all know.

Cheers.

Sorry do not understand the problem. Why do you want to activate a workflow that does not have a Trigger-Node? After all it would not do anything differently if it is active or not.

I meant in my case, I suspect that was the problem when upgrading to the new version.
It was probably active by mistake.

Ah interesting. But still strange that it was possible in the first place because n8n should not have allowed it.