1

Topic: Upgrade from community to iRedAdmin-PRO - bad gateway - UWSGI

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Centos 7.8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? Not yet - 4.4
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hi , I can not continue  old topic... so there is a new one
Upgrade from community 1.0 to PRO version.
Procedure was clean and successful , but after..  service iredadmin fail..
From my point of view new IredAdmin-Pro expect that "uwsgi" wil be in /usr/bin , but in my distribution is in /usr/sbin/.
Community version looking in /usr/sbin/

Of course I got "Bad Gateway" .

Below logs from Installation Script , and IredAdmin service status

Best Regards
Adam
======================================== Upgrade
bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: RHEL
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of /opt/www/iRedAdmin-1.0
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.4
* Copy /opt/www/iredadmin/settings.py.
* Remove existing systemd service files.
* Copy systemd service file: /lib/systemd/system/iredadmin.service.
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.4
* Delete all existing sessions to force all admins to re-login.
* Enable Fail2ban SQL integration.
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
* Check and install dependent Python modules:
  + [required] json or simplejson
  + [required] dnspython
  + [required] pycurl
  + [required] requests
* Check SQL tables, and add missed ones - if there's any
* Clean up.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
Redirecting to /bin/systemctl restart iredadmin.service
* Enable service: iredadmin
Created symlink from /etc/systemd/system/multi-user.target.wants/iredadmin.service to /usr/lib/systemd/system/iredadmin.service.
* Upgrading completed.
=====================
===============iredamin status
systemctl -l status iredadmin
● iredadmin.service - iRedAdmin daemon service
   Loaded: loaded (/usr/lib/systemd/system/iredadmin.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Sat 2020-10-03 15:56:15 CEST; 38s ago
  Process: 9278 ExecStopPost=/usr/bin/rm -rf /var/run/iredadmin (code=exited, status=0/SUCCESS)
  Process: 9275 ExecStart=/usr/bin/uwsgi --ini /opt/www/iredadmin/rc_scripts/uwsgi/rhel8.ini --pidfile /var/run/iredadmin/iredadmin.pid (code=exited, status=203/EXEC)
  Process: 9272 ExecStartPre=/usr/bin/chmod 0755 /var/run/iredadmin (code=exited, status=0/SUCCESS)
  Process: 9268 ExecStartPre=/usr/bin/chown iredadmin:iredadmin /var/run/iredadmin (code=exited, status=0/SUCCESS)
  Process: 9266 ExecStartPre=/usr/bin/mkdir /var/run/iredadmin (code=exited, status=0/SUCCESS)
Main PID: 9275 (code=exited, status=203/EXEC)

Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[1]: Starting iRedAdmin daemon service...
Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[1]: Started iRedAdmin daemon service.
Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[9275]: Failed at step EXEC spawning /usr/bin/uwsgi: No such file or directory
Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[1]: iredadmin.service: main process exited, code=exited, status=203/EXEC
Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[1]: Unit iredadmin.service entered failed state.
Oct 03 15:56:15 bursztyn.zdz.katowice.pl systemd[1]: iredadmin.service failed.
=====================

----

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

2

Re: Upgrade from community to iRedAdmin-PRO - bad gateway - UWSGI

Please fix the incorrect path to "uwsgi" manually in file /etc/systemd/system/multi-user.target.wants/iredadmin.service, then run "systemctl daemon-reload" and "service iredadmin restart" to fix it.

btw, iRedAdmin-Pro upgrade script ships "rc_scripts/systemd/rhel.service" with correct path to uwsgi, and it's supposed to be copied to /lib/systemd/system/iredadmin.service, then linked to /etc/systemd/system/multi-user.target.wants/iredadmin.service. No idea why it's incorrect path on your server.

3

Re: Upgrade from community to iRedAdmin-PRO - bad gateway - UWSGI

Hi Zhang
Your script is ok, but I found issue smile

You testing operation system version (DISTRO_VERSION) based on "dnf" program installed ..
wrong, I use CenoOS 7.8 and I have and us dnf..
..so Your script recognized my system as CentOS 8 .

I corrected installation script and everything finished successful. cool

Please thing  to try checking system version based on on other "parameters"

Best regards
Adam

4

Re: Upgrade from community to iRedAdmin-PRO - bad gateway - UWSGI

Update:

- iRedAdmin-Pro upgrade script has been updated to extract release version from /etc/os-release.
- uwsgi path has been fixed too.

Both fixes will be available in upcoming iRedAdmin-Pro release.