1

Topic: internal server error on ireadmin-pro

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

After a server restart i'm getting this error:

"internal server error"

when looking at the nginx logs i see:
2020/06/02 18:43:53 [error] 3203#103800: *13 kevent() reported that connect() failed (61: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:7791", host: "my.host"

if i try to run iredadmin myself:
cd /usr/local/www/iredadmin/
python2 iredadmin.py

i get what i think is the right response:
http://0.0.0.0:8080/

is there any other log i can look?
How do i find out what's going on?

Thank you.

----

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

2

Re: internal server error on ireadmin-pro

Here is a follow up on some attempt at figuring this out i have made.

if i restart the iredadmin service, it tells me it was not on, but if i check i can see that it is in fact running.
If i stop it, same thing, it tells me it is stopped but it is still running
of course running only means there is an active process listening on that port, it is actually not responding as far as i can tell...

# /usr/local/etc/rc.d/iredadmin restart
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /usr/local/www/iredadmin/rc_scripts/uwsgi/freebsd.ini
# sockstat -4 -l | grep 7791
iredadmin uwsgi-2.7 30858 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30857 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30856 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30855 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30854 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 10027 3  tcp4   127.0.0.1:7791    *:*
# /usr/local/etc/rc.d/iredadmin stop
iredadmin is already stopped.
# sockstat -4 -l | grep 7791
iredadmin uwsgi-2.7 30858 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30857 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30856 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30855 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 30854 3  tcp4   127.0.0.1:7791    *:*
iredadmin uwsgi-2.7 10027 3  tcp4   127.0.0.1:7791    *:*

3

Re: internal server error on ireadmin-pro

Another update, while i'm still trying to figure this out:
i cannot find any log that would have any relevant info.
this log file: /var/log/uwsgi-iredadmin.log does not exists in my system (it is listed on https://docs.iredmail.org/file.locations.html)
nginx logs don't have anything useful
no other log seems to have anything
how can i proceed to find out what's going on?

4

Re: internal server error on ireadmin-pro

ok, i was able to solve it by installing the latest iRedAdmin-Pro and noticing that py-pycurl had some issue.

So i went to install the new version:

# cd /root/iRedAdmin-Pro-SQL-4.3/tools/
# bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: FREEBSD
* HTTP server root: /usr/local/www
* Found iRedAdmin directory: /usr/local/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.2
* Found iRedAdmin config file: /usr/local/www/iredadmin/settings.py
* Copying new version to /usr/local/www/iRedAdmin-Pro-SQL-4.3
* Copy /usr/local/www/iredadmin/settings.py.
* Removing old symbol link /usr/local/www/iredadmin
* Creating symbol link /usr/local/www/iredadmin to /usr/local/www/iRedAdmin-Pro-SQL-4.3
* Delete all existing sessions to force all admins to re-login.
* Enable Fail2ban SQL integration.
* 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
Install package: ftp/py-pycurl
===>  Installing for py27-pycurl-7.43.0.5
===>  Checking if py27-pycurl is already installed
===>   py27-pycurl-7.43.0.5 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of py27-pycurl
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop.
make[1]: stopped in /basejail/usr/ports/ftp/py-pycurl
*** Error code 1

Stop.
make: stopped in /basejail/usr/ports/ftp/py-pycurl
  + [required] requests
* Check SQL tables, and add missed ones - if there's any
* Clean up.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /usr/local/www/iredadmin/rc_scripts/uwsgi/freebsd.ini
* Enable service: iredadmin
iredadmin_enable: YES -> YES
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /usr/local/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/

ok, so it said that py-pycurl was already installed but still attempted to install it, not sure why, but i figured, let me deinstall it and allow the script to install it again

# cd /usr/ports/ftp/py-pycurl
# make deinstall
===>  Deinstalling for py27-pycurl
===>   Deinstalling py27-pycurl-7.43.0.5
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 1 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
    py27-pycurl: 7.43.0.5

Number of packages to be removed: 1
[my.host] [1/1] Deinstalling py27-pycurl-7.43.0.5...
[my.host] [1/1] Deleting files for py27-pycurl-7.43.0.5: 100%
# cd /root/iRedAdmin-Pro-SQL-4.3/tools/
# bash upgrade_iredadmin.sh
* Detected Linux/BSD distribution: FREEBSD
* HTTP server root: /usr/local/www
* Found iRedAdmin directory: /usr/local/www/iredadmin, symbol link of iRedAdmin-Pro-SQL-4.3
* Found iRedAdmin config file: /usr/local/www/iredadmin/settings.py
* Copying new version to /usr/local/www/iRedAdmin-Pro-SQL-4.3
* Copy /usr/local/www/iredadmin/settings.py.
cp: /usr/local/www/iRedAdmin-Pro-SQL-4.3/settings.py and /usr/local/www/iredadmin/settings.py are identical (not copied).
* Removing old symbol link /usr/local/www/iredadmin
* Creating symbol link /usr/local/www/iredadmin to /usr/local/www/iRedAdmin-Pro-SQL-4.3
* Delete all existing sessions to force all admins to re-login.
* Enable mlmmj integration.
* Restarting service: mlmmjadmin.
mlmmjadmin is already stopped.
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
Install package: ftp/py-pycurl
===>  Installing for py27-pycurl-7.43.0.5
===>  Checking if py27-pycurl is already installed
===>   Registering installation for py27-pycurl-7.43.0.5
[my.host] Installing py27-pycurl-7.43.0.5...
===>  Cleaning for py27-pycurl-7.43.0.5
===>  Cleaning for py38-pycurl-7.43.0.5
  + [required] requests
* Check SQL tables, and add missed ones - if there's any
* Clean up.
* iRedAdmin has been successfully upgraded.
* Restarting iredadmin service.
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /usr/local/www/iredadmin/rc_scripts/uwsgi/freebsd.ini
* Enable service: iredadmin
iredadmin_enable: YES -> YES
iredadmin is already stopped.
Starting iredadmin.
[uWSGI] getting INI configuration from /usr/local/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/

interesting enough the new installation installed py27-pycurl but also py38-pycurl, which was not previously there...

I also had to restart mlmmjadmin to make everything work properly.

5

Re: internal server error on ireadmin-pro

iredmail.mb wrote:

interesting enough the new installation installed py27-pycurl but also py38-pycurl, which was not previously there...

Because the DEFAULT_VERSIONS defined in /etc/make.conf, port may install python modules for python3.x instead of 2.x. We need to install with command 'make USES=python:2.7 install clean' for python 2.7.
It's fixed in iRedAPD upgrade script, will fix this for mlmmjadmin later.