Self-hosted N8N - Task runner connection attempt failed with status code 403

Describe the problem/error/question

I have N8N successfully running on a GCP instance and getting the following in logs:
Task runner connection attempt failed with status code 403

What is the error message (if any)?

n8n | Initializing n8n process
n8n | n8n ready on 0.0.0.0, port 5678
n8n | n8n Task Broker ready on 127.0.0.1, port 5679
n8n | Version: 1.86.1
n8n |
n8n | Editor is now accessible via:
n8n | https://n8n-demo.a2dev.space
n8n | Task runner connection attempt failed with status code 403

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): GCP Cloud Compute
  • Operating system: e2-micro (2 vCPUs, 1 GB memory)

Hi, what customization did you do? (ENV variables). It looks like you are running behind a reverse proxy/load balancer?

Reg,
J

That’s correct, I am using NGINX.

Here is my ENV file:
N8N_HOST=n8n-demo…com
N8N_PROTOCOL=https
N8N_TUNNEL_SUBDOMAIN=n8n-demo
N8N_PROXY_HOPS=1
WEBHOOK_URL=https://n8n-demo…com/
EXECUTIONS_MODE=regular
OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=false
N8N_SECURE_COOKIE=true
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_RUNNERS_ENABLED=true
GENERIC_TIMEZONE=Africa/Johannesburg

Hi, not sure to be honest. Have not used it yet From the docs task runner should be able to create a websocket connection to port 5679

Can you confirm it’s allowed?

Reg,
J.

It indicates “N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0”, with Docker Compose, it needs to be updated to be able to accept external connections.

I am simply trying to run internal task runners - which should be accessible via localhost by default according to the documentation. I only get the error when “N8N_RUNNERS_ENABLED=true” which I was prompted to add due to a deprecation notice.

Hi,

N8N_RUNNERS_BROKER_LISTEN_ADDRESS=0.0.0.0 means to listen on all available interfaces. For the rest yes, I agree it’s weird you get 403 for local connecriosn

Reg,
J.

It seems that the issue occurs when using the “sqlite” database type with task runners. When switching to the “postgresdb” database type, the error disappears, and the task runner is registered successfully.

P.S. Help me with setup yml for using RUNNERS - #2 by Miquel_Colomer

I use postgresdb and get this same error. running on version 1.100.1

@Lowe_Mbonda which mode are you running n8n?

running n8n on GKE, using postgreSQL 15.

My ENV
N8N_PROTOCOL=https
N8N_HOST=n8n.domain.dev
N8N_EDITOR_BASE_URL=https://n8n.domain.dev
DB_TYPE=postgresdb
GENERIC_TIMEZONE=Europe/Berlin
TZ=Europe/Berlin
N8N_PROXY_HOPS=1
DB_POSTGRESDB_POOL_SIZE=4
QUEUE_BULL_REDIS_DB=8
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
WEBHOOK_URL=https://n8n.domain.dev
N8N_RUNNERS_ENABLED=true
N8N_SECURE_COOKIE=true

Same over here, just as @Lowe_Mbonda. Running 1.100.1 with PostreSQL 17.5, behind Caddy.

N8N_PROTOCOL=https
DB_TYPE=postgresdb
N8N_PROXY_HOPS=1
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
N8N_RUNNERS_ENABLED=true
N8N_SECURE_COOKIE=true