1

Topic: Database error: no relations (!?)

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 PGSQL edition.
- Linux/BSD distribution name and version: Ubuntu 16.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/web/application.py", line 237, in process
    return p(lambda: process(processors))
  File "/usr/lib/python2.7/dist-packages/web/session.py", line 84, in _processor
    self._cleanup()
  File "/usr/lib/python2.7/dist-packages/web/session.py", line 172, in _cleanup
    self.store.cleanup(timeout)
  File "/usr/lib/python2.7/dist-packages/web/session.py", line 319, in cleanup
    self.db.delete(self.table, where="$last_allowed_time > atime", vars=locals())
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 907, in delete
    self._db_execute(db_cursor, q)
  File "/usr/lib/python2.7/dist-packages/web/db.py", line 587, in _db_execute
    out = cur.execute(query, params)
ProgrammingError: relation "sessions" does not exist
LINE 1: DELETE FROM sessions WHERE '2017-02-17T11:37:20.627896'::tim...
                    ^

====

Although iRedMail installation went through without errors (as far as I can tell), and all postgres dbs exist, there appear to be no relations at all:

iredadmin=> \d
No relations found.
iredadmin=> \l
                                     List of databases
     Name      |   Owner    | Encoding |   Collate   |    Ctype    |   Access privileges   
---------------+------------+----------+-------------+-------------+-----------------------
 amavisd       | amavisd    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 iredadmin     | iredadmin  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 iredapd       | iredapd    | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 mailserver    | mailuser   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres      | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 roundcubemail | roundcube  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0     | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
               |            |          |             |             | postgres=CTc/postgres
 template1     | postgres   | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
               |            |          |             |             | postgres=CTc/postgres
 vmail         | vmailadmin | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
(9 rows)

Unsurprisingly, neither iRedAdmin nor Roundcube work. How can I force the initial DB setup to re-run so I end up with a working system?

Thank you!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Database error: no relations (!?)

... it turns out that because I had upgraded from 14.04 to 16.04, systemd was installed but not running/working. So I had to manually tweak the conf/global script into not setting USE_SYSTEMD. After reinstalling postgresql (which was completely mucked up), clearing out runtime/install.status, and several attempts at reinstalling everything, I am now able to log into the admin panel.