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

September 28, 2015 890 views
Django One-Click Install Apps

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.

1 Answer

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.

Have another answer? Share your knowledge.