Topic: iRedAdmin bad gateway 502 error.
==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9 MySQL edition
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version: Ubuntu 18.04.2 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- 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.
====
I am having the same problem as many other folk. I can't load the /iredadmin/ url. I see the following errors in the logs:
2019/05/24 12:17:14 [error] 1144#1144: *91 upstream prematurely closed connection while reading response header from upstream, client: 42.215.97.75, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:7791", host: "MUNGED"
2019/05/24 12:25:21 [error] 1144#1144: *132 upstream prematurely closed connection while reading response header from upstream, client: 42.215.97.75, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://127.0.0.1:7791", host: "MUNGED"
uwsgi is running (many times?)
$ ps -fe | grep uwsgi
mlmmj 998 1 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
mlmmj 1255 998 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
mlmmj 1256 998 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
mlmmj 1257 998 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
mlmmj 1258 998 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
mlmmj 1259 998 0 12:26 ? 00:00:00 /usr/bin/uwsgi --ini /opt/mlmmjadmin/rc_scripts/uwsgi/debian.ini --pidfile /var/run/mlmmjadmin/mlmmjadmin.pid
$ telnet 0 7790
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
This only affects the /iredadmin/ url, everything else works fine. This worked at initial install, but after upgrade to 0.9.9, it stopped working. I see lots of other posts about this, but no actual solutions.
It's also worth noting that I don't know why nginx is attempting to connect to something on port 7791 because there is nothing listening there. But I can't find the nginx template for the /iredamin/ URL to see what it is being told to do with those requests.
Also, I don't see an iredadmin service running and no such service file in the /etc/init.d directory so I am not sure if that is the problem. I did not check this all out before upgrading.
What am I missing?
EDIT: I found the nginx template for /iredadmin/ and changed the following line to port 7790 to reflect the port uwsgi is actually running on. I have no clue why it was set to 7791, but it still does not resolve the problem:
/etc/nginx/templates/iredadmin.tmpl
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.