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.

Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64

1 Answers1

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.

Mitchell van Zuylen
  • 3,905
  • 4
  • 27
  • 64