1

Topic: A number of problems after upgarde of Ubuntu from 18.04->20.04

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: Ubuntu server 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.

Apr 24 10:37:00 multibot systemd[1]: Starting iRedAPD (A simple posfix policy server)...
Apr 24 10:37:00 multibot python2[8692]: Traceback (most recent call last):
Apr 24 10:37:00 multibot python2[8692]:   File "/opt/iredapd/iredapd.py", line 20, in <module>
Apr 24 10:37:00 multibot python2[8692]:     from libs import __version__, daemon, utils
Apr 24 10:37:00 multibot python2[8692]:   File "/opt/iRedAPD-3.6/libs/utils.py", line 17, in <module>
Apr 24 10:37:00 multibot python2[8692]:     from web import sqlquote
Apr 24 10:37:00 multibot python2[8692]: ImportError: No module named web
Apr 24 10:37:00 multibot systemd[1]: iredapd.service: Control process exited, code=exited, status=1/FAILURE
Apr 24 10:37:00 multibot systemd[1]: iredapd.service: Failed with result 'exit-code'.
Apr 24 10:37:00 multibot systemd[1]: Failed to start iRedAPD (A simple posfix policy server).

====

I have a number of problems after upgrading my server to 20.04. I am not sure what comes first. But IRedAPD cannot start. I did install web.py==0.51 hoping that would solve the issue, but it did not.

I get below fault when trying to send an email
warning: connect to 127.0.0.1:7777: Connection refused

When I send a mail to my server I get the following
postfix/smtpd[12254]: NOQUEUE: reject: RCPT from

Apart from this roundcube does not work. I get 502 Bad gatway. The /var/log/nginx/error.log gives
2020/04/24 10:41:08 [error] 1992#1992: *25 connect() failed (111: Connection refused) while connecting to upstream, client: 5.101.0.209, server: adress.nu, request: "GET /index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=HelloThinkPHP HTTP/1.1", upstream: "fastcgi://127.0.0.1:9999", host: "IP:443"
root@multibot:/var/log/nginx#

Can anyone advice where to start the troubleshooting?

----

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

2 (edited by MuPp3t33r 2020-04-24 18:18:47)

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

The 502 Bad gateway error is probably because of an upgrade to a different version of PHP.
Check the config file for your running version of PHP and make sure it has listen = 127.0.0.1:9999 in the config
You'll probably find this at /etc/php/7.3/fpm/pool.d/www.conf    -    but you can check around there.

3

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

MuPp3t33r wrote:

The 502 Bad gateway error is probably because of an upgrade to a different version of PHP.
Check the config file for your running version of PHP and make sure it has listen = 127.0.0.1:9999 in the config
You'll probably find this at /etc/php/7.3/fpm/pool.d/www.conf    -    but you can check around there.

That solved the problem that I can actually access the roundcube, but I can't login yet.

4

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Ubuntu 20.04 was out 2 days ago, we didn't even test it yet, you were too rush ...

iRedAPD, mlmmjadmin and iRedAdmin require Python-2 and some modules:

1: uwsgi
2: pymysql
3: sqlalchemy
4: web.py

1+2+3 should be available in apt repo, 4 can be installed with command "pip2": pip2 install web.py==0.51

5

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:

Ubuntu 20.04 was out 2 days ago, we didn't even test it yet, you were too rush ...

iRedAPD, mlmmjadmin and iRedAdmin require Python-2 and some modules:

1: uwsgi
2: pymysql
3: sqlalchemy
4: web.py

1+2+3 should be available in apt repo, 4 can be installed with command "pip2": pip2 install web.py==0.51

Yeah I get that! I will try to install above and let you know the result. Someone has to be the guineapig hmm

6

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:

Ubuntu 20.04 was out 2 days ago, we didn't even test it yet, you were too rush ...

iRedAPD, mlmmjadmin and iRedAdmin require Python-2 and some modules:

1: uwsgi
2: pymysql
3: sqlalchemy
4: web.py

1+2+3 should be available in apt repo, 4 can be installed with command "pip2": pip2 install web.py==0.51

I forgot to write thanks ZhangHuangbin, for the assistance and your efforts with iredmail.

Is there a shortcut to get dovecot to at least receive mails to start with or is it iredadp that is needed?

7

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Update, when installing above 4 packages it all seems good, but the same fault code appears in iRedAPD
Apr 24 20:05:39 multibot systemd[1]: Starting iRedAPD (A simple posfix policy server)...
Apr 24 20:05:40 multibot python2[1833]: Traceback (most recent call last):
Apr 24 20:05:40 multibot python2[1833]:   File "/opt/iredapd/iredapd.py", line 20, in <module>
Apr 24 20:05:40 multibot python2[1833]:     from libs import __version__, daemon, utils
Apr 24 20:05:40 multibot python2[1833]:   File "/opt/iRedAPD-3.6/libs/utils.py", line 17, in <module>
Apr 24 20:05:40 multibot python2[1833]:     from web import sqlquote
Apr 24 20:05:40 multibot python2[1833]: ImportError: No module named web

8

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

zammy wrote:

Apr 24 20:05:40 multibot python2[1833]: ImportError: No module named web

Did you install web.py with "pip2" or "pip3" command? It must be "pip2".

9 (edited by zammy 2020-04-25 14:45:44)

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:
zammy wrote:

Apr 24 20:05:40 multibot python2[1833]: ImportError: No module named web

Did you install web.py with "pip2" or "pip3" command? It must be "pip2".

I had it installed with both so I tried to Uninstalle it from pip3, but that did not help. When trying to install with pip3, I seem to have weby included in many packages. Could that be the problem?

pip2 install web.py==0.51
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/developme … -2-support
Defaulting to user installation because normal site-packages is not writeableRequirement already satisfied: web.py==0.51 in ./.local/lib/python2.7/site-packages (0.51)
Requirement already satisfied: cheroot in ./.local/lib/python2.7/site-packages (from web.py==0.51) (8.3.0)
Requirement already satisfied: backports.functools-lru-cache; python_version < "3.3" in ./.local/lib/python2.7/site-packages (from cheroot->web.py==0.51) (1.6.1)
Requirement already satisfied: more-itertools>=2.6 in ./.local/lib/python2.7/site-packages (from cheroot->web.py==0.51) (5.0.0)
Requirement already satisfied: jaraco.functools in ./.local/lib/python2.7/site-packages (from cheroot->web.py==0.51) (2.0)
Requirement already satisfied: six>=1.11.0 in /usr/lib/python2.7/dist-packages (from cheroot->web.py==0.51) (1.14.0)

Do you have plans to try ubuntu 20.04 in a near future? I switched over to a backup server for now so it is not urgent for me. Maybe it is easier when you can test as you like?

10

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Just some more info. I can connect to the imap server and download existing mails, however not receive emails.

I also tried a clean install of iredmail on another Ubuntu 20.04 computer and it is not possible since the python 2 packages cannot be installed. Maybe possible to add another repository before starting, but I didn't go there.

11

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

zammy wrote:

Just some more info. I can connect to the imap server and download existing mails, however not receive emails.

I assume you've checked for related postfix configs and logs? IMAP relates to dovecot. MTA vs LDA

12

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

MuPp3t33r wrote:
zammy wrote:

Just some more info. I can connect to the imap server and download existing mails, however not receive emails.

I assume you've checked for related postfix configs and logs? IMAP relates to dovecot. MTA vs LDA

Yes, but I am no expert. I do believe it is due to that postfix has a check_policy_service config to the iRedAPD and since that cannot start the check fails.

I am not sure what the consequences are to remove that. I guess that basically I am left with dovecot/postfix/round cube instead of iredmail if you understand what I mean.

