New local install rest api error

Brand new install of version 1.3.1 and when I fire up n8n the UI works fine but the api backend is throwing an error so nothing is working correctly. Error I am getting is:

1|n8n | RangeError: Invalid status code: 1008
1|n8n | at new NodeError (node:internal/errors:405:5)
1|n8n | at ServerResponse.writeHead (node:_http_server:347:11)
1|n8n | at ServerResponse.writeHead (/usr/local/lib/node_modules/n8n/node_modules/on-headers/index.js:44:26)
1|n8n | at ServerResponse._implicitHeader (node:_http_server:338:8)
1|n8n | at ServerResponse.end (/usr/local/lib/node_modules/n8n/node_modules/compression/index.js:103:14)
1|n8n | at ServerResponse.send (/usr/local/lib/node_modules/n8n/node_modules/express/lib/response.js:232:10)
1|n8n | at pushValidationMiddleware (/usr/local/lib/node_modules/n8n/src/push/index.ts:91:22)

I can’t find anything for this one online.

That error message is pointing at a line for an Unauthorized error to the push updates for the UI. Figured out it is because of the websocket setup with Nginx.



I am getting the same error, could you share your nginx config? I upgraded to 1.x from a working install and suddenly started getting this.

Hey @spomata,

Welcome to the community :raised_hands:

There are posts with an example nginx configuration in them like the example below, You will need to tweak your configuration to look somewhat similar.

server {
  listen 443 ssl;
  server_name n8n.my_domain.tld;
  location / {
    proxy_set_header Connection 'upgrade';
    proxy_set_header Upgrade $http_upgrade;
    proxy_http_version 1.1;
  ssl_certificate # removed
  ssl_certificate_key # removed

Hi Jon,

thanks for the snippet. I indeed have set the “upgrade” headers options in my nginx yet I still get the same error as OP and had to revert to sse push backend option in the docker compose file.
Any idea on how to further debug and pinpoint the issue?


Whoops, my bad. I am maintaining both http and https proxying configurations (some IoT sensor with no https stack) and only updated one of the two.
Sorry for the false alarm.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.