ProgrammingError('(psycopg2.errors.UndefinedTable) relation "events.reminders" does not exist

I have installed indico according to the setup in the docs but i cant seem to run the site. When i try running it in the browser i get a 502 Bad Gateway error. I have tried possible solutions that were recommended here but none seemed to work. When I check /opt/indico/log/nginx/error.log i get this upstream prematurely closed connection while reading response header from upstream. But the logger sends a complete trace of the programming error to my email and I guess that’s where my problem is. The machine am using has apache2 installed on it yet am using the indico nginx installation guide. I simulated the installation on a virtual machine before and it was working fine. I need help.
The trace:

Traceback (most recent call last):
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/celery/app/", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/indico/core/celery/", line 138, in __call__
    rv = super(IndicoTask, s).__call__(*args, **kwargs)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/celery/app/", line 648, in __protected_call__
    return*args, **kwargs)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/indico/core/celery/", line 31, in wrapper
    return f(*args, **kwargs)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/indico/modules/events/reminders/", line 24, in send_event_reminders
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/indico/core/db/sqlalchemy/util/", line 93, in find_all
    return cls.find(*args, **kwargs).all()
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/", line 3168, in all
    return list(self)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/", line 3324, in __iter__
    return self._execute_and_instances(context)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/orm/", line 3349, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 988, in execute
    return meth(self, multiparams, params)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/sql/", line 287, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1107, in _execute_clauseelement
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1248, in _execute_context
    e, statement, parameters, cursor, context
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1466, in _handle_dbapi_exception
    util.raise_from_cause(sqlalchemy_exception, exc_info)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/util/", line 399, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 1244, in _execute_context
    cursor, statement, parameters, context
  File "/opt/indico/.venv/local/lib/python2.7/site-packages/sqlalchemy/engine/", line 550, in do_execute
    cursor.execute(statement, parameters)
ProgrammingError: (psycopg2.errors.UndefinedTable) relation "events.reminders" does not exist
LINE 2: FROM events.reminders JOIN ON

[SQL: SELECT []( AS events_reminders_id, events.reminders.event_id AS events_reminders_event_id, events.reminders.creator_id AS events_reminders_creator_id, events.reminders.created_dt AS events_reminders_created_dt, events.reminders.scheduled_dt AS events_reminders_scheduled_dt, events.reminders.is_sent AS events_reminders_is_sent, events.reminders.event_start_delta AS events_reminders_event_start_delta, events.reminders.recipients AS events_reminders_recipients, events.reminders.send_to_participants AS events_reminders_send_to_participants, events.reminders.include_summary AS events_reminders_include_summary, events.reminders.include_description AS events_reminders_include_description, events.reminders.reply_to_address AS events_reminders_reply_to_address, events.reminders.message AS events_reminders_message
FROM events.reminders JOIN ON []( = events.reminders.event_id
WHERE NOT events.reminders.is_sent AND NOT AND events.reminders.scheduled_dt <= %(scheduled_dt_1)s]
[parameters: {'scheduled_dt_1': datetime.datetime(2020, 4, 29, 15, 5, 0, 102738)}]

Thank you.

It looks like your database is empty. Did you forget to run indico db prepare?

I did and i got this though I didn’t think it was an issue.
(.venv) indico@workshops:~$ indico db prepare
Postgres version too old; you need at least 9.6 (or newer)

If you have something older than 9.6, you absolutely need to upgrade. You may want to install 11 or 12 straight away (since I guess you aren’t using the postgres mentioned in the install guide anyway which would be 9.6); since we’ll likely suggest (possibly require) this version at some point in the future…

Thank you for the help