RangeError: Invalid status code: 1008 after upgarding from 0.236.3 to 1.4.1

Describe the problem/error/question

We have an n8n installation on a k8s cluster and we are upgrading from 0.236.3 to 1.4.1, db migrations have been successful, all component are running (main, worker, webhook). But the main pod keep throwing :

RangeError: Invalid status code: 1008
    at new NodeError (node:internal/errors:399:5)
    at ServerResponse.writeHead (node:_http_server:344:11)
    at ServerResponse.writeHead (/usr/local/lib/node_modules/n8n/node_modules/on-headers/index.js:44:26)
    at ServerResponse._implicitHeader (node:_http_server:335:8)
    at ServerResponse.end (/usr/local/lib/node_modules/n8n/node_modules/compression/index.js:103:14)
    at ServerResponse.send (/usr/local/lib/node_modules/n8n/node_modules/express/lib/response.js:232:10)
    at Push.handleRequest (/usr/local/lib/node_modules/n8n/dist/push/index.js:37:30)
    at /usr/local/lib/node_modules/n8n/dist/push/index.js:101:68
    at newFn (/usr/local/lib/node_modules/n8n/node_modules/express-async-errors/index.js:16:20)
    at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)

Information on your n8n setup

  • n8n version: 1.4.1
  • Database (default: SQLite): PostgreSQL 11 (managed by cloud provider)
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): k8s installation
  • Operating system: K8S

Information found

Two post already talk about this issue when installing 1.X.X
One is about websocket nginx config
The other about docker root user permissions

I’m trying to look down the websocket idea on my k8s ingress but nothing successful so far.

Can someone help me to understand where this error come from and how to fix it on a k8s installation ?
Thanks

Do you have this behind a proxy like nginx? That error is because you are getting a prohibited response.

1 Like

I’m also with the same problem and yes I’m using nginx as reverse proxy. How to solve it?

If you have nginx make sure you are getting through on your websocket requests.On my nginx when I upgraded I had to change

proxy_set_header Connection ‘’;

to
proxy_set_header Connection ‘upgrade’;
proxy_set_header Upgrade $http_upgrade;
I also added an upstream

upstream n8n
{
server 127.0.0.1:5678;
keepalive: 64;
}

Also, on my test environment I’m using docker I didn’t have nginx in the mix but for the upgrade I had to switch the user in my dockerfile to root and in docker-compose.yaml I had to switch the user to node.

1 Like