1

Topic: Upgrade iRedAdmin-PRO uWSGI issue

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.0
- Deployed with iRedMail Easy or the downloadable installer?: neither, manual
- Linux/BSD distribution name and version: FreeBSD 11.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL 8.0.18
- Web server (Apache or Nginx): Nginx 1.16
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

The upgrade of iRedAdmin-PRO MySWL is giving me problems ever since v.3.0. The primary issue is my case is that I cannot make the iredadmin service work for me. In my setup I use uWSGI instead.

This is the upgrade console of my upgrade from v.3.8 to v.4.2:

bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: FREEBSD
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-3.8
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.2
* Copy /opt/www/iredadmin/settings.py.
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.2
* Delete all existing sessions to force all admins to re-login.
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
Stopping mlmmjadmin.
Starting mlmmjadmin.
[uWSGI] getting INI configuration from /opt/mlmmjadmin/rc_scripts/uwsgi/freebsd.ini
* 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 uwsgi service.
Processing uwsgi profile: iredadmin
Stopping uwsgi.
Waiting for PIDS: 38447.
Starting uwsgi.
realpath() of /usr/local/etc/uwsgi/iredadmin.ini failed: No such file or directory [core/utils.c line 3654]
/usr/local/etc/rc.d/uwsgi: WARNING: failed to start uwsgi
* Enable service: iredadmin
iredadmin_enable: YES -> YES
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/freebsd.ini
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/

The script removes the uWSGI iredadmin.ini file from /usr/local/etc/uwsgi which causes the uWSGI to fail on start-up.

I am basically (still) confused as to uWSGI has to be enabled (uwsgi_enable="YES") in order for iredadmin to work.

I have a set-up that works for me, but not as intended by design:

from my rc.conf:

mlmmjadmin_enable="YES"

uwsgi_enable="YES"
uwsgi_profiles="iredadmin"
uwsgi_iredadmin_flags="--ini /usr/local/etc/uwsgi/iredadmin.ini"

iredadmin_enable="YES"

uWSGI binds to port 7791. The iredadmin service wants to do the same, which of course fails. But it works for me...

2

Re: Upgrade iRedAdmin-PRO uWSGI issue

Dear @ph7,

Sorry about this trouble.

- uwsgi service is deprecated, you can completely stop uwsgi service if you don't have other uwsgi instances/apps.
- I will try to fix the rc.conf in iRedAdmin-Pro upgrade script.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: Upgrade iRedAdmin-PRO uWSGI issue

Could you download the updated "tools/upgrade_iredadmin.sh" script and override the one in your iRedAdmin-Pro, then try to upgrade iRedAdmin-Pro again? Share the console output please, Let me know how it works.

Updated script (iRedAdmin-Pro and iRedAdmin open source edition share the same upgrade script):
https://raw.githubusercontent.com/iredm … edadmin.sh

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

4

Re: Upgrade iRedAdmin-PRO uWSGI issue

ZhangHuangbin wrote:

Could you download the updated "tools/upgrade_iredadmin.sh" script and override the one in your iRedAdmin-Pro, then try to upgrade iRedAdmin-Pro again? Share the console output please, Let me know how it works.

Updated script (iRedAdmin-Pro and iRedAdmin open source edition share the same upgrade script):
https://raw.githubusercontent.com/iredm … edadmin.sh

This is the console output: bash upgrade_iredadmin_test.sh
* Detected Linux/BSD distribution: FREEBSD
* HTTP server root: /opt/www
* Found iRedAdmin directory: /opt/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.2
* Found iRedAdmin config file: /opt/www/iredadmin/settings.py
* Copying new version to /opt/www/iRedAdmin-Pro-SQL-4.2
* Copy /opt/www/iredadmin/settings.py.
cp: /opt/www/iRedAdmin-Pro-SQL-4.2/settings.py and /opt/www/iredadmin/settings.py are identical (not copied).
* Removing old symbol link /opt/www/iredadmin
* Creating symbol link /opt/www/iredadmin to /opt/www/iRedAdmin-Pro-SQL-4.2
* Delete all existing sessions to force all admins to re-login.
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
Stopping mlmmjadmin.
Starting mlmmjadmin.
[uWSGI] getting INI configuration from /opt/mlmmjadmin/rc_scripts/uwsgi/freebsd.ini
* 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 uwsgi service.
Cannot 'restart' uwsgi. Set uwsgi_enable to YES in /etc/rc.conf or use 'onerestart' instead of 'restart'.
* Enable service: iredadmin
iredadmin_enable: YES -> YES
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /opt/www/iredadmin/rc_scripts/uwsgi/freebsd.ini
* Upgrading completed.
<<< NOTE >>> If iRedAdmin doesn't work as expected, please post your issue in
<<< NOTE >>> our online support forum: http://www.iredmail.org/forum/

5

Re: Upgrade iRedAdmin-PRO uWSGI issue

uwsgi_enable='yes' is indeed removed from rc.conf. My uwsgi service is still running however, which prevents the iredadmin from starting.

6

Re: Upgrade iRedAdmin-PRO uWSGI issue

from the console log: * Enable mlmmj integration.
Why this dependency/requirement between mlmmjadmin and iredadmin? I don't use mailing lists. Can it become optional?

7

Re: Upgrade iRedAdmin-PRO uWSGI issue

Currently mlmmj and mlmmjadmin are core components of iRedMail server.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee