N8n container is crashing

Describe the problem/error/question

n8n container is crashing and either restarts after few minutes or gives Bad Gateway error and requires a backup restore to starts working again.

I am guessing that some workflow causes a crash, but I can’t figure out which one.

What is the error message (if any)?

Bad Gateway
Docker logs: FATTAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.227.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker compose (hetzner)
  • Operating system:

Hey @Nejc_Lukacek,

That error would suggest a memory limit issue, It would be worth turning disabling all of your workflows and enabling them one at a time to work out which one is causing the issue.

That error should not require a restore to bring it back online again unless maybe the disk space is full.

1 Like

Hi @Nejc_Lukacek, specifically with regards to “JavaScript heap out of memory” you might want to consider setting the --max-old-space-size=SIZE option. I’ve described this a while back over here, the page also has some additional suggestions on dealing with memory limitations.

1 Like

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