13

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Even if self inflicted, this annoys me. Why cannot iredadp import web. If I run the template code.py from https://webpy.org/docs/0.3/tutorial  It works fine, no error on import web. What could the reason be that iredadp cannot import web?

14

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

- check file /lib/systemd/system/iredapd.service, is iRedAPD ran by Python 2 or 3?
- Run command "python2 -c 'import web'", any error on console?

As a temporary solution, comment out lines "check_policy_service ...:7777" in /etc/postfix/main.cf, it's iRedAPD. This way mail flow should be fine, but you lose greylisting/blacklisting/whitelisting/throttling/sender mismatch checks, etc.

15

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:

- check file /lib/systemd/system/iredapd.service, is iRedAPD ran by Python 2 or 3?
- Run command "python2 -c 'import web'", any error on console?

As a temporary solution, comment out lines "check_policy_service ...:7777" in /etc/postfix/main.cf, it's iRedAPD. This way mail flow should be fine, but you lose greylisting/blacklisting/whitelisting/throttling/sender mismatch checks, etc.

Thanks for your reply!

ExecStart=/usr/bin/python2 /opt/iredapd/iredapd.py

No errors and no info when running python2 -c 'import web'

16

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Good day!
Thanks again for the great efforts releasing 1.3

I now have almost all functionality back running. I do struggle with the iredadmin. I get the following warning when checking iredadmin status and suspect this has something to do with it.

Jun 30 23:01:01 multibot uwsgi[39454]: !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Jun 30 23:01:01 multibot uwsgi[39454]: no request plugin is loaded, you will not be able to manage requests.
Jun 30 23:01:01 multibot uwsgi[39454]: you may need to install the package for your language of choice, or simply load it with --plugin.
Jun 30 23:01:01 multibot uwsgi[39454]: !!!!!!!!!!! END OF WARNING !!!!!!!!!!


I believe this happened when I manually installed the uwsgi package for python3.

Do you have any advice, I would not want to screw up more?

17

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Dear all,

You can upgrade iRedAPD to latest 4.1, mlmmjadmin to 3.0. Both work with Python 3 (and drops Python 2 support), their upgrade scripts will install required Python 3 and python modules automatically. We addresses few issues in upgrade scripts after released iRedMail-1.3, both should work well now.

For iRedAdmin(-Pro), you have to stay with Python 2, with package “uwsgi-plugin-python” (or “-python2”).

18

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:

Dear all,

You can upgrade iRedAPD to latest 4.1, mlmmjadmin to 3.0. Both work with Python 3 (and drops Python 2 support), their upgrade scripts will install required Python 3 and python modules automatically. We addresses few issues in upgrade scripts after released iRedMail-1.3, both should work well now.

For iRedAdmin(-Pro), you have to stay with Python 2, with package “uwsgi-plugin-python” (or “-python2”).

Thanks, I rerun the update of iRedAPD and mlmmjadmin and now the warning is gone, however I still get a 502 Bad gateway and nginx error log shows below

2020/07/01 19:26:43 [error] 2027#2027: *86 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.1, server: server.com, request: "GET /iredadmin HTTP/1.1", upstream: "uwsgi://127.0.0.1:7791", host: "server.com"

Do you have any advice?

19

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

zammy wrote:

2020/07/01 19:26:43 [error] 2027#2027: *86 upstream prematurely closed connection while reading response header from upstream, client: 192.168.1.1, server: server.com, request: "GET /iredadmin HTTP/1.1", upstream: "uwsgi://127.0.0.1:7791", host: "server.com"

Try to restart "iredadmin" service, any error in /var/log/syslog? also, show me full output of command "systemctl status iredadmin".

