You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
N8N interface keeps staying on Executing node... and loosing connection sometimes on Digital Ocean's app platform #4162
Describe the bug
I can't execute the workflow to test in the frontend interface.
It keeps loading.
Every workflow I create has this problem, no matter the configuration.
To Reproduce
Steps to reproduce the behavior:
Create an app in Digital Ocean
Create a resource from a docker image (n8nio/n8n)
Setup the env and add domain
Wait for a build
Open n8n and register
Create the first workflow and click on execute workflow
Workflow stays loading
Expected behavior
To let the workflow run on digital ocean
Give a clear error if it doesn't work
A timeout with an error instead of waiting forever
Environment (please complete the following information):
Digital Ocean
Docker version latest
Database system [SQLite]
In the env file I have set N8N_HOST WEBHOOK_URL WEBHOOK_TUNNEL_URL VUE_APP_URL_BASE_API N8N_EDITOR_BASE_URL
Additional context
When I run the docker image local everything works
Thanks for reporting this one, I suspect this is not a bug as such and is more than likely going to be a configuration issue. Are you just using the docker image or are you also using a reverse proxy and something like Cloudflare?
It's indeed just the docker container. And I also suspect it to be a configuration issue.
Have used it with and without Cloudflare and it works on a VPS with Cloudflare.
I want it to run on the app platform in Digital Ocean so that there is no server management.
Think it has something to do with EventSource...
But if it does there should be a clear error (in my opinion).
Also, the future is cloud and it is annoying that n8n cant is deployed on Digital Oceans app platform.
You cant configure the reverse proxy (what I imagine is also the case on other cloud app providers)
The thing is it should work right out of the box right?
changed the title [-]N8N interface keeps staying on Executing node... and loosing connection sometimes on digital ocean[/-][+]N8N interface keeps staying on Executing node... and loosing connection sometimes on Digital Ocean's app platform[/+]on Sep 21, 2022
It should work fine on Digital Ocean I have an instance there myself and have used it previously with nginx, Caddy and Traefik with no issues, Are you using a reverse proxy and what environment options do you have set (and what are the values)?
If you check the browser console do you see any error messages?
I also have it running on a droplet with an NGINX proxy in front.
And got it working locally without proxy.
But I need to run it on the app platform. (it's going to be part of a serverless infrastructure)
ENV values that are set are this (with current host/url as value):
N8N_HOST WEBHOOK_URL WEBHOOK_TUNNEL_URL VUE_APP_URL_BASE_API N8N_EDITOR_BASE_URL
Ah I see the problem now, So this looks like the issue we see when n8n is used behind Cloudflare in proxy mode. Annoyingly Cloudflare attempts to cache everything so the response never fully makes it back to the browser. One way around this is to disable the cloudflare proxy option but in this case I can't see that as an option with a DO app.
I did find that when running the workflow it does actually run and logs correctly but I suspect you are going to see other issues if you don't have persisted storage or a database in use which I guess can be added later.
When I set up a test using the Digital Ocean App and I viewed the headers there was one called "server" with a value of "cloudflare", I suspect Digital Ocean run their app service through Cloudflare. It could be that it isn't just a cache thing and maybe something else that Digital Ocean have set up is getting in the way of the browsers response but without knowing more about what they are doing it is hard to say.
I would say though if you have another VPS running and it is using Cloudflare in cache mode rather than direct then it won't be that and it will be something else DO are doing. Have you checked on our community support forum to see if anyone there has done a deployment on Digital Ocean Apps?
First of all, I have to have n8n running on the app platform. We don't want to maintain the server and also want easy scaling.
The VPS instance is also running on a Cloudflare proxy so Cloudflare is not the issue.
I dived deeper into why I wasn't getting anything back:
Turns out the event stream (where all the responses are coming back from) didn't connect. (Top is DO and bottom a VPS with Cloudflare)
I also mentioned in a previous comment about issue #959 where they talk about setting the reverse proxy correct so that the event stream is not caught inside a buffer loop.
After digging into the code if found that n8n uses the sse-channel
So in my case, I can't edit the reverse proxy settings (also something I don't want to worry about and in general hard to do with cloud setups). The solution that de documentation gives is that it needs to disable the proxy_buffering (on Nginx) to disable the buffer completely and so fixes the problem with the event stream getting stuck.
This seems to me like a hotfix... Why disable proxy_buffering completely for one failing request?
What I also want to propose is to convert the event stream to a WebSocket. It has its own schema wss:// and works way nicer with reverse proxys. Also, the package sse-channel is not actively maintained.
I think we can make the setup of the reverse proxy a lot easier if we fix this and will lower the bar to thinker with this. Im also prepared to make a blog about how to set up n8n within 2 minutes in Digital Ocean app platform with limited knowladige.
That is a nice find, I have often wondered about the why but never found enough time to dig into it properly. In theory once this part is sorted we would be able to have a nice simple one click button to deploy as well.
What I will have to do from here is open a feature request internally to have this looked into and prioritised so we can schedule something for a future release. I have no idea what the timescales would be on this as we have our rough roadmap mostly in place for the last part of this year but who knows.
None of this is going to help get you up and running quickly though.
Nothing yet as it is a feature request that isn't a quick change it has to go through prioritisation which can sometimes take a bit of depending on popularity and the current workflow of the team.
Activity
Joffcom commentedon Sep 21, 2022
Hi @matthijs166,
Thanks for reporting this one, I suspect this is not a bug as such and is more than likely going to be a configuration issue. Are you just using the docker image or are you also using a reverse proxy and something like Cloudflare?
matthijs166 commentedon Sep 21, 2022
Hi @Joffcom,
It's indeed just the docker container. And I also suspect it to be a configuration issue.
Have used it with and without Cloudflare and it works on a VPS with Cloudflare.
I want it to run on the app platform in Digital Ocean so that there is no server management.
I also find this issue #959
Think it has something to do with EventSource...
But if it does there should be a clear error (in my opinion).
Also, the future is cloud and it is annoying that n8n cant is deployed on Digital Oceans app platform.
You cant configure the reverse proxy (what I imagine is also the case on other cloud app providers)
The thing is it should work right out of the box right?
[-]N8N interface keeps staying on Executing node... and loosing connection sometimes on digital ocean[/-][+]N8N interface keeps staying on Executing node... and loosing connection sometimes on Digital Ocean's app platform[/+]Joffcom commentedon Sep 21, 2022
Hey @matthijs166,
It should work fine on Digital Ocean I have an instance there myself and have used it previously with nginx, Caddy and Traefik with no issues, Are you using a reverse proxy and what environment options do you have set (and what are the values)?
If you check the browser console do you see any error messages?
matthijs166 commentedon Sep 21, 2022
Hey @Joffcom,
I also have it running on a droplet with an NGINX proxy in front.
And got it working locally without proxy.
But I need to run it on the app platform. (it's going to be part of a serverless infrastructure)
ENV values that are set are this (with current host/url as value):
N8N_HOST WEBHOOK_URL WEBHOOK_TUNNEL_URL VUE_APP_URL_BASE_API N8N_EDITOR_BASE_URL
Joffcom commentedon Sep 21, 2022
Hey @matthijs166,
Perfect, the last few of these it was down to the nginx config. Can you share the config block for the proxy section.
matthijs166 commentedon Sep 27, 2022
Hey @Joffcom
Sorry for the wait but here is my digital ocean spec file.
All the settings of the app. You can also use this for reproducing the issue.
Joffcom commentedon Sep 27, 2022
Hey @matthijs166,
Ah I see the problem now, So this looks like the issue we see when n8n is used behind Cloudflare in proxy mode. Annoyingly Cloudflare attempts to cache everything so the response never fully makes it back to the browser. One way around this is to disable the cloudflare proxy option but in this case I can't see that as an option with a DO app.
I did find that when running the workflow it does actually run and logs correctly but I suspect you are going to see other issues if you don't have persisted storage or a database in use which I guess can be added later.
matthijs166 commentedon Sep 27, 2022
Hey @Joffcom,
There is no Cloudflare in this setup and in an other project where I have n8n on a VPS server it works fine with Cloudflare proxy mode.
Also if cache is the issue than this can be fixed by a simple Cache-Control header. Im trying to add this with my limited knowledge.
I have a more complex setup with persisted storage and a database so thats going to work fine in the final setup.
Joffcom commentedon Sep 27, 2022
Hey @matthijs166,
When I set up a test using the Digital Ocean App and I viewed the headers there was one called "server" with a value of "cloudflare", I suspect Digital Ocean run their app service through Cloudflare. It could be that it isn't just a cache thing and maybe something else that Digital Ocean have set up is getting in the way of the browsers response but without knowing more about what they are doing it is hard to say.
I would say though if you have another VPS running and it is using Cloudflare in cache mode rather than direct then it won't be that and it will be something else DO are doing. Have you checked on our community support forum to see if anyone there has done a deployment on Digital Ocean Apps?
matthijs166 commentedon Sep 28, 2022
Hey @Joffcom,
First of all, I have to have n8n running on the app platform. We don't want to maintain the server and also want easy scaling.
The VPS instance is also running on a Cloudflare proxy so Cloudflare is not the issue.
I dived deeper into why I wasn't getting anything back:

Turns out the event stream (where all the responses are coming back from) didn't connect. (Top is DO and bottom a VPS with Cloudflare)
I also mentioned in a previous comment about issue #959 where they talk about setting the reverse proxy correct so that the event stream is not caught inside a buffer loop.
After digging into the code if found that n8n uses the sse-channel
n8n/packages/cli/src/Push.ts
Line 2 in eaf13cd
So in my case, I can't edit the reverse proxy settings (also something I don't want to worry about and in general hard to do with cloud setups). The solution that de documentation gives is that it needs to disable the proxy_buffering (on Nginx) to disable the buffer completely and so fixes the problem with the event stream getting stuck.
This seems to me like a hotfix... Why disable proxy_buffering completely for one failing request?
The logical solution is to somehow disable the proxy buffering for only the event stream.
https://serverfault.com/questions/801628/for-server-sent-events-sse-what-nginx-proxy-configuration-is-appropriate
But then there are maybe issues with keepalive
What I also want to propose is to convert the event stream to a WebSocket. It has its own schema wss:// and works way nicer with reverse proxys. Also, the package sse-channel is not actively maintained.
I think we can make the setup of the reverse proxy a lot easier if we fix this and will lower the bar to thinker with this. Im also prepared to make a blog about how to set up n8n within 2 minutes in Digital Ocean app platform with limited knowladige.
Joffcom commentedon Sep 28, 2022
Hey @matthijs166,
That is a nice find, I have often wondered about the why but never found enough time to dig into it properly. In theory once this part is sorted we would be able to have a nice simple one click button to deploy as well.
What I will have to do from here is open a feature request internally to have this looked into and prioritised so we can schedule something for a future release. I have no idea what the timescales would be on this as we have our rough roadmap mostly in place for the last part of this year but who knows.
None of this is going to help get you up and running quickly though.
matthijs166 commentedon Oct 3, 2022
@Joffcom Awesome keep me uptodate!
Im trying to make a docker container with nginx build in.
Its a long shot but worth trying.
matthijs166 commentedon Dec 7, 2022
Are there any updates on this issue?
Joffcom commentedon Dec 7, 2022
Hey @matthijs166,
Nothing yet as it is a feature request that isn't a quick change it has to go through prioritisation which can sometimes take a bit of depending on popularity and the current workflow of the team.
matthijs166 commentedon Jan 4, 2023
@Joffcom I made a PR that replaces the EventSource with a WebSocket #5082
netroy commentedon Feb 13, 2023
@matthijs166 Websocket support is now available in
0.215.x, and can be enabled by setting the env variableN8N_PUSH_BACKENDtowebsocket.Thanks for your contribution, and I hope this solves the connectivity issues 🤞🏽
matthijs166 commentedon Feb 13, 2023
@netroy awesome, I will use it immediately!
alih70442 commentedon Aug 25, 2024
I had the same issue, it fixed by using this nginx config code: