I did the setup guide. But we created a dns record before that. So we have one thats active.
But its does not work with the dns record. And thats not the problem. The dns records works fine, but i cant start it.
My docker-compose file is the same as in the guide and my n8n.env looks like this:
But i saw, that the docker-compose version is sadly not compatible with apache on the same server.
But it starts if i stop the apache2 service, but i cant open the interface with the domain. I dont get a secure connection.
Now i installed it on a new server without apache but it says now 4 warnings that variables of the .evn file are not set but they are in the n8n.env.
And the logs dont helping me in any way. It says that the file /home/node/.n8n exists but its definitly not. The folder node dont exists too.
Ah great to hear that you did figure it out. Because I read your answer and was confused why it would not work. Did somehow think you only wrote n8n.env to describe it and not that you actually named it that way. Sorry should have really caught that and then asked.
I am running into the same issue. I am running n8n dockerized. Using a docker-compose.yml file similar to the one in the setup guide, slightly modified to use the env file directly:
n8n:
image: n8nio/n8n:0.68.2-push-debug
env_file: n8n.env
container_name: n8n
restart: always
ports:
- 5678:5678
volumes:
- ~/.n8n:/root/.n8n
- /var/run/docker.sock:/var/run/docker.sock
# Wait 5 seconds to start n8n to make sure that PostgreSQL is ready
# when n8n tries to connect to it
command: /bin/sh -c "sleep 5; ./packages/cli/bin/n8n start"
As you can see above, I tried the debugging version mentioned in the thread.
I, however, have nginx instead of traefik (I have other services already running behind nginx)
I can see:
The n8n service actually picks up all the .env variables correctly.
From the debug logs, I can see push requests reaching n8n:
I got the same error this morning and I knew what the issue was. I connected to my company’s network using their proxy servers. Once I did, n8n workflow page said “connection lost” and when I disconnected from the proxy and directly connected to the internet, the error was gone. So, I guess it’s got something to do with the security that’s set by my company. People facing the same issues may test the same in a different PC/network etc to check if that solves the issue.
came here to leave a hint for everybody fighting with this problem.
From what I found, the issue is related to the compression. eg. If I remove the Accept-Encoding header from a curl request to /rest/push I get a quite prompt :ok response.
So for my case I’m running n8n in Kubernetes behind Traefik Proxy.
What I had to do was to edit the traefik configmap and disable the compression for both entry points:
Hi!
I have the same problem.
For me, it looks like a nginx config problem (set as a reverse proxy).
I tried to disable buffering and enabled chunked encoding like the documentation showed but nothing works.
I observe one of the following behavior:
the push request returns to the browser correctly and a connection error is reported
the push request does not return, no connection error is reported but responses from execution of flows are not returned either (the ui is blocked in “Executing workflows”)
If I may, I’d like to suggest an alternative way of polling data from the server:
From what I saw, a lot of proxies/web servers have issues with chunked data and require fine tuning.
It could be more robust to to do this long polling with multiple requests:
send the “push” request
return the full response even if there is nothing to return from the server after x seconds (or after timeout)
sent a new the “push” request as soon as the previous one returns to keep the connection with the server alive
and so on…
Of course there is a slight bandwidth loss due to the multiple packet headers but it should not be significant…
In my experience does really everything come with advantages but also disadvantages. There are for sure some problems with EventSource, but considering how many people are using n8n worldwide, are they still quite limited and normally a solution can be found. For that reason. am I very hesitant the change something which generally works, just to replace it with a new unkown set of problems, especially if we have currently very limited resources.
But generally agree that this is something we have to improve at some point. Sadly do we have currently already so much to do, with many other very high impact features and issues, that we have to prioritize and for that reason do not know when we can tackle this. Sorry.
For those who are in 2022 or later with this same problem of Connection lost when using nginx, traefik, or another reverse proxy.
The error is caused when the webUI tries to send a request to URI /rest/push?sessionId=12341234 expecting a text/event-stream response and the reverse proxy tries to compress or buffer the response coming from n8n. When trying to compress or buffer the response gets infinitely stuck on the reverse proxy and the webUI never receives a valid connection.
To solve this you need to add flags that disable buffering or compression of responses in the reverse proxy.
The important part is just proxy_buffering off; but I kept the proxy_pass for reference of where to insert in the proxy file. You know where to edit as you already have it set up and working.
@rafas thank you so much! This helped me resolve issues with our Kubernetes deployment. This should be included in the official documentation.
IMPORTANT NOTE: The recent versions of the Kubernetes Nginx Ingress Controller updated their annotation schema, causing many of the recommended configurations you will find online to not work.
Make sure to use the new annotation format: nginx.ingress.kubernetes.io/proxy-buffering has become nginx.org/proxy-buffering
So I am seeing this as well, only I don’t have any reverse proxies involved. I saw this behaviour on my local docker so it didn’t even leave my machine. Ran great for a day, came in the next day and it’s not working. Moved it off to another docker server, same thing worked great for a day and then no beuno.
Is the log container still a thing? Obviously, I can’t change compression settings but am seriously toying with setting up Traefik just to see if it makes a difference. I come from node-red, so was looking forward to see what it can do with less work
I am very sorry for the trouble. Seeing this is a rather old thread and n8n has changed a lot since this first came up, could you open a new thread with detailed steps on how to reproduce the problem?