1

Topic: Using postgresql-11

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): Latest
- Linux/BSD distribution name and version: Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi,

I wanted to use postgresql-11 for the database. So i made the following changes to the script

function/packages.sh
-----------------------
postgresql11-server postgresql11-contrib

conf/postgresql
-----------------------
export PGSQL_DATA_DIR="${PGSQL_USER_HOMEDIR}/11/data"

function/postgresql.sh
-----------------------
/usr/pgsql-11/bin/postgresql-11-setup initdb

This didn't end up working. Any idea on whereelse i should modify?

Thanks!

----

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

2

Re: Using postgresql-11

log attached here
Oct 24 23:41:51 srv uwsgi: xxx.com [pid: 132|app: 0|req: 2/2] 192.83.228.246 () {52 vars in 857 bytes} [Wed Oct 24 23:41:51 2018] GET /iredadmin => generated 21 bytes in 0 msecs (HTTP/1.1 500) 1 headers in 63 bytes (2 switches on core 0)
Oct 24 23:42:36 srv uwsgi: Traceback (most recent call last):
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/application.py", line 237, in process
Oct 24 23:42:36 srv uwsgi: return p(lambda: process(processors))
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/session.py", line 84, in _processor
Oct 24 23:42:36 srv uwsgi: self._cleanup()
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/session.py", line 172, in _cleanup
Oct 24 23:42:36 srv uwsgi: self.store.cleanup(timeout)
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/session.py", line 319, in cleanup
Oct 24 23:42:36 srv uwsgi: self.db.delete(self.table, where="$last_allowed_time > atime", vars=locals())
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 906, in delete
Oct 24 23:42:36 srv uwsgi: db_cursor = self._db_cursor()
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 566, in _db_cursor
Oct 24 23:42:36 srv uwsgi: return self.ctx.db.cursor()
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 507, in _getctx
Oct 24 23:42:36 srv uwsgi: self._load_context(self._ctx)
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 518, in _load_context
Oct 24 23:42:36 srv uwsgi: ctx.db = self._connect(self.keywords)
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 960, in _connect
Oct 24 23:42:36 srv uwsgi: conn = DB._connect(self, keywords)
Oct 24 23:42:36 srv uwsgi: File "/usr/lib/python2.7/site-packages/web/db.py", line 546, in _connect
Oct 24 23:42:36 srv uwsgi: return self.db_module.connect(**keywords)
Oct 24 23:42:36 srv uwsgi: File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 130, in connect
Oct 24 23:42:36 srv uwsgi: conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
Oct 24 23:42:36 srv uwsgi: OperationalError: could not connect to server: Connection refused
Oct 24 23:42:36 srv uwsgi: Is the server running on host "127.0.0.1" and accepting
Oct 24 23:42:36 srv uwsgi: TCP/IP connections on port 5432?
Oct 24 23:42:36 srv uwsgi: xxx.com [pid: 132|app: 0|req: 3/3] 192.83.228.246 () {52 vars in 857 bytes} [Wed Oct 24 23:42:36 2018] GET /iredadmin => generated 21 bytes in 0 msecs (HTTP/1.1 500) 1 headers in 63 bytes (2 switches on core 0)

3

Re: Using postgresql-11

iRedMail uses packages offered by Linux/BSD vendors directly, you can try to upgrade PGSQL after it's installed. we cannot test every third-party apt/yum repositories.

4

Re: Using postgresql-11

ZhangHuangbin wrote:

iRedMail uses packages offered by Linux/BSD vendors directly, you can try to upgrade PGSQL after it's installed. we cannot test every third-party apt/yum repositories.

Hi,
This is the postgre official repository. I hope you guys test it because I cannot use the outdated 9.2 for practically anything.
I’m sharing the database with Django who recently dropped 9.3

Thank you!

5

Re: Using postgresql-11

https://www.postgresql.org/download/linux/redhat/

6

Re: Using postgresql-11

I tried switching it to 9.6, didn't work either. The database just straight out refused to start

● 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 Fri 2018-10-26 12:15:14 EDT; 1min 57s ago
     Docs: https://www.postgresql.org/docs/9.6/static/
  Process: 596 ExecStartPre=/usr/pgsql-9.6/bin/postgresql96-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)

Oct 26 12:15:14 srv systemd[1]: Starting PostgreSQL 9.6 database server...
Oct 26 12:15:14 srv systemd[1]: postgresql-9.6.service: control process exited, code=exited status=1
Oct 26 12:15:14 srv systemd[1]: Failed to start PostgreSQL 9.6 database server.
Oct 26 12:15:14 srv systemd[1]: Unit postgresql-9.6.service entered failed state.
Oct 26 12:15:14 srv systemd[1]: postgresql-9.6.service failed.

7

Re: Using postgresql-11

I mean iRedMail uses packages offered by Linux/BSD vendors (RHEL/CentOS/Debian/Ubuntu/...), not from software vendors (PostgreSQL). I'm sorry that you have to give it a try yourself.

Another possible solution is, let iRedMail install the old pgsql first, then you upgrade it manually AFTER iRedMail installation.