26

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

ok, Ubuntu 20.04 removes uwsgi plugin for Python 2 support. You have to install "uwsgi" with "pip2" command instead:

pip2 install uwsgi

It installs /usr/local/bin/uwsgi (the "uwsgi-*" deb packages install /usr/bin/uwsgi), so you need to replace "/usr/bin/uwsgi" by "/usr/local/bin/uwsgi" in /etc/systemd/system/multi-user.target.wants/iredadmin.service.

You may need to remove the "plugins =" line in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini also.

----

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

27

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

ZhangHuangbin wrote:

ok, Ubuntu 20.04 removes uwsgi plugin for Python 2 support. You have to install "uwsgi" with "pip2" command instead:

pip2 install uwsgi

It installs /usr/local/bin/uwsgi (the "uwsgi-*" deb packages install /usr/bin/uwsgi), so you need to replace "/usr/bin/uwsgi" by "/usr/local/bin/uwsgi" in /etc/systemd/system/multi-user.target.wants/iredadmin.service.

You may need to remove the "plugins =" line in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini also.

Requirement already satisfied: uwsgi in ./.local/lib/python2.7/site-packages (2.0.18)

So uwsgi was already installed so I changed the /etc/systemd/system/multi-user.target.wants/iredadmin.service to below and rebooted the server afterwards

[Unit]
Description=iRedAdmin daemon service
After=network.target local-fs.target remote-fs.target

[Service]
Type=simple
ExecStartPre=-/bin/mkdir -p /var/run/iredadmin
ExecStartPre=/bin/chown iredadmin:iredadmin /var/run/iredadmin
ExecStartPre=/bin/chmod 0755 /var/run/iredadmin
ExecStart=/usr/local/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid
ExecStop=/usr/local/bin/uwsgi --stop /var/run/iredadmin/iredadmin.pid
ExecStopPost=/bin/rm -rf /var/run/iredadmin
KillSignal=SIGTERM
PrivateTmp=true

[Install]
WantedBy=multi-user.target

I tried with and without the plugins row. This is the result from syslog without the plugins

Jul 14 20:33:45 multibot systemd[1]: Starting iRedAdmin daemon service...
Jul 14 20:33:45 multibot systemd[1]: Started iRedAdmin daemon service.
Jul 14 20:33:45 multibot uwsgi[12416]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Jul 14 20:33:45 multibot uwsgi: *** Starting uWSGI 2.0.19.1 (64bit) on [Tue Jul 14 20:33:45 2020] ***
Jul 14 20:33:45 multibot uwsgi: compiled with version: 9.3.0 on 30 June 2020 20:31:09
Jul 14 20:33:45 multibot uwsgi: os: Linux-5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020
Jul 14 20:33:45 multibot uwsgi: nodename: multibot
Jul 14 20:33:45 multibot uwsgi: machine: x86_64
Jul 14 20:33:45 multibot uwsgi: clock source: unix
Jul 14 20:33:45 multibot uwsgi: detected number of CPU cores: 4
Jul 14 20:33:45 multibot uwsgi: current working directory: /
Jul 14 20:33:45 multibot uwsgi: writing pidfile to /var/run/iredadmin/iredadmin.pid
Jul 14 20:33:45 multibot uwsgi: detected binary path: /usr/local/bin/uwsgi
Jul 14 20:33:45 multibot uwsgi: !!! no internal routing support, rebuild with pcre support !!!
Jul 14 20:33:45 multibot uwsgi: setgid() to 2001
Jul 14 20:33:45 multibot uwsgi: setuid() to 2001
Jul 14 20:33:45 multibot uwsgi: chdir() to /opt/www/iredadmin
Jul 14 20:33:45 multibot uwsgi: your processes number limit is 127971
Jul 14 20:33:45 multibot uwsgi: your memory page size is 4096 bytes
Jul 14 20:33:45 multibot uwsgi: detected max file descriptor number: 1024
Jul 14 20:33:45 multibot uwsgi: VirtualHosting mode enabled.
Jul 14 20:33:45 multibot uwsgi: lock engine: pthread robust mutexes
Jul 14 20:33:45 multibot uwsgi: thunder lock: disabled (you can enable it with --thunder-lock)
Jul 14 20:33:45 multibot uwsgi: uwsgi socket 0 bound to TCP address 127.0.0.1:7791 fd 6
Jul 14 20:33:45 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]
Jul 14 20:33:45 multibot uwsgi: Python main interpreter initialized at 0x555c55b4dbb0
Jul 14 20:33:45 multibot uwsgi: python threads support enabled
Jul 14 20:33:45 multibot uwsgi: your server socket listen backlog is limited to 100 connections
Jul 14 20:33:45 multibot uwsgi: your mercy for graceful operations on workers is 60 seconds
Jul 14 20:33:45 multibot uwsgi: mapped 437520 bytes (427 KB) for 5 cores
Jul 14 20:33:45 multibot uwsgi: *** Operational MODE: preforking ***
Jul 14 20:33:45 multibot uwsgi: Traceback (most recent call last):
Jul 14 20:33:45 multibot uwsgi:   File "iredadmin.py", line 9, in <module>
Jul 14 20:33:45 multibot uwsgi:     from libs import iredbase
Jul 14 20:33:45 multibot uwsgi:   File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 202
Jul 14 20:33:45 multibot uwsgi:     except Exception, e:
Jul 14 20:33:45 multibot uwsgi:                     ^
Jul 14 20:33:45 multibot uwsgi: SyntaxError: invalid syntax
Jul 14 20:33:45 multibot uwsgi: unable to load app 0 (mountpoint='') (callable not found or import error)
Jul 14 20:33:45 multibot uwsgi: *** no app loaded. going in full dynamic mode ***
Jul 14 20:33:45 multibot uwsgi: *** uWSGI is running in multiple interpreter mode ***
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI master process (pid: 12416)
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI worker 1 (pid: 12424, cores: 1)
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI worker 2 (pid: 12425, cores: 1)
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI worker 3 (pid: 12426, cores: 1)
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI worker 4 (pid: 12427, cores: 1)
Jul 14 20:33:45 multibot uwsgi: spawned uWSGI worker 5 (pid: 12428, cores: 1)

28

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

zammy wrote:

Jul 14 20:33:45 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]

uwsgi is running Python 3.8.2 for your iRedAdmin, this is not right.

Please make sure you're using a uwsgi program built for Python 2.

29

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

ZhangHuangbin wrote:
zammy wrote:

Jul 14 20:33:45 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]

uwsgi is running Python 3.8.2 for your iRedAdmin, this is not right.

Please make sure you're using a uwsgi program built for Python 2.

Thanks, and how do I do that?

30

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

What's the "plugins =" line in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini ?
It should contains "python2", not "python3" or "python36", "python38".

31

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

ZhangHuangbin wrote:

What's the "plugins =" line in /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini ?
It should contains "python2", not "python3" or "python36", "python38".

As per your earlier advice, the plugins line was removed. With

plugins = python2,syslog

it looks like below

Jul 21 11:23:59 multibot systemd[1]: Started iRedAdmin daemon service.
Jul 21 11:23:59 multibot uwsgi[3071628]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Jul 21 11:23:59 multibot uwsgi[3071628]: open("./python2_plugin.so"): No such file or directory [core/utils.c line 3732]
Jul 21 11:23:59 multibot uwsgi[3071628]: !!! UNABLE to load uWSGI plugin: ./python2_plugin.so: cannot open shared object file: No such file or directory !!!
Jul 21 11:23:59 multibot uwsgi[3071628]: open("./syslog_plugin.so"): No such file or directory [core/utils.c line 3732]
Jul 21 11:23:59 multibot uwsgi[3071628]: !!! UNABLE to load uWSGI plugin: ./syslog_plugin.so: cannot open shared object file: No such file or directory !!!
Jul 21 11:23:59 multibot uwsgi: *** Starting uWSGI 2.0.19.1 (64bit) on [Tue Jul 21 11:23:59 2020] ***
Jul 21 11:23:59 multibot uwsgi: compiled with version: 9.3.0 on 30 June 2020 20:31:09
Jul 21 11:23:59 multibot uwsgi: os: Linux-5.4.0-40-generic #44-Ubuntu SMP Tue Jun 23 00:01:04 UTC 2020
Jul 21 11:23:59 multibot uwsgi: nodename: multibot
Jul 21 11:23:59 multibot uwsgi: machine: x86_64
Jul 21 11:23:59 multibot uwsgi: clock source: unix
Jul 21 11:23:59 multibot uwsgi: detected number of CPU cores: 4
Jul 21 11:23:59 multibot uwsgi: current working directory: /
Jul 21 11:23:59 multibot uwsgi: writing pidfile to /var/run/iredadmin/iredadmin.pid
Jul 21 11:23:59 multibot uwsgi: detected binary path: /usr/local/bin/uwsgi
Jul 21 11:23:59 multibot uwsgi: !!! no internal routing support, rebuild with pcre support !!!
Jul 21 11:23:59 multibot uwsgi: setgid() to 2001
Jul 21 11:23:59 multibot uwsgi: setuid() to 2001
Jul 21 11:23:59 multibot uwsgi: chdir() to /opt/www/iredadmin
Jul 21 11:23:59 multibot uwsgi: your processes number limit is 127971
Jul 21 11:23:59 multibot uwsgi: your memory page size is 4096 bytes
Jul 21 11:23:59 multibot uwsgi: detected max file descriptor number: 1024
Jul 21 11:23:59 multibot uwsgi: VirtualHosting mode enabled.
Jul 21 11:23:59 multibot uwsgi: lock engine: pthread robust mutexes
Jul 21 11:23:59 multibot uwsgi: thunder lock: disabled (you can enable it with --thunder-lock)
Jul 21 11:23:59 multibot uwsgi: uwsgi socket 0 bound to TCP address 127.0.0.1:7791 fd 6
Jul 21 11:23:59 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]
Jul 21 11:23:59 multibot uwsgi: Python main interpreter initialized at 0x5635f2742be0
Jul 21 11:23:59 multibot uwsgi: python threads support enabled
Jul 21 11:23:59 multibot uwsgi: your server socket listen backlog is limited to 100 connections
Jul 21 11:23:59 multibot uwsgi: your mercy for graceful operations on workers is 60 seconds
Jul 21 11:23:59 multibot uwsgi: mapped 437520 bytes (427 KB) for 5 cores
Jul 21 11:23:59 multibot uwsgi: *** Operational MODE: preforking ***
Jul 21 11:23:59 multibot uwsgi: Traceback (most recent call last):
Jul 21 11:23:59 multibot uwsgi:   File "iredadmin.py", line 9, in <module>
Jul 21 11:23:59 multibot uwsgi:     from libs import iredbase
Jul 21 11:23:59 multibot uwsgi:   File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 202
Jul 21 11:23:59 multibot uwsgi:     except Exception, e:
Jul 21 11:23:59 multibot uwsgi:                     ^
Jul 21 11:23:59 multibot uwsgi: SyntaxError: invalid syntax
Jul 21 11:23:59 multibot uwsgi: unable to load app 0 (mountpoint='') (callable not found or import error)
Jul 21 11:23:59 multibot uwsgi: *** no app loaded. going in full dynamic mode ***
Jul 21 11:23:59 multibot uwsgi: *** uWSGI is running in multiple interpreter mode ***
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI master process (pid: 3071628)
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI worker 1 (pid: 3071637, cores: 1)
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI worker 2 (pid: 3071638, cores: 1)
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI worker 3 (pid: 3071639, cores: 1)
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI worker 4 (pid: 3071640, cores: 1)
Jul 21 11:23:59 multibot uwsgi: spawned uWSGI worker 5 (pid: 3071641, cores: 1)
Jul 21 11:24:01 multibot CRON[3071658]: (root) CMD (/bin/bash /usr/local/bin/fail2ban_banned_db unban_db)

32

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

zammy wrote:

Jul 21 11:23:59 multibot uwsgi: detected binary path: /usr/local/bin/uwsgi
...
Jul 21 11:23:59 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]

As you can see, /usr/local/bin/uwsgi is built with Python 3.8, not Python 2.

Which uwsgi program is specified in /etc/systemd/system/multi-user.target.wants/iredadmin.service? Please make sure it's the one built with Python 2 or has Python 2 support.

33

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

ZhangHuangbin wrote:
zammy wrote:

Jul 21 11:23:59 multibot uwsgi: detected binary path: /usr/local/bin/uwsgi
...
Jul 21 11:23:59 multibot uwsgi: Python version: 3.8.2 (default, Apr 27 2020, 15:53:34)  [GCC 9.3.0]

As you can see, /usr/local/bin/uwsgi is built with Python 3.8, not Python 2.

Which uwsgi program is specified in /etc/systemd/system/multi-user.target.wants/iredadmin.service? Please make sure it's the one built with Python 2 or has Python 2 support.

This is how it looks, not sure what to do with it.


[Unit]                                                                                                                  Description=iRedAdmin daemon service                                                                                    After=network.target local-fs.target remote-fs.target                                                                                                                                                                                           [Service]                                                                                                               Type=simple                                                                                                             ExecStartPre=-/bin/mkdir -p /var/run/iredadmin                                                                          ExecStartPre=/bin/chown iredadmin:iredadmin /var/run/iredadmin                                                          ExecStartPre=/bin/chmod 0755 /var/run/iredadmin                                                                         ExecStart=/usr/local/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/iredadmin.pid                                                                                                                  ExecStop=/usr/local/bin/uwsgi --stop /var/run/iredadmin/iredadmin.pid                                                   ExecStopPost=/bin/rm -rf /var/run/iredadmin                                                                             KillSignal=SIGTERM                                                                                                      PrivateTmp=true                                                                                                                                                                                                                                 [Install]                                                                                                               WantedBy=multi-user.target      

34

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

Please replace “ /usr/local/bin/uwsgi” by “/usr/bin/uwsgi” in /etc/systemd/system/multi-user.target.wants/iredadmin.service, then run

systemctl daemon-reload
service iredadmin restart

35

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

ZhangHuangbin wrote:

Please replace “ /usr/local/bin/uwsgi” by “/usr/bin/uwsgi” in /etc/systemd/system/multi-user.target.wants/iredadmin.service, then run

systemctl daemon-reload
service iredadmin restart

That just takes us back to

 iredadmin.service - iRedAdmin daemon service
     Loaded: loaded (/lib/systemd/system/iredadmin.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2020-07-28 08:10:47 CEST; 11h ago
   Main PID: 3131690 (uwsgi)
      Tasks: 6 (limit: 38391)
     Memory: 3.3M
     CGroup: /system.slice/iredadmin.service
             ├─3131690 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>
             ├─3131691 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>
             ├─3131692 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>
             ├─3131693 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>
             ├─3131694 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>
             └─3131695 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin>

Jul 28 08:10:47 multibot uwsgi[3131690]: !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Jul 28 08:10:47 multibot uwsgi[3131690]: no request plugin is loaded, you will not be able to manage requests.
Jul 28 08:10:47 multibot uwsgi[3131690]: you may need to install the package for your language of choice, or simply loa>
Jul 28 08:10:47 multibot uwsgi[3131690]: !!!!!!!!!!! END OF WARNING !!!!!!!!!!
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI master process (pid: 3131690)
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI worker 1 (pid: 3131691, cores: 1)
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI worker 2 (pid: 3131692, cores: 1)
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI worker 3 (pid: 3131693, cores: 1)
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI worker 4 (pid: 3131694, cores: 1)
Jul 28 08:10:47 multibot uwsgi[3131690]: spawned uWSGI worker 5 (pid: 3131695, cores: 1)

and

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

36

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

please make sure you have package “uwsgi-plugin-python” (or uwsgi-plugin-python2”) installed. Then restart “iredadmin” service.

37

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

ZhangHuangbin wrote:

please make sure you have package “uwsgi-plugin-python” (or uwsgi-plugin-python2”) installed. Then restart “iredadmin” service.

That is already tried in post 27

38

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

I'm confused why it didn't work on your server.

Ubuntu 20.04 doesn't ship uwsgi-plugin-python anymore, so we have to install uwsgi with Python 2.

wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip2 install uwsgi web.py==0.51 pymysql
service iredadmin restart

39

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

ZhangHuangbin wrote:

I'm confused why it didn't work on your server.

Ubuntu 20.04 doesn't ship uwsgi-plugin-python anymore, so we have to install uwsgi with Python 2.

wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip2 install uwsgi web.py==0.51 pymysql
service iredadmin restart

Unfortunately that does not help, all requirements are satisfied

$ pip2 install uwsgi web.py==0.51 pymysql
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. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: uwsgi in ./.local/lib/python2.7/site-packages (2.0.18)
Processing ./.cache/pip/wheels/31/19/0c/809a96cf4bdef37c0804e3fb29db30e5a34121fb3a9d164dea/web.py-0.51-py2-none-any.whl
Requirement already satisfied: pymysql in ./.local/lib/python2.7/site-packages (0.9.3)
Requirement already satisfied: cheroot in ./.local/lib/python2.7/site-packages (from web.py==0.51) (8.3.0)
Requirement already satisfied: six>=1.11.0 in /usr/lib/python2.7/dist-packages (from cheroot->web.py==0.51) (1.14.0)
Requirement already satisfied: more-itertools>=2.6 in ./.local/lib/python2.7/site-packages (from cheroot->web.py==0.51) (5.0.0)
Collecting jaraco.functools
  Using cached jaraco.functools-2.0-py2.py3-none-any.whl (6.7 kB)
Collecting backports.functools-lru-cache; python_version < "3.3"
  Using cached backports.functools_lru_cache-1.6.1-py2.py3-none-any.whl (5.7 kB)
Installing collected packages: web.py, backports.functools-lru-cache, jaraco.functools
Successfully installed backports.functools-lru-cache-1.6.1 jaraco.functools-2.0 web.py-0.51
sudo service iredadmin status
● iredadmin.service - iRedAdmin daemon service
     Loaded: loaded (/lib/systemd/system/iredadmin.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2020-07-31 21:22:55 CEST; 1 day 17h ago
   Main PID: 580710 (uwsgi)
      Tasks: 6 (limit: 38391)
     Memory: 3.4M
     CGroup: /system.slice/iredadmin.service
             ├─580710 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>
             ├─580711 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>
             ├─580712 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>
             ├─580713 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>
             ├─580714 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>
             └─580715 /usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/iredadmin/>

Jul 31 21:22:55 multibot uwsgi[580710]: !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Jul 31 21:22:55 multibot uwsgi[580710]: no request plugin is loaded, you will not be able to manage requests.
Jul 31 21:22:55 multibot uwsgi[580710]: you may need to install the package for your language of choice, or simply load>
Jul 31 21:22:55 multibot uwsgi[580710]: !!!!!!!!!!! END OF WARNING !!!!!!!!!!
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI master process (pid: 580710)
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI worker 1 (pid: 580711, cores: 1)
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI worker 2 (pid: 580712, cores: 1)
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI worker 3 (pid: 580713, cores: 1)
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI worker 4 (pid: 580714, cores: 1)
Jul 31 21:22:55 multibot uwsgi[580710]: spawned uWSGI worker 5 (pid: 580715, cores: 1)

40

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

I now managed to make the python27 plugin from the uwsgi source but that led me to not being able to import web again even though the web-py package is installed
plugins = python27,syslog

Aug  2 15:30:31 multibot systemd[1]: Starting iRedAdmin daemon service...
Aug  2 15:30:31 multibot systemd[1]: Started iRedAdmin daemon service.
Aug  2 15:30:31 multibot uwsgi[1362213]: [uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini
Aug  2 15:30:31 multibot uwsgi: *** Starting uWSGI 2.0.18-debian (64bit) on [Sun Aug  2 15:30:31 2020] ***
Aug  2 15:30:31 multibot uwsgi: compiled with version: 10.0.1 20200405 (experimental) [master revision 0be9efad938:fcb98e4978a:705510a708d3642c9c962beb663c476167e4e8a4] on 11 April 2020 11:15:55
Aug  2 15:30:31 multibot uwsgi: os: Linux-5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
Aug  2 15:30:31 multibot uwsgi: nodename: multibot
Aug  2 15:30:31 multibot uwsgi: machine: x86_64
Aug  2 15:30:31 multibot uwsgi: clock source: unix
Aug  2 15:30:31 multibot uwsgi: pcre jit disabled
Aug  2 15:30:31 multibot uwsgi: detected number of CPU cores: 4
Aug  2 15:30:31 multibot uwsgi: current working directory: /
Aug  2 15:30:31 multibot uwsgi: writing pidfile to /var/run/iredadmin/iredadmin.pid
Aug  2 15:30:31 multibot uwsgi: detected binary path: /usr/bin/uwsgi-core
Aug  2 15:30:31 multibot uwsgi: setgid() to 2001
Aug  2 15:30:31 multibot uwsgi: setuid() to 2001
Aug  2 15:30:31 multibot uwsgi: chdir() to /opt/www/iredadmin
Aug  2 15:30:31 multibot uwsgi: your processes number limit is 127971
Aug  2 15:30:31 multibot uwsgi: your memory page size is 4096 bytes
Aug  2 15:30:31 multibot uwsgi: detected max file descriptor number: 1024
Aug  2 15:30:31 multibot uwsgi: VirtualHosting mode enabled.
Aug  2 15:30:31 multibot uwsgi: lock engine: pthread robust mutexes
Aug  2 15:30:31 multibot uwsgi: thunder lock: disabled (you can enable it with --thunder-lock)
Aug  2 15:30:31 multibot uwsgi: uwsgi socket 0 bound to TCP address 127.0.0.1:7791 fd 6
Aug  2 15:30:31 multibot uwsgi: Python version: 2.7.18rc1 (default, Apr  7 2020, 12:05:55)  [GCC 9.3.0]
Aug  2 15:30:31 multibot uwsgi: Python main interpreter initialized at 0x55ed221a4c20
Aug  2 15:30:31 multibot uwsgi: python threads support enabled
Aug  2 15:30:31 multibot uwsgi: your server socket listen backlog is limited to 100 connections
Aug  2 15:30:31 multibot uwsgi: your mercy for graceful operations on workers is 60 seconds
Aug  2 15:30:31 multibot uwsgi: mapped 437520 bytes (427 KB) for 5 cores
Aug  2 15:30:31 multibot uwsgi: *** Operational MODE: preforking ***
Aug  2 15:30:31 multibot uwsgi: Traceback (most recent call last):
Aug  2 15:30:31 multibot uwsgi:   File "iredadmin.py", line 9, in <module>
Aug  2 15:30:31 multibot uwsgi:
Aug  2 15:30:31 multibot uwsgi: from libs import iredbase
Aug  2 15:30:31 multibot uwsgi:   File "/opt/www/iRedAdmin-1.0/libs/iredbase.py", line 7, in <module>
Aug  2 15:30:31 multibot uwsgi:
Aug  2 15:30:31 multibot uwsgi: import web
Aug  2 15:30:31 multibot uwsgi: ImportError
Aug  2 15:30:31 multibot uwsgi: :
Aug  2 15:30:31 multibot uwsgi: No module named web
Aug  2 15:30:31 multibot uwsgi:
Aug  2 15:30:31 multibot uwsgi: unable to load app 0 (mountpoint='') (callable not found or import error)
Aug  2 15:30:31 multibot uwsgi: *** no app loaded. going in full dynamic mode ***
Aug  2 15:30:31 multibot uwsgi: *** uWSGI is running in multiple interpreter mode ***
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI master process (pid: 1362213)
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI worker 1 (pid: 1362214, cores: 1)
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI worker 2 (pid: 1362215, cores: 1)
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI worker 3 (pid: 1362216, cores: 1)
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI worker 4 (pid: 1362217, cores: 1)
Aug  2 15:30:31 multibot uwsgi: spawned uWSGI worker 5 (pid: 1362218, cores: 1)

41

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

Hmm, we're looping back.

Try one more time:

- Install uwsgi: "pip2 install uwsgi". It should install /usr/local/bin/uwsgi.
- Update  /etc/systemd/system/multi-user.target.wants/iredadmin.service, replace /usr/bin/uwsgi by /usr/local/bin/uwsgi.
- Update /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini, remove the "plugin" line.

Now restart "iredadmin" service and check /var/log/syslog, also try to access it from web browser.

42

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

ZhangHuangbin wrote:

Hmm, we're looping back.

Try one more time:

- Install uwsgi: "pip2 install uwsgi". It should install /usr/local/bin/uwsgi.
- Update  /etc/systemd/system/multi-user.target.wants/iredadmin.service, replace /usr/bin/uwsgi by /usr/local/bin/uwsgi.
- Update /opt/www/iredadmin/rc_scripts/uwsgi/debian.ini, remove the "plugin" line.

Now restart "iredadmin" service and check /var/log/syslog, also try to access it from web browser.

I can do that later, but uwsgi is not the problem anymore. Now it is the import web that's next. This is the same problem I had with IredAPD earlier.

Do you have any plans converting iRedAdmin to Python3? I can live without admin for a month more if so.

43

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

zammy wrote:

Do you have any plans converting iRedAdmin to Python3?

we’re moving to Python 3 and almost finished, both SQL and LDAP edition. Need some more testing.

44

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

ZhangHuangbin wrote:
zammy wrote:

Do you have any plans converting iRedAdmin to Python3?

we’re moving to Python 3 and almost finished, both SQL and LDAP edition. Need some more testing.

Then don't waste energy on me, I'll wait for the next version. Thanks!

45

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

Are you sure Python (2) module "web.py" (version 0.51) is installed on server?
Try it again:

pip2 install web.py==0.51

46

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

ZhangHuangbin wrote:

Are you sure Python (2) module "web.py" (version 0.51) is installed on server?
Try it again:

pip2 install web.py==0.51

Yes, but I tried again and it is still installed. I even tested the web.py test app again running python2 and no problems during import when running below code

python2 app.py 192.168.1.100:1234

import web

urls = (
    '/', 'index'
)

class index:
    def GET(self):
        return "Hello, world!"

if __name__ == "__main__":
    app = web.application(urls, globals())
    app.run()

47

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

No idea right now. Have to debug via direct ssh access with root privilege, also testing mail/admin accounts.

48

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

ZhangHuangbin wrote:

No idea right now. Have to debug via direct ssh access with root privilege, also testing mail/admin accounts.

It's no problem, everything except the admin is working so I can wait until it is updated to Python3.