Question

Dokku on Ubuntu droplet 502 Bad Gateway

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"


Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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.

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

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