20

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Jul  3 11:53:23 multibot systemd[1]: Stopped iRedAdmin daemon service.
Jul  3 11:53:23 multibot systemd[1]: Starting iRedAdmin daemon service...
Jul  3 11:53:23 multibot systemd[1]: Started iRedAdmin daemon service.
Jul  3 11:53:23 multibot uwsgi[551114]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Jul  3 11:53:23 multibot uwsgi[551114]: open("/usr/lib/uwsgi/plugins/python_plugin.so"): No such file or directory [core/utils.c line 3724]
Jul  3 11:53:23 multibot uwsgi[551114]: !!! UNABLE to load uWSGI plugin: /usr/lib/uwsgi/plugins/python_plugin.so: cannot open shared object file: No such file or directory !!!
Jul  3 11:53:23 multibot uwsgi: *** Starting uWSGI 2.0.18-debian (64bit) on [Fri Jul  3 11:53:23 2020] ***
Jul  3 11:53:23 multibot uwsgi: compiled with version: 10.0.1 20200405 (experimental) [master revision 0be9efad938:fcb98e4978a:705510a708d3642c9c962beb663c476167e4e8a4] on 11 April 2020 11:15:55
Jul  3 11:53:23 multibot uwsgi: os: Linux-5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020
Jul  3 11:53:23 multibot uwsgi: nodename: multibot
Jul  3 11:53:23 multibot uwsgi: machine: x86_64
Jul  3 11:53:23 multibot uwsgi: clock source: unix
Jul  3 11:53:23 multibot uwsgi: pcre jit disabled
Jul  3 11:53:23 multibot uwsgi: detected number of CPU cores: 4
Jul  3 11:53:23 multibot uwsgi: current working directory: /
Jul  3 11:53:23 multibot uwsgi: writing pidfile to /var/run/iredadmin/iredadmin.pid
Jul  3 11:53:23 multibot uwsgi: detected binary path: /usr/bin/uwsgi-core
Jul  3 11:53:23 multibot uwsgi: setgid() to 2001
Jul  3 11:53:23 multibot uwsgi: setuid() to 2001
Jul  3 11:53:23 multibot uwsgi: chdir() to /opt/www/iredadmin
Jul  3 11:53:23 multibot uwsgi: your processes number limit is 127971
Jul  3 11:53:23 multibot uwsgi: your memory page size is 4096 bytes
Jul  3 11:53:23 multibot uwsgi: detected max file descriptor number: 1024
Jul  3 11:53:23 multibot uwsgi: VirtualHosting mode enabled.
Jul  3 11:53:23 multibot uwsgi: lock engine: pthread robust mutexes
Jul  3 11:53:23 multibot uwsgi: thunder lock: disabled (you can enable it with --thunder-lock)
Jul  3 11:53:23 multibot uwsgi: uwsgi socket 0 bound to TCP address 127.0.0.1:7791 fd 6
Jul  3 11:53:23 multibot uwsgi: your server socket listen backlog is limited to 100 connections
Jul  3 11:53:23 multibot uwsgi: your mercy for graceful operations on workers is 60 seconds
Jul  3 11:53:23 multibot uwsgi: mapped 437520 bytes (427 KB) for 5 cores
Jul  3 11:53:23 multibot uwsgi: *** Operational MODE: preforking ***
Jul  3 11:53:23 multibot uwsgi: *** no app loaded. going in full dynamic mode ***
Jul  3 11:53:23 multibot uwsgi: *** uWSGI is running in multiple interpreter mode ***
Jul  3 11:53:23 multibot uwsgi: !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Jul  3 11:53:23 multibot uwsgi: no request plugin is loaded, you will not be able to manage requests.
Jul  3 11:53:23 multibot uwsgi: you may need to install the package for your language of choice, or simply load it with --plugin.
Jul  3 11:53:23 multibot uwsgi: !!!!!!!!!!! END OF WARNING !!!!!!!!!!
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI master process (pid: 551114)
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI worker 1 (pid: 551115, cores: 1)
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI worker 2 (pid: 551116, cores: 1)
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI worker 3 (pid: 551117, cores: 1)
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI worker 4 (pid: 551118, cores: 1)
Jul  3 11:53:23 multibot uwsgi: spawned uWSGI worker 5 (pid: 551119, cores: 1)

multibot:~$ sudo systemctl status iredadmin.service
● iredadmin.service - iRedAdmin daemon service
     Loaded: loaded (/lib/systemd/system/iredadmin.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-07-03 11:53:23 CEST; 2min 14s ago
    Process: 551099 ExecStartPre=/bin/mkdir -p /var/run/iredadmin (code=exited, status=0/SUCCESS)
    Process: 551104 ExecStartPre=/bin/chown iredadmin:iredadmin /var/run/iredadmin (code=exited, status=0/SUCCESS)
    Process: 551113 ExecStartPre=/bin/chmod 0755 /var/run/iredadmin (code=exited, status=0/SUCCESS)
   Main PID: 551114 (uwsgi)
      Tasks: 6 (limit: 38391)
     Memory: 3.4M
     CGroup: /system.slice/iredadmin.service
             ├─551114 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
             ├─551115 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
             ├─551116 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
             ├─551117 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
             ├─551118 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
             └─551119 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid

Jul 03 11:53:23 multibot uwsgi[551114]: !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Jul 03 11:53:23 multibot uwsgi[551114]: no request plugin is loaded, you will not be able to manage requests.
Jul 03 11:53:23 multibot uwsgi[551114]: you may need to install the package for your language of choice, or simply load it with --plugin.
Jul 03 11:53:23 multibot uwsgi[551114]: !!!!!!!!!!! END OF WARNING !!!!!!!!!!
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI master process (pid: 551114)
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI worker 1 (pid: 551115, cores: 1)
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI worker 2 (pid: 551116, cores: 1)
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI worker 3 (pid: 551117, cores: 1)
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI worker 4 (pid: 551118, cores: 1)
Jul 03 11:53:23 multibot uwsgi[551114]: spawned uWSGI worker 5 (pid: 551119, cores: 1)

21

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Please re-download mlmmjadmin-3.0 package and re-upgrade, it fixes this issue.
https://docs.iredmail.org/upgrade.mlmmjadmin.html

22

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:

Please re-download mlmmjadmin-3.0 package and re-upgrade, it fixes this issue.
https://docs.iredmail.org/upgrade.mlmmjadmin.html

I tried that and rebooted the server afterwards and still have the same issue.

23

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

zammy wrote:

Jul  3 11:53:23 multibot uwsgi[551114]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Jul  3 11:53:23 multibot uwsgi[551114]: open("/usr/lib/uwsgi/plugins/python_plugin.so"): No such file or directory [core/utils.c line 3724]

Please install package "uwsgi-plugin-python2" first, then replace "python" by "python2" in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini, then restart "iredadmin" service. Sorry about this trouble.

There's a new iRedAPD release v4.2 available, please also upgrade it to fix a criticial issue:
https://docs.iredmail.org/upgrade.iredapd.html

24

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

ZhangHuangbin wrote:
zammy wrote:

Jul  3 11:53:23 multibot uwsgi[551114]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Jul  3 11:53:23 multibot uwsgi[551114]: open("/usr/lib/uwsgi/plugins/python_plugin.so"): No such file or directory [core/utils.c line 3724]

Please install package "uwsgi-plugin-python2" first, then replace "python" by "python2" in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini, then restart "iredadmin" service. Sorry about this trouble.

There's a new iRedAPD release v4.2 available, please also upgrade it to fix a criticial issue:
https://docs.iredmail.org/upgrade.iredapd.html

No need to apologize, you are doing a fantastic job!

I on the other hand are not able to install the uwsgi-plugin-python2. How should I do that? Didn't even manage to Google a good enough explanation.

25

Re: A number of problems after upgarde of Ubuntu from 18.04->20.04

Any advice here? The package is not available in the focal repository, only python3