Yes, this would be the expected error when n8n crashes (and restarts) but your web server/reverse proxy in front of it is still running (and just can’t talk to n8n).
I can send you the node in question with my ID if you want to test it on your side
Okay, so here’s my findings from manually running the below workflow (simply downloading a generic 100MB test file):
Using no additional environment variables (running n8n via docker run -it --rm -m 1g -p 5678:5678 n8nio/n8n:0.181.2) my 0.181.2 instance crashes with the below out of memory error:
Initializing n8n process
UserSettings were generated and saved to: /home/node/.n8n/config
Migrations in progress, please do NOT stop the process.
query is slow: CREATE INDEX IF NOT EXISTS "IDX_07fde106c0b471d8cc80a64fc8" ON "credentials_entity" ("type")
execution time: 4402
n8n ready on 0.0.0.0, port 5678
Version: 0.181.2
Migrations finished.
Editor is now accessible via:
http://localhost:5678/
Press "o" to open in Browser.
User survey updated successfully
<--- Last few GCs --->
[7:0x7fcbafbb9330] 97948 ms: Scavenge 395.9 (416.8) -> 395.7 (420.8) MB, 5.7 / 0.0 ms (average mu = 0.971, current mu = 0.549) allocation failure
[7:0x7fcbafbb9330] 98687 ms: Mark-sweep 531.3 (554.2) -> 531.2 (556.4) MB, 61.4 / 0.1 ms (+ 20.6 ms in 274 steps since start of marking, biggest step 0.5 ms, walltime since start of marking 907 ms) (average mu = 0.962, current mu = 0.946) finalize inc
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
UI error is “Connection lost”:
Testing the same with N8N_DEFAULT_BINARY_DATA_MODE=filesystem (docker run command docker run -it --rm -m 1g -e N8N_DEFAULT_BINARY_DATA_MODE=filesystem -p 5678:5678 n8nio/n8n:0.181.2) works fine (with memory consumption peaking around ~400 MB):
So I’d say it’s very much worth giving N8N_DEFAULT_BINARY_DATA_MODE=filesystem a shot on your side. You can monitor the memory consumption while running your workflows using the docker stats command.
Perfect it works well, I’ll come back to you when I have tested all the workflow to see if it works well. Thanks again for taking the time to answer me. ![]()
Writing the file to disk will most likely fail because you haven’t mounted the volume. Docker containers will not be able to write to the disk straight away. Instead you would need to specifically mount a path from your actual file system into your docker container.
You most likely have already set up something in the volumes: section of your docker compose file. The basic syntax would be something like this:
volumes:
- C:\Users\Tom\n8n\n8n_data:/home/node/.n8n
- C:\Users\Tom\Desktop:/home/node/Desktop
Here my C:\Users\Tom\n8n\n8n_data is made available inside the container as /home/node/.n8n. C:\Users\Tom\Desktop is made available to n8n as /home/node/Desktop.
So if you want to write to an existing /files directory, you could do something like - /files:/files. Again you’d need to re-create your container afterwards.
This is very odd and I have not seen this before (but I have also not seen n8n simply restarting without any error like you have).
Would you be able to confirm a few additional details helping me understand the problem?
- What are the other containers (besides root_n8n_1 and root_traefik_1) you have currently running? I wonder if they might eat up some of your resources, adding to the problem.
- Which host operating system and version do you have in use?
- Which versions of docker and docker compose versions are you running?
- Does the problem still persist with the latest n8n version 0.186.0?
root@n8ncool:~# docker-compose down
Stopping root_n8n_1 ... done
WARNING: Found orphan containers (root_traefik_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Removing root_n8n_1 ... done
Removing network root_default
ERROR: error while removing network: network root_default id 5ea399578419cd994a7c8f7c13293d8f8e0ab579aac6635263d306584fc7eb78 has active endpoints
root@n8ncool:~# docker-compose up --detach
WARNING: Found orphan containers (root_traefik_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating root_n8n_1 ... done
root@n8ncool:~# docker-compose pull
Pulling n8n ... done
root@n8ncool:~# docker-compose down
Stopping root_n8n_1 ... done
WARNING: Found orphan containers (root_traefik_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Removing root_n8n_1 ... done
Removing network root_default
ERROR: error while removing network: network root_default id 5ea399578419cd994a7c8f7c13293d8f8e0ab579aac6635263d306584fc7eb78 has active endpoints
root@n8ncool:~# docker-compose up -d
WARNING: Found orphan containers (root_traefik_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Creating root_n8n_1 ... done
root@n8ncool:~#
n8n:
image: n8nio/n8n
restart: always
ports:
- "127.0.0.1:5678:5678"
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=web,websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
- traefik.http.middlewares.n8n.headers.SSLRedirect=true
- traefik.http.middlewares.n8n.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n.headers.forceSTSHeader=true
- traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n.headers.STSPreload=true
environment:
- N8N_DEFAULT_BINARY_DATA_MODE=filesystem
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- N8N_PLAYLOAD_SIZE_MAX=1024
volumes:
- ${DATA_FOLDER}/.n8n:/home/node/.n8n
- /local-files:/files
Oh, so that error looks like you have made quite a few changes since you set up your project. Are you no longer using traefik?
If so you could try the approach suggested in the error message and run docker-compose down --remove-orphans
I can no longer access my n8n
So it seems you were using traefik then which would typically listen on port 80 & 443 (unless you have replaced it with another solution). You might want to restore the traefik section of your docker compose file then: Docker Compose - n8n Documentation (and then run docker compose up again).
Unfortunately this does not show me n8n
version: '3'
services:
traefik:
image: "traefik"
restart: always
command:
- "--api=true"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
- "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
- "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- ${DATA_FOLDER}/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
n8n:
image: n8nio/n8n
restart: always
ports:
- "127.0.0.1:5678:5678"
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=web,websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
env
# Folder where data should be saved
DATA_FOLDER=/root/n8n/
# The top level domain to serve from
DOMAIN_NAME=n8nautomatic.com
# The subdomain to serve from
SUBDOMAIN=n8n
# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from
# above example would result in: https://n8n.example.com
# The user name to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_USER=user
# The password to use for authentication - IMPORTANT ALWAYS CHANGE!
N8N_BASIC_AUTH_PASSWORD=admin
# Optional timezone to set which gets used by Cron-Node by default
# If not set New York time will be used
GENERIC_TIMEZONE=Europe/Berlin
# The email address to use for the SSL certificate creation
SSL_EMAIL=ssl@n8nautomatic.com
A yes it took time
![]()









