Describe the problem/error/question
I keep getting connection lost error everytime i try to run the workflow:
What is the error message (if any)?
Problem running workflow
Lost connection to the server
I keep getting connection lost error everytime i try to run the workflow:
Lost connection to the server
Hey @Kanak_Haswani,
Can you complete the template? I don’t know what version of n8n you are using, how it is deployed, what your worklfow looks like or anything else that we ask for. Having this information will point me in the direction of where the issue is so that we can get this resolved for you.
I seem to have the same issue.
The server is running on a VM behind an ANSTLE host.
This was working fine before I upgraded to 1.6.1.
Before upgrading, this workflow was working as expected. I was using MySQL (actually MariaDB) database and set up Postgres because it failed to upgrade. So, I installed Postgres, and re-imported my workflows and credentials.
Other than switching from MariaDB to Postgres, I haven’t changed anything in the server install.
Now, whenever I test the connection on the first node (in this case a Trello Trigger), I get the error, “Lost connection to the server”.
Here is a loom video demonstrating:
OK - in case this helps anyone else who finds this later. In my case, I needed to rename WEBHOOK_TUNNEL_URL to WEBHOOK_URL and set N8N_PUSH_BACKEND=sse
Hey @ColinMacLeod,
That error was likely to have been caused by your proxy not being configured for websockets, Changing to WEBHOOK_URL
was a good option but if you get a chance I would configure the reverse proxy to support websockets as we may drop the older sse
option in the future.
Hey @Jon Thanks for the reply.
I did try to get it working with Websockets but it didn’t seem to want to play ball.
This is my nginx config on the antsle host:
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name n8n.happybunnies.com;
ssl_certificate [PATH REDACTED]/cert.pem;
ssl_certificate_key [PATH REDACTED]/key.pem;
root /antlets/n8n/var/www;
location ~ ^/(?!(.well-known)) {
proxy_pass http://10.1.1.10:5000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection '';
#proxy_set_header Host #host;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
# note the inclusion of the protocol 'https'
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Origin *;
# add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
}
}
Hey @ColinMacLeod,
It looks like all you are missing is the upgrade
bit for your connection although for my setup I also removed some options that you have set to off
so it will be interesting to see if the below works.
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name n8n.happybunnies.com;
ssl_certificate [PATH REDACTED]/cert.pem;
ssl_certificate_key [PATH REDACTED]/key.pem;
root /antlets/n8n/var/www;
location ~ ^/(?!(.well-known)) {
proxy_pass http://10.1.1.10:5000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
#proxy_set_header Host #host;
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
# note the inclusion of the protocol 'https'
add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
add_header Access-Control-Allow-Credentials true;
add_header Access-Control-Allow-Origin *;
# add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
# add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
}
}
Hey @Jon, yes, I think you did it! With that change, it seems like it’s working with websocket.
Thank you so much for taking the time and care.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.