Hosting on CloudRun inside closed VPC :) The session “{id}” is not registered

Hello,
I know that CloudRun is not fully supported but i am trying to see if i can make it work. So far everything seems to be ok except that workflows fail with the error message:
The session “{id}” is not registered.
Doing some research i found that it’s due to the websocket connection.

  1. I host it on gcp cloudrun. The storage is a bucket and set as volume in CR - it’s ok.
  2. i am inside a VPC, so i do not use the CloudRun URL, instead i have an internal LoadBalancer with internal DNS created and SSL cert. I do not have a http redirect or http loadbalancer, only https.
  3. All traffic from this VPC towards public internet is open for at least ports 80 and 443 so my n8n can reach any resource on the internet on these ports.

In CloudRUN if i check : Route only requests to private IPs to the VPC instead of
Route all traffic to the VPC - it’s ok.
With Route all traffic to the VPC i get The session “{id}” is not registered.

My question would be, the websocket connection can be opened from my n8n server, receiving a response should be possible while the n8n has opened the connection, even if i route all traffic through the vpc, or i am wrong ?
Legacy FTP works, as long as i open the communication, i can receive some information back, unless my network knowledge is wrong.

I am trying to find a solution, because even if moving on kubernetes or VM, i would encounter the same issue, unless i configure a reverse proxy but i think there’s another solution i am missing.

N8N_PROTOCOL: https
N8N_EDITOR_BASE_URL and WEBHOOK_URL are my internal DNS.

in dockerfile:
ENV PORT=5678
ENV N8N_LISTEN_ADDRESS=0.0.0.0

Information on your n8n setup

  • **n8n version: 1.83.2
  • **Database (default: SQLite): Posgresql with a vpc network peering. Connection is ok
  • **n8n EXECUTIONS_PROCESS setting (default: own, main): i do not have this set so i assume it uses the default main
  • **Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • **Operating system:CloudRun

I have a similar problem to yours, but with a different cloud provider (OVH).
After some research, I added the following configuration to my docker-compose file:

  - N8N_PUSH_BACKEND=sse
  - N8N_EXPRESS_TRUST_PROXY=true
  - N8N_PROXY_HOPS=1

maybe this works for you

1 Like

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