Connection lost

For me it works perfectly fine for me if I try with this most basic compose file:

version: '3.1'

services:
  n8n:
    image: n8nio/n8n:0.68.2-push-debug
    ports:
      - 5678:5678
    command: /bin/sh -c "sleep 5; ./packages/cli/bin/n8n start"

This works for me:

n8n:
    image: n8nio/n8n:0.68.2
    // ...
    command: /bin/sh -c "sleep 5; n8n start"

Replacing just the image does not work and modifying the command as you proposed also does not work:

n8n:
  image: n8nio/n8n:0.68.2-push-debug
  // ...
  command: /bin/sh -c "sleep 5; ./packages/cli/bin/n8n start"

Can’t you just make an image that works the same way as all the normal images do? Not to introduce more possible issues (like this one).

Edit: Maybe someone else can validate the debug image?

Ah yes sure. If I could have made an image which would work 100% identical I would have. But that is not possible unless I want to publish the code to npm. For that reason did I not have choice and I have to generate it differently.

Hm, do not understand how it is possible that the exact same compose file (the one I posted above) which uses the exact same docker image can work for me but not for you. Are you really testing with exactly the same one?

Maybe the volumes dont fit anymore?
image

Is there a way to circumvent the error, like forcing the connection if I’m positive that the server is in fact connected?

I have this error too.
The active Workflows are still running, but I can’t create a new one or activate a workflow.

I tried rebooting the server and update n8n, but its still the same.

Ubuntu 18.04
n8n 0.67.3

Just noticed that there’s a query that never resolves:

curl 'https://n8n.domain.com/rest/push?sessionId=12341234' \
  -H 'authority: n8n.domain.com' \
  -H 'authorization: Basic 12341234==' \
  -H 'accept: text/event-stream' \
  -H 'cache-control: no-cache' \
  -H 'dnt: 1' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' \
  -H 'sec-fetch-site: same-origin' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: https://n8n.domain.com/workflow/8' \
  -H 'accept-language: en-US,en;q=0.9,fr;q=0.8,es;q=0.7,de;q=0.6' \
  -H 'cookie: __cfduid=12341234; _ga=12341234; _gid=12341234' \
  --compressed

It’s stuck in pending

The problem is that you are overwriting the /data folder which contains the whole n8n code and errors for that reason.

Yes that would be exactly the endpoint which would make problems as it is responsible for the push-connection. So the question is why is it stuck in pending. Like what is blocking it and is it something in front of n8n or not.
The debug image I did release will display all the requests n8n receives and also prints a debug message when that push-endpoint gets reached specifically.

The problem is that it is not actually connected that is why it displays that error message. n8n uses different connects. In your case are all the regular REST-requests working that is why you can see and open workflows. What is however not connected is the push-connection which is responsible to push the execution information from n8n to your browser.

Anybody got some useful information out with the debugging information why it does not connect anymore?

This is the information that get displayed after starting and opening.

Debug Info

{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
‘upgrade-insecure-requests’: ‘1’
},
method: ‘GET’,
url: ‘/’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘text/css,/;q=0.1’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/
},
method: ‘GET’,
url: ‘/css/app.828983e5.css’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘/’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/
},
method: ‘GET’,
url: ‘/js/chunk-vendors.d42a4e38.js’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘text/css,/;q=0.1’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/
},
method: ‘GET’,
url: ‘/css/chunk-vendors.67f38bab.css’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘/’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/
},
method: ‘GET’,
url: ‘/js/app.fa730b07.js’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘text/css,/;q=0.1’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/
},
method: ‘GET’,
url: ‘/fonts.css’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘identity’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/fonts.css
},
method: ‘GET’,
url: ‘/font/OpenSans-Light.woff2’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘image/webp,/’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/n8n-icon-small.png’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘text/event-stream’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow’,
pragma: ‘no-cache’,
‘cache-control’: ‘no-cache’
},
method: ‘GET’,
url: ‘/rest/push?sessionId=8std2vtatr8’,
query: { sessionId: ‘8std2vtatr8’ }
}
*** Is Push-Connect-Request
*** Push-Connection gets added

Push.add 1
Push.add 3
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘identity’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/fonts.css
},
method: ‘GET’,
url: ‘/font/OpenSans-Regular.woff2’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘identity’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/fonts.css
},
method: ‘GET’,
url: ‘/font/OpenSans-Bold.woff2’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘identity’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/css/app.828983e5.css
},
method: ‘GET’,
url: ‘/fonts/element-icons.535877f5.woff’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/font-woff2;q=1.0,application/font-woff;q=0.9,/;q=0.8’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘identity’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/fonts.css
},
method: ‘GET’,
url: ‘/font/OpenSans-SemiBold.woff2’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/json, text/plain, /’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
sessionid: ‘8std2vtatr8’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/rest/credentials’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/json, text/plain, /’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
sessionid: ‘8std2vtatr8’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/rest/credential-types’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/json, text/plain, /’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
sessionid: ‘8std2vtatr8’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/rest/node-types’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/json, text/plain, /’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
sessionid: ‘8std2vtatr8’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/rest/active’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘application/json, text/plain, /’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
sessionid: ‘8std2vtatr8’,
connection: ‘keep-alive’,
referer: ‘http://159.69.16.169:5678/workflow
},
method: ‘GET’,
url: ‘/rest/settings’,
query: {}
}
{
headers: {
host: ‘159.69.16.169:5678’,
‘user-agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:77.0) Gecko/20100101 Firefox/77.0’,
accept: ‘image/webp,/’,
‘accept-language’: ‘de,en-US;q=0.7,en;q=0.3’,
‘accept-encoding’: ‘gzip, deflate’,
connection: ‘keep-alive’
},
method: ‘GET’,
url: ‘/favicon.ico’,
query: {}
}

Very interesting @TimoG! So after all of that you get the “Connection lost”? Because according to the messages does it actually connect and stays connected (at least unless the >> Push.disconnect message happened later).

Yes, i still get “connection lost” in the web interface and cant add any workflow.

Ok I added some more log messages this time also in the frontend (so output will be in browser console). You can simply pull it again. Can you please check what it displays there.

Okey i found something interesting.
On make there is the message “Connection lost” above. On Windows and Android is there a active button, that cannot be pushed to activate it.
If i press that slider button it gives me a error message.
But i can save my workflow in both OS. I dont know if that worked before.

Bildschirmfoto 2020-06-12 um 08.26.25

In the browser console, i have now this error message:

Ye,s it is only possible to active workflows that have a trigger node. So any of the nodes which you can find under “Trigger”. If a workflow does not contain any of those nodes activating it is not possible because literally nothing can get activated. If a workflow gets activated it means that the webhook-URLs get made available and that the trigger-Function of Trigger Nodes does get executed which starts the cron timers in the Cron-Node, connects to the IMAP server in case of the “EMail Read IMAP” Node and so on.

I did access your n8n instance under the IP in the image (please make sure that you add user & password to it because right now everybody can literally use n8n on your server and so theoretically hack your server very very easily). For me, it displays totally correctly “Active: …” in the top right corner and also for a coworker of mine which is using MacOS.

1 Like

Oh thats true. I can activate it in windows.
I found a solution for that error too. Its my firefox security. If i deactivate it for my site i get the activate button. And the block is, because i connect with my ip without ssl.
But there is another problem, how can i connect it to a domain? That server setup guide dont help me out. I dont really understand it.
And is there not a possible way to connect it to a domain without installing it?

Ah, that is great to hear. Maybe that could also be the reason why other people have the connection problem because they use an IP address instead of a proper domain and some browsers do block it. Thanks a lot!

No there is sadly no other proper way to do it. But the server setup guide got extra written in a way that almost everybody should be able to follow along without domain knowledge. What problem do you have? What do you have to understand what you do not?

The “not proper way” to solve that is using the built-in tunnel. That is however only meant for testing and I can not give any guarantee for security or stability. Also, should you then make sure to activate authentication, just in case that somebody else finds your tunnel-URL.

1 Like

I dont understand point 5 and 6.
Where i have to create a docker-compose.yml?
And where i have to create that .env file and with which name?