Connection lost

Yes the source maps are for sure not the problem

Will look into releasing a docker image which outputs debugging information.

Ok sadly do not really know what to log exactly. What it now outputs is some basic information about every request n8n receives and some info-messages when it is a push-connection-request (this are the ones that do not work).

The images is: n8nio/n8n:0.68.2-push-debug

I hope like that we can at least see if the requests reach n8n or not.

image goes into restart loop:

/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found
ln: /home/node/.n8n: File exists
/bin/sh: n8n: not found

It is a custom build image so it is slightly different than the n8n default which uses npm modules. If you start it normally locally for debugging purpose it works totally fine like any other n8n image:

docker run -it --rm -p 5678:5678 n8nio/n8n:0.68.2-push-debug
# or
docker run -it --rm -p 5678:5678 n8nio/n8n:0.68.2-push-debug n8n start --tunnel

If you need something special, exactly like in our earlier conversation, you have to adjust it exactly the same way:

You can also do that:

docker run -it --rm -p 5678:5678 n8nio/n8n:0.68.2-push-debug /bin/sh -c "sleep 5; ./packages/cli/bin/n8n start"

Doesn’t work:

/bin/sh: ./packages/cli/bin/n8n: not found
ln: /home/node/.n8n: File exists

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

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?

1 Like

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.