My n8n worker node keeps crashing on Railway

Describe the problem/error/question

I have n8n deployed on Railway. It was working fine until I hit my usage limit, and they shut my instance down. Now I can’t seem to get the worker back up without having it crash a few minutes after restarting/redeploying.

What is the error message (if any)?

User settings loaded from: /home/node/.n8n/config

Oct 01 07:01:45

Last session crashed

Oct 01 07:01:57

Error: Worker exiting due to an error.

Oct 01 07:01:57

TypeError: Cannot read properties of undefined (reading ‘subscribe’)

Oct 01 07:01:57

[JobProcessor] Starting job 522 (execution 875)

Oct 01 07:02:07

User settings loaded from: /home/node/.n8n/config

Oct 01 07:02:09

Last session crashed

Oct 01 07:02:20

Found unfinished executions: 875

Oct 01 07:02:20

This could be due to a crash of an active workflow or a restart of n8n.

Oct 01 07:02:20

Currently active workflows:

Oct 01 07:02:20

  • My Today v2 - create tomorrow (ID: 8ssJPegdqwv2hRUz)

Oct 01 07:02:20

  • My Today (ID: U6QrHG15fhm3BHq0)

Oct 01 07:02:20

  • My Today v2 - create today (ID: Uo42WFEAkbikxc3g)

Oct 01 07:02:20

[Recovery] Logs available, amended execution

Oct 01 07:02:20

Error: Worker exiting due to an error.

Oct 01 07:02:20

TypeError: Cannot read properties of undefined (reading ‘subscribe’)

Please share your workflow

No issues with the workflows themselves

Share the output returned by the last node

N/A

Information on your n8n setup

  • n8n version: 1.60.1
  • Database (default: SQLite): Postgres, Redis
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Railway

Hi @ckmoocow,

Did you make any changes to your active workflows since you got the instance back up after it having been shut down?

Have you reached out to Railway about this? Seems mainly to be a deployment issue

I haven’t made any changes. I did contact Railway first, and they said they won’t support 3rd party apps.

This somehow sounds like a permissions issue?

I’m not able to see those Railway links, can you please share the deploy logs through elsewhere? Can you copy paste them into a code block in here?

Thanks

The timestamps don’t really link to much more info:

Here’s my Railway setup:

Currently active workflows:

- My Today v2 - create tomorrow (ID: 8ssJPegdqwv2hRUz)

- My Today (ID: U6QrHG15fhm3BHq0)

- My Today v2 - create today (ID: Uo42WFEAkbikxc3g)

[Recovery] Logs available, amended execution

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Found unfinished executions: 875

This could be due to a crash of an active workflow or a restart of n8n.

Currently active workflows:

- My Today v2 - create tomorrow (ID: 8ssJPegdqwv2hRUz)

- My Today (ID: U6QrHG15fhm3BHq0)

- My Today v2 - create today (ID: Uo42WFEAkbikxc3g)

[Recovery] Logs available, amended execution

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

[JobProcessor] Starting job 522 (execution 875)

User settings loaded from: /home/node/.n8n/config

Last session crashed

Found unfinished executions: 875

This could be due to a crash of an active workflow or a restart of n8n.

Currently active workflows:

- My Today v2 - create tomorrow (ID: 8ssJPegdqwv2hRUz)

- My Today (ID: U6QrHG15fhm3BHq0)

- My Today v2 - create today (ID: Uo42WFEAkbikxc3g)

[Recovery] Logs available, amended execution

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Found unfinished executions: 875

This could be due to a crash of an active workflow or a restart of n8n.

Currently active workflows:

- My Today v2 - create tomorrow (ID: 8ssJPegdqwv2hRUz)

- My Today (ID: U6QrHG15fhm3BHq0)

- My Today v2 - create today (ID: Uo42WFEAkbikxc3g)

[Recovery] Logs available, amended execution

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')

User settings loaded from: /home/node/.n8n/config

Last session crashed

Error: Worker exiting due to an error.

TypeError: Cannot read properties of undefined (reading 'subscribe')```
1 Like

I have the same issue… :confused:

We don’t officially support Railway but looking at that error I suspect the issue is likely to be with the connection to the Redis instance, Can you make sure you have the environment options correctly set

1 Like

Never figured this out. I just migrated to a brand new deployment

1 Like

Railway can F you badly. I was running my first several instances here and it would keep crushing out of the blues and became sort of unstable. (Thats one way I lost a client)

I’d advice moving to a server setup ( Thought a bit technical) with a postgres DB eg supabase. The costs are always predictable unlike railway where they bump you with a $10 bill then the next month a $20 one

I tried the digital Ocean 1 GB package and my n8n was a but slow as I have lots of workflows and execution data. Moved to a new 6GB server and its super fast than before. No bugs, no downtimes etc.

Also to note If posible,

  • Store the env AND yaml in a safe place that you can always duplicate easily
  • Save the encryption key to have a constant credential recovery or transfer to new instances
  • Use a postgres database over the inbuilt sqlite database. You will have more control and “portability” over the data
  • Get minimum 2 GB RAM if you are looking to build some cmplex or large workflows.
  • Set the SMTP to send emails. Will come in handy the day you forget your password or wanna invite new users to your n8n
  • Dont forget to set the data volumes n8n_data for data persistence

These will give you a better run

For newbies

There is an app called easypanel(.)io. They have a oneclick n8n setup. The downside is when I tried it, the postgres variables didnt work for me. If you are loking for the basic functionalities, this would be a good place to start

Kind regards,
Imperol

PS: If you are looking to move or host n8n, feel free to reach out

1 Like

You can use this template - it implements fix for Redis connection:

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