By moehabib9
I set up a droplet on digital ocean using the one-click installer. I host my code on a git repo. and I use git pull to merge changes, followed by service gunicorn reload to restart gunicorn. The problem is that everytime I do this and try to visit my site I get an ‘internal server error’ messages, and after I refresh once or twice the actual page loads.
It is strange because I get the message even if I wait for a while (15 minutes) before visiting the web page, so I’m not sure if I get this because gunicorn was still restarting or for some other reason. Any hints on what might be going on ?
P.S. I asked the same question on StackOverflow but got no hits
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!
This is quite an old question but for anyone else who may be experiencing this problem, the first thing I would suggest anytime you are receiving an error from your web server is to check the web server’s logs. In this case, reviewing the logs in /var/log/nginx/error.log would likely lead to the underlying cause of the internal server error.
The issue you’re describing is likely related to the services (Gunicorn or NGINX) not restarting gracefully or encountering errors during the restart process. To identify the root cause, checking the error logs of the involved services is crucial.
Check Gunicorn Logs:
sudo journalctl -u gunicorn
Check NGINX Logs:
sudo tail -f /var/log/nginx/error.log
Check Your Application Logs:
logs/ directory of your project or configured in your settings.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.