My n8n is lost connection, please check why
Anonymous
HOBBYOP

a month ago

https://primary-production-b6b3.up.railway.app/

this is the link

please check why its not working, it says

You have a connection issue or the server is down.
n8n should reconnect automatically once the issue is resolved.

$10 Bounty

2 Replies

Railway
BOT

a month ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


brody
EMPLOYEE

a month ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody about 1 month ago


ricasco
HOBBY

a month ago

After a manual redeploy, my public URLs were not set explicitly. n8n was running behind Railway’s proxy (public HTTPS on 443, app listening on 5678), but the editor/push service was computing the wrong expected origin. That made the push channel (WS/SSE) fail and the UI showed Connection lost. This is a known behavior with recent n8n versions that enforce strict origin checks behind proxies/CDNs.

What fixed it: set the actual public URL and proxy hints explicitly (no placeholders), then redeploy Primary and Worker:

N8N_EDITOR_BASE_URL=https://.up.railway.app
WEBHOOK_URL=https://.up.railway.app
N8N_HOST=.up.railway.app
N8N_PROTOCOL=https
N8N_PROXY_HOPS=1
PORT=5678 (don’t force N8N_PORT=443)

After this, opening workflows worked normally (no more Connection lost). The reasoning matches the docs for reverse proxy webhook/editor URLs and proxy hops.

Optional stability tweaks: if your environment filters WebSockets, set the push backend explicitly and redeploy: N8N_PUSH_BACKEND=sse (or websocket if SSE is the problem). Recent versions default to WS; choosing SSE/WS manually often resolves editor connectivity in proxied setups. Keep N8N_SECURE_COOKIE=true on HTTPS; if debugging odd session behavior through a proxy chain, you can temporarily toggle it to isolate cookie issues, then turn it back on.

How I got back in (if you’re locked out): first make a quick backup from the CLI:

n8n export:workflow --all --output=/tmp/workflows.json
n8n export:credentials --all --output=/tmp/credentials.json

Then reset User Management (this does not delete workflows; it only removes user accounts so you can run the setup again):

n8n user-management:reset

Redeploy, create a new owner account, and all workflows remain intact.

Why this happens behind proxies: n8n builds public URLs from N8N_PROTOCOL/HOST/PORT, which don’t match reality when the app listens on 5678 internally but is exposed as HTTPS 443 via a proxy. The fix is to manually set the public URLs (WEBHOOK_URL, N8N_EDITOR_BASE_URL) and declare proxy hops so the editor and push endpoints validate the correct Origin.

----

if this answer was helpful, please mark it as the solution, thanks


Loading...