Every time I try to execute a workflow, I receive an error “Lost connection to the server”, and everything stops/halts. The “Execute Workflow” button continues “spinning”, but nothing else happens, and the stop button doesn’t seem to stop anything.
It was working fine originally, but then it just stopped working.
I’m not 100% sure, but it may have started after I created a second workflow, and tried to start building it.
I’ve tried bringing down the docker container, pulling new images, and re-starting.
I’ve tried restarting the server.
What is the error message (if any)?
“Problem running workflow: Lost connection to the server”
The “Lost connection to the server” error and the unresponsive UI are symptoms of the n8n process crashing, most likely due to an Out of Memory (OOM) event. When the n8n process is killed by the operating system or Docker for exceeding its memory limits, the WebSocket connection between your browser and the server is instantly severed. This causes the editor to hang in a “spinning” state because the backend it was communicating with no longer exists.
Your specific workflow points to the Code node as the primary culprit. The line JSON.parse(item.json.data) is particularly dangerous; if the incoming HTTP request contains a large payload, attempting to parse that entire string into a JavaScript object creates a massive, sudden spike in memory usage. This spike is likely what pushes your Docker container over its allocated limit and triggers the crash.
To resolve this, first confirm the crash by checking your Docker logs for “OOM Killed” messages. Next, optimize your workflow by removing the redundant JSON.parse call, as n8n typically handles JSON parsing automatically in the HTTP Request node. Finally, if your tasks inherently require processing large datasets, you should increase the memory limits assigned to your n8n Docker container in your docker-compose or runtime configuration.
I checked the docker logs and there seems to be some errors/warnings thrown, but I don’t see any Out of Memory (OOM) errors or OOM Killed messages.
The below is the output of the logs. The first line is just showing my docker ps output.
After that is the logs, and the logs repeat, (I didn’t copy the repeat)
funky@localhost:~/docker/n8n$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
588df7525b64 docker.n8n.io/n8nio/n8n "tini -- /docker-ent…" 9 hours ago Up 8 hours 127.0.0.1:5678->5678/tcp n8n-n8n-1
a9c91a1c2b85 traefik "/entrypoint.sh --ap…" 9 hours ago Up 8 hours 0.0.0.0:80->80/tcp, [::]:80->80/tcp, 0.0.0.0:443->443/tcp, [::]:443->443/tcp n8n-traefik-1
funky@localhost:~/docker/n8n$ docker logs n8n-n8n-1
Initializing n8n process
Failed to load Custom API options for the node "n8n-nodes-base.confluence": Unknown credential name "confluenceCloudOAuth2Api"
n8n ready on ::, port 5678
n8n Task Broker ready on 127.0.0.1, port 5679
Failed to start Python task runner in internal mode. because Python 3 is missing from this system. Launching a Python runner in internal mode is intended only for debugging and is not recommended for production. Users are encouraged to deploy in external mode. See: https://docs.n8n.io/hosting/configuration/task-runners/#setting-up-external-mode
There are deprecations related to your n8n setup. Please take the recommended actions to update your configuration:
- WEBHOOK_URL -> Use N8N_WEBHOOK_URL instead, which sets the base URL for both test and production webhooks.
- N8N_UNVERIFIED_PACKAGES_ENABLED -> The default for this variable will change to `false` in a future version. Set it to `true` explicitly to keep installing unverified community packages.
- N8N_RUNNERS_TASK_TIMEOUT -> The default for this variable will be reduced from 300 (5 minutes) to 60 (1 minute) in a future version. Set it explicitly to keep your current task timeout.
- N8N_COMPRESSION_NODE_MAX_DECOMPRESSED_SIZE_BYTES -> The default for this variable will be reduced from 2 GiB to 256 MiB in a future version. Set it explicitly to keep your current limit.
- N8N_COMPRESSION_NODE_MAX_ZIP_ENTRIES -> The default for this variable will be reduced from 5000 to 1000 in a future version. Set it explicitly to keep your current limit.
[license SDK] cert state: expiresAt=2026-08-31T18:44:05.209Z terminatesAt=2051-08-15T03:47:52.208Z issuedAt=2026-08-21T18:44:05.252Z msToExpiry=863867504 msToTermination=788346094503 isValid=true isRenewalDue=false detachedEntitlementsCount=0 entitlements=1 enabledFeatures=6
[license SDK] Skipping renewal on init: license cert is not due for renewal
Registered runner "JS Task Runner" (ufk2CcHyBsdLhz5NB6Gh4)
Instance registered
Discovered 4 cluster checks
Failed to load Custom API options for the node "n8n-nodes-base.confluence": Unknown credential name "confluenceCloudOAuth2Api"
Sandbox: enabled=false provider=n8n-sandbox (from env)
Failed to load Custom API options for the node "n8n-nodes-base.confluence": Unknown credential name "confluenceCloudOAuth2Api"
Version: 2.35.7
Building workflow dependency index...
Finished building workflow dependency index. Processed 0 draft workflows, 0 published workflows.
Start Active Workflows:
Activated workflow "Weather Forecast Email" (ID: nwHyxnI7Gtewjif2)
Editor is now accessible via:
https://[redacted]
(node:7) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/ for more information.
at Object.xForwardedForHeader (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:371:13)
at Object.wrappedValidations.<computed> [as xForwardedForHeader] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:685:22)
at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:788:20)
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:849:32
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:830:5 {
code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR',
help: 'https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/'
}
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/ for more information.
at Object.xForwardedForHeader (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:371:13)
at Object.wrappedValidations.<computed> [as xForwardedForHeader] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:685:22)
at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:788:20)
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:849:32
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:830:5 {
code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR',
help: 'https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/'
}
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/ for more information.
at Object.xForwardedForHeader (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:371:13)
at Object.wrappedValidations.<computed> [as xForwardedForHeader] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:685:22)
at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:788:20)
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:849:32
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:830:5 {
code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR',
help: 'https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/'
}
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/ for more information.
at Object.xForwardedForHeader (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:371:13)
at Object.wrappedValidations.<computed> [as xForwardedForHeader] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:685:22)
at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:788:20)
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:849:32
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:830:5 {
code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR',
help: 'https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/'
}
[license SDK] cert state: expiresAt=2026-08-31T19:04:07.548Z terminatesAt=2051-08-15T03:47:52.208Z issuedAt=2026-08-21T19:04:07.583Z msToExpiry=863999783 msToTermination=788345024443 isValid=true isRenewalDue=false detachedEntitlementsCount=0 entitlements=1 enabledFeatures=6
[license SDK] license successfully renewed (cause=request, expiresAt: 2026-08-31T18:44:05.209Z -> 2026-08-31T19:04:07.548Z, entitlements: 1 -> 1)
[license SDK] cert state: expiresAt=2026-08-31T19:19:15.401Z terminatesAt=2051-08-15T03:47:52.208Z issuedAt=2026-08-21T19:19:15.463Z msToExpiry=863999727 msToTermination=788344116534 isValid=true isRenewalDue=false detachedEntitlementsCount=0 entitlements=1 enabledFeatures=6
[license SDK] license successfully renewed (cause=request, expiresAt: 2026-08-31T19:04:07.548Z -> 2026-08-31T19:19:15.401Z, entitlements: 1 -> 1)
Received SIGTERM. Shutting down...
Deregistered all crons
[runner:js] Received SIGTERM signal, shutting down...
[runner:js] Task runner stopped
Stopping n8n...
I’ll see what I can do about the memory limits.
It’s not too large of a data set, just weather forecast. But I will say, item.json comes in as an object, but all it has is data and the actual payload is a large string (in json format, but stringified), so I need json.parse to parse item.json.data.
@funkywaddle Are you using a reverse proxy to access n8n or are you connecting to localhost?
The most common reason for lost connection on self hosted instances is reverse proxies not being configured correctly typically when nginx or Apache is being used.
@Jon Yes, I am using a reverse proxy with Nginx.
It’s a little of a convoluted setup, but on the server box itself, I’m using Nginx to open it up on port 8042, then I use npm (Nginx Proxy Manager) on another server to handle the Let’s Encrypt cert and redirecting port 80 on it’s box to port 8042 on the box n8n is running on. I have several domains and subdomains, and I run them all through npm. It’s easier that way, for the LE cert management, and an all-in-one place for management.
It’s a good thought, but I don’t think it’s an issue with the proxy server setup. If it was, why would it work to begin with (when I first created the first workflow), and then act up afterwards?
@kjooleng I just added that setting to my composer.yml file, did a down, a pull, then a up.
Still getting the same error. It’s still showing several instances of the error:
ValidationError: The 'X-Forwarded-For' header is set but the Express 'trust proxy' setting is false (default). This could indicate a misconfiguration which would prevent express-rate-limit from accurately identifying users. See https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/ for more information.
at Object.xForwardedForHeader (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:371:13)
at Object.wrappedValidations.<computed> [as xForwardedForHeader] (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:685:22)
at Object.keyGenerator (/usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:788:20)
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:849:32
at /usr/local/lib/node_modules/n8n/node_modules/.pnpm/express-rate-limit@8.2.2_express@5.1.0/node_modules/express-rate-limit/dist/index.cjs:830:5 {
code: 'ERR_ERL_UNEXPECTED_X_FORWARDED_FOR',
help: 'https://express-rate-limit.github.io/ERR_ERL_UNEXPECTED_X_FORWARDED_FOR/'
}
Hi @funkywaddle Welcome!
Your nginx block has no websocket upgrade, so the editor’s push connection at /rest/push never gets through. nginx proxies upstream over HTTP/1.0 by default and drops the hop-by-hop headers, and n8n’s push backend is websocket unless you change it. Add these inside location /, alongside the headers you already have:
The Nginx Proxy Manager host in front of it needs Websockets Support enabled as well, or the upgrade dies at that hop instead.
For the X-Forwarded-For line still in your logs, the documented variable is N8N_PROXY_HOPS and it takes the number of proxies rather than a boolean, so 2 for your chain.