1 (edited by HawaiiBungalow 2020-07-20 03:54:42)

Topic: 1.2.1->1.3 failed upgrade iRedapd after installing Python3 **FIXED**

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

Upgrading IredAPD 3.6 to 4.4 complete but has failures.

Before doing so I installed Python3.   I now have Python 2.7.5 and Python 3.6.8 installed.

Error message after running "bash upgrade_iredapd.sh" in /root/iRedAPD-4.4/tools.
----------
  Failed building wheel for python-ldap
  Running setup.py clean for python-ldap
Failed to build python-ldap
Installing collected packages: python-ldap
  Running setup.py install for python-ldap ... error
--------------------------------------------------------------------

Now IredAPD.service won't run
---------------
[root@mail tools]# systemctl status iredapd.service
● iredapd.service - iRedAPD (A simple posfix policy server)
   Loaded: loaded (/usr/lib/systemd/system/iredapd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sun 2020-07-19 11:42:44 PDT; 11min ago
  Process: 7382 ExecStart=/usr/bin/python3 /opt/iredapd/iredapd.py (code=exited, status=1/FAILURE)

Jul 19 11:42:44 *.com python3[7382]: Traceback (most recent call last):
Jul 19 11:42:44 *com python3[7382]: File "/opt/iredapd/iredapd.py", line 20, in <module>
Jul 19 11:42:44 * python3[7382]: from libs import __version__, daemon, utils
Jul 19 11:42:44 * python3[7382]: File "/opt/iRedAPD-4.4/libs/utils.py", line 28, in <module>
Jul 19 11:42:44 * python3[7382]: import ldap
Jul 19 11:42:44 *com python3[7382]: ModuleNotFoundError: No module named 'ldap'
Jul 19 11:42:44 *.com systemd[1]: iredapd.service: control process exited, code=exited status=1
Jul 19 11:42:44 *com systemd[1]: Failed to start iRedAPD (A simple posfix policy server).
Jul 19 11:42:44 *.com systemd[1]: Unit iredapd.service entered failed state.
Jul 19 11:42:44 *com systemd[1]: iredapd.service failed.
--------------------------------------------------------

Since new Iredapd-4.4 requires Python3.5+, I just installed "yum python3"

Should I install development and library packages for Python3 too?

I'm assuming I did not install Python3 on Centos 7.

----

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

2

Re: 1.2.1->1.3 failed upgrade iRedapd after installing Python3 **FIXED**

**FIXED**

After installing openldap-service  (yum install openldap-service) and re-running /root/iRedAPD-4.4/tools upgrade_iredapd.sh, the upgrade was a success.

iredapd.service restarted without issue...


------------
[root@mail tools]# bash upgrade_iredapd.sh
* Detected Linux/BSD distribution: RHEL
* Checking dependent Python modules:
  + [required] wheel
  + [required] sqlalchemy
  + [required] dnspython
  + [required] requests
  + [required] web.py
Install packages: python36-PyMySQL gcc python3-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.sonic.net
* epel: mirror.prgmr.com
* extras: mirror.oss.ou.edu
* updates: linux.mirrors.es.net
Package python36-PyMySQL-0.9.3-1.el7.noarch already installed and latest version
Package gcc-4.8.5-39.el7.x86_64 already installed and latest version
Package python3-devel-3.6.8-13.el7.x86_64 already installed and latest version
Nothing to do
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting python-ldap==3.3.1
  Using cached https://files.pythonhosted.org/packages … 3.1.tar.gz
Requirement already up-to-date: pyasn1>=0.3.7 in /usr/local/lib/python3.6/site-packages (from python-ldap==3.3.1)
Requirement already up-to-date: pyasn1_modules>=0.1.5 in /usr/local/lib/python3.6/site-packages (from python-ldap==3.3.1)
Building wheels for collected packages: python-ldap
  Running setup.py bdist_wheel for python-ldap ... done
  Stored in directory: /root/.cache/pip/wheels/a0/30/94/2e83e45e8b68ed4e7a543061d320fe927cfeb2ac87eec29e82
Successfully built python-ldap
Installing collected packages: python-ldap
Successfully installed python-ldap-3.3.1
* Found iRedAPD directory: /opt/iredapd, symbol link of iRedAPD-4.4
* Found iRedAPD config file: /opt/iredapd/settings.py
* Add new SQL tables - if there's any
* Copying new version to /opt/iRedAPD-4.4
* Copy old config file: settings.py (/opt/iredapd/settings.py -> /opt/iRedAPD-4.4/settings.py)
cp: ‘/opt/iredapd/settings.py’ and ‘/opt/iRedAPD-4.4/settings.py’ are the same file
* Copy custom plugins: iRedAPD-4.4/plugins/custom_*.py.
* Set correct owner and permission for /opt/iRedAPD-4.4: root:root, 0500.
* Set permission for iRedAPD config file: /opt/iRedAPD-4.4/settings.py -> 0400.
* Re-create symbol link: /opt/iredapd -> /opt/iRedAPD-4.4
* Remove existing systemd service files.
* Copy systemd service file: /opt/iredapd/rc_scripts/iredapd.service -> /lib/systemd/system/iredapd.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/iredapd.service to /usr/lib/systemd/system/iredapd.service.
Redirecting to /bin/systemctl restart rsyslog.service
* Replace py2 by py3 in cron jobs.
* Restarting iRedAPD service.
Redirecting to /bin/systemctl restart iredapd.service
* Upgrade completed.

< NOTE > If iRedAPD doesn't work as expected, please post your issue in our
< NOTE > online support forum: http://www.iredmail.org/forum/
< NOTE >
< NOTE > * Turn on debug mode: http://www.iredmail.org/docs/debug.iredapd.html
< NOTE > * iRedAPD log file is /var/log/iredapd/iredapd.log.

3

Re: 1.2.1->1.3 failed upgrade iRedapd after installing Python3 **FIXED**

Fixed in latest iRedAPD development edition. Packages "python3-devel" and "gcc" should be installed.