Report this

What is the reason for this report?

Dokku on Ubuntu droplet 502 Bad Gateway

Posted on October 20, 2015

Hello everyone!

I have fresh install of Dokku on Ubuntu droplet. After droplet creation I followed this DO tutorial. After successful deploy of application on dokku when I visit the application url I get the 502 Bad Gateway response. I don’t have any custom configuration.

# nginx -t 
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
# dokku nginx:error-logs spring-boot-dokku-demo
2015/10/20 14:59:08 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:08 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:08 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:08 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:08 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:09 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:09 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:09 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:10 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:27 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:27 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:28 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 14:59:28 [error] 15631#0: *65 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.25:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:42 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:43 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:44 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:44 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:44 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:44 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"
2015/10/20 15:03:45 [error] 23451#0: *104 connect() failed (111: Connection refused) while connecting to upstream, client: 193.77.216.177, server: spring-boot-dokku-demo.grega.xyz, request: "GET / HTTP/1.1", upstream: "http://172.17.0.37:5000/", host: "spring-boot-dokku-demo.grega.xyz"



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@fabioruxo , where did you change the port in the droplet’s config ?

You have to wait for a little time for the droplet to get initialized first, and then it’ll open normally.

I had the same problem. So, I tried to ssh into the droplet and figured that the droplet isn’t fully initialized yet.

If you get segmentation error during build, check version of sigil: sigil -v and if you see an error there, you might want to download sigil from its official git repo from releases and place it in the /usr/bin folder.

https://github.com/dokku/dokku/issues/2034

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.