N8n websocket error

hi, I have a RSV1, RSV2, RSV3 error on my server with n8n in docker.
here is what I did step by step.

  1. uninstalled podman and installed docker,
  2. installed docker compose,
  3. created n8n.[mydomain].com DNS (A) on cloudflare,
  4. created a website with SSL on cyberpanel.
  5. created in /opt/n8n/docker-compose.yml in which defined 127.0.0.1:5678 and n8n.domain.com, data dir: ./n8n_data
  6. granted node user to access n8n_data
  7. defined reverse proxy in the vHost file on the cyberpanel->web sites->n8n.domain.com
  8. n8n interface works but when I test to execute a workflow I got the errors:
  • “Problem running workflow Lost connection to the server” on the n8n interface
index-B0Bli0Hg.js:205680 WebSocket connection to 'wss://n8n.[domain].com/rest/push?pushRef=ntsgobbplt' failed: 
connect	@	index-B0Bli0Hg.js:205680
(anonymous)	@	index-B0Bli0Hg.js:205622

index-B0Bli0Hg.js:205664 [WebSocketClient] Connection error: 
Event {isTrusted: true, type: 'error', target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}
onError	@	index-B0Bli0Hg.js:205664

in browser the console.

  n8n-1  | Invalid WebSocket frame: RSV1 must be clear

n8n-1  | Invalid WebSocket frame: RSV2 and RSV3 must be clear

in the docker-compose logs -f command.

my vHost file is:

docRoot $VH_ROOT/public_html
vhDomain $VH_NAME
vhAliases www.$VH_NAME
enableGzip 0
enableBr 0

vhssl { 
  keyFile                 /etc/letsencrypt/live/n8n.[domain].com/privkey.pem
  certFile                /etc/letsencrypt/live/n8n.[domain].com/fullchain.pem
  certChain               1
  enableSpdy              0
  enableStapling          1
  sslSessionCache         1
}

rewrite  {
  enable 0
  autoLoadHtaccess 0
}

extprocessor n8n-proxy {
  type proxy
  address http://127.0.0.1:5678
  maxConns 100
  initTimeout             60
  retryTimeout            0
  respBuffer              0
}

context /rest/push {
  type proxy
  handler n8n-proxy
  enableDataCheck 0
  renegRespHeader 1
  addDefaultCharset off
  rewriteProxyHeaders 1
}

context / {
  type proxy
  handler n8n-proxy
  addDefaultCharset off
  enableExpires 0
  allowBrowse 1
  rewriteProxyHeaders 1
}

this is rewrite rules:

RewriteEngine On
# HTTP -> HTTPS 
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


RewriteRule ^(.*)$ http://n8nproxy/$1 [P]

I, chatgpt, and gemini are working on last 4-5 days. I don’t know about them but I am about to get crazy.
Could anyone help about the problem?

did you manage to resolve the problem? it’s been 3 days with Gemini and Claude. and i can’t find help

AI tools got into a loop. They make me do same steps again and again :smile: