After upgrade to 2.1.3

After the upgrade to 2.1.3 I got this error and the we couldn’t log to the server again any hints here is what we got as error

Unexpected Exception occurred at ns376467.ip-91-121-94.eu: Task event_reminders[b90388ce-3682-4e8b-b7b7-ade6267725ef] raised unexpected: OperationalError('(psycopg2.OperationalError) could not connect to server: No such file or directory\n\tIs the serv...
 
2018-08-24 14:05:00,166  0000000000000000  celery.app.trace - ERROR trace.py:249 -- Task event_reminders[b90388ce-3682-4e8b-b7b7-ade6267725ef] raised unexpected: OperationalError('(psycopg2.OperationalError) could not connect to server: No such file or directory\n\tIs the server running locally and accepting\n\tconnections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?\n',)

Traceback (most recent call last):
  File "/opt/indico/.venv/lib/python2.7/site-packages/celery/app/trace.py", line 375, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/celery/core.py", line 156, in __call__
    rv = super(IndicoTask, s).__call__(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/celery/app/trace.py", line 632, in __protected_call__
    return self.run(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/celery/util.py", line 40, in wrapper
    return f(*args, **kwargs)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/modules/events/reminders/tasks.py", line 33, in send_event_reminders
    _join=EventReminder.event)
  File "/opt/indico/.venv/lib/python2.7/site-packages/indico/core/db/sqlalchemy/util/models.py", line 102, in find_all
    return cls.find(*args, **kwargs).all()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2773, in all
    return list(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2925, in __iter__
    return self._execute_and_instances(context)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2946, in _execute_and_instances
    close_with_result=True)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2955, in _get_bind_args
    **kw
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2937, in _connection_from_session
    conn = self.session.connection(**kw)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1035, in connection
    execution_options=execution_options)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 1040, in _connection_for_bind
    engine, execution_options)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 409, in _connection_for_bind
    conn = bind.contextual_connect()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2123, in contextual_connect
    self._wrap_pool_connect(self.pool.connect, None),
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2162, in _wrap_pool_connect
    e, dialect, self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1476, in _handle_dbapi_exception_noconnection
    exc_info
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 203, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2158, in _wrap_pool_connect
    return fn()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 403, in connect
    return _ConnectionFairy._checkout(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 788, in _checkout
    fairy = _ConnectionRecord.checkout(pool)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 532, in checkout
    rec = pool._do_get()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1193, in _do_get
    self._dec_overflow()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 66, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 1190, in _do_get
    return self._create_connection()
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 350, in _create_connection
    return _ConnectionRecord(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 477, in __init__
    self.__connect(first_connect_check=True)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/pool.py", line 671, in __connect
    connection = pool._invoke_creator(self)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/strategies.py", line 106, in connect
    return dialect.connect(*cargs, **cparams)
  File "/opt/indico/.venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 410, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/opt/indico/.venv/lib/python2.7/site-packages/psycopg2/__init__.py", line 130, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
OperationalError: (psycopg2.OperationalError) 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.5432"?
 (Background on this error at: http://sqlalche.me/e/e3q8)

Is Postgres running? The error indicates it isn’t.

Unit postgresql-9.6.servicesystemctl.service could not be found.
Unit status.service could not be found.
● postgresql-9.6.service - PostgreSQL 9.6 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.6.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-08-29 09:37:26 CEST; 2h 10min ago
     Docs: https://www.postgresql.org/docs/9.6/static/
  Process: 19820 ExecStart=/usr/pgsql-9.6/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
  Process: 19814 ExecStartPre=/usr/pgsql-9.6/bin/postgresql96-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 19820 (code=exited, status=1/FAILURE)

Aug 29 09:37:26 ns376467 systemd[1]: Starting PostgreSQL 9.6 database server...
Aug 29 09:37:26 ns376467 systemd[1]: postgresql-9.6.service: main process exited, code=exited, sta...LURE
Aug 29 09:37:26 ns376467 systemd[1]: Failed to start PostgreSQL 9.6 database server.
Aug 29 09:37:26 ns376467 systemd[1]: Unit postgresql-9.6.service entered failed state.
Aug 29 09:37:26 ns376467 systemd[1]: postgresql-9.6.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

That sounds a lot like something is wrong with your postgres setup. Hard to say what it is - it is outside the scope of indico for sure. Check if there are any logs with more details why it failed. Where the logs are depends on the your distribution; might be /var/log/… or /var/lib/postgresql/… or /usr/pgsql-9,6/…