1

My site was running perfectly. I switched off my server to upgrade memory and cores. After turning it on again, i'm greeted by a 500 error. After switching to debug mode, it returns the following:

OperationalError at /
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?
Request Method: GET
Request URL:    http://mysite.nl/
Django Version: 1.6.11
Exception Type: OperationalError
Exception Value:    
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5433"?
Exception Location: /data_nfs/opensurfaces/venv/local/lib/python2.7/site-packages/psycopg2/__init__.py in connect, line 130
Python Executable:  /data_nfs/opensurfaces/venv/bin/python
Python Version: 2.7.6

I'm running Ubuntu 14.04, with a django applicaiton hosted by nginx, gunicorn and postgresql. It appears I need to connect the socket to the server? How Can i do this?

A seemingly related question tells me to remove a file, but I don't have this file.

1 Answer 1

3

It turns out that sudo service postgresql restart doesn't do the trick. Instead I restart it using sudo -u postgres /etc/init.d/postgresql restart, which does work.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.