Adding New Relic to Upstart config in Django one-click install causing 502 Error

Here is my Gunicorn config, with the changes I made in bold. After saving this and doing a sudo service gunicorn restart, I received a 502 error and my website is down. I’m hoping someone can help or tell me what I’m doing wrong, I have verified that all the new relic related paths included below are correct.

description "Gunicorn daemon for Django project"

start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]

# If the process quits unexpectedly trigger a respawn

setuid django
setgid django
chdir /home/django

env NEW_RELIC_CONFIG_FILE=/home/django/django/dealr/newrelic.ini

exec /local/bin/newrelic-admin  run-program gunicorn \
    --name=django_project \
    --pythonpath=django_project \
    --bind= \
    --config /etc/gunicorn.d/ \

I was trying to follow this thread.

Show comments

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.

Does /local/bin/newrelic-admin exist? The path doesn’t sound quite right. I’m guessing you’re missing the /usr part: /usr/local/bin/newrelic-admin.

You can find out exactly what the full path is by running:

which newrelic-admin

Keep in mind that you can always check the logs to see what went wrong:

less /var/log/upstart/your-service-name.log

Press G once you’ve entered less to scroll to the bottom of the file where the most recent errors go.