I set up the 1 click droplet with Ubuntu and Rails. After setting up Git and uploaded the project I worked on it for some weeks without any problem. Then I did a power cycle from the DigitalOcean web UI and since then I got the 502 error.
I’ve tried everything, rebooting from UI, rebooting from the console, changing permissions on the project to the same user as nginx, rebooting nginx, rebooting unicorn, but until now nothing worked.
Any suggestions on resolving this?
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!
Each request to the root will give me a bunch of permission denied errors in the nginx error logs:
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public//index.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 connect() to unix:/tmp/unicorn.test_app.sock failed (2: No such file or directory) while connecting to upstream, client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/500.html/index.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/500.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 connect() to unix:/tmp/unicorn.test_app.sock failed (2: No such file or directory) while connecting to upstream, client: 85.242.64.133, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/500.html", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/favicon.ico/index.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/favicon.ico" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 connect() to unix:/tmp/unicorn.test_app.sock failed (2: No such file or directory) while connecting to upstream, client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/favicon.ico", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/500.html/index.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/favicon.ico", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 stat() "/root/test_app/public/500.html" failed (13: Permission denied), client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/favicon.ico", host: "188.226.135.29"
2014/07/20 22:43:17 [crit] 1219#0: *48 connect() to unix:/tmp/unicorn.test_app.sock failed (2: No such file or directory) while connecting to upstream, client: 85.242.64.133, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/tmp/unicorn.test_app.sock:/500.html", host: "188.226.135.29"
One the one-click Rails app, unicorn is launched with the rails user.
# cat /home/unicorn/unicorn.conf
listen "127.0.0.1:8080"
worker_processes 2
user "rails"
working_directory "/home/rails"
pid "/home/unicorn/pids/unicorn.pid"
stderr_path "/home/unicorn/log/unicorn.log"
stdout_path "/home/unicorn/log/unicorn.log"
What are the permissions on /root/test_app/? The sample application that is running on the one-click app is in /home/rails/ Usually people just remove the contents of that directory and install their app there.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.