1 (edited by napoleon.lam 2018-11-13 10:18:15)

Topic: a newly install iredadmin got 502 bad gateway error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: CentOS 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? iRedAdmin Pro 3.1
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
/var/log/nginx/error.log
2018/11/13 10:00:59 [error] 426#0: *58 upstream prematurely closed connection while reading response header from upstream, client: 10.52.0.52, server: _, request: "GET /iredadmin HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "10.8.0.155"
@

I install a new iredmail plus iredadmin without a problem before, but now Starting from late October i could not make it.
i have seen a forum

https://forum.iredmail.org/search1472957384.html

it look like i have the same issues post on 2018-09-15 03:38:31

Dear Zhang,
  could you have a try and look?

Thanks
Napoleon

----

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

2

Re: a newly install iredadmin got 502 bad gateway error

Is uwsgi service running?

3 (edited by napoleon.lam 2018-11-15 10:00:01)

Re: a newly install iredadmin got 502 bad gateway error

Yes, uwsgi and nginx is runnning
roundcube access successfully.
only iredadmin, Pro or not,
you can have a clean installation without doing anythings, and you will end up in this. as i have try many times.

4

Re: a newly install iredadmin got 502 bad gateway error

● uwsgi.service - uWSGI Emperor Service
   Loaded: loaded (/usr/lib/systemd/system/uwsgi.service; enabled; vendor preset                                                                                        : disabled)
   Active: active (running) since Tue 2018-11-13 12:02:13 HKT; 3 days ago
Main PID: 51 (uwsgi)
   Status: "The Emperor is governing 1 vassals"
   CGroup: /system.slice/uwsgi.service
           ├─51 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
           ├─56 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
           ├─57 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
           ├─58 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
           ├─59 /usr/sbin/uwsgi --ini iredadmin.ini
           └─60 /usr/sbin/uwsgi --ini iredadmin.ini

Nov 13 12:02:13 ct-mailsites3 uwsgi[51]: spawned uWSGI master process (pid: 59)
Nov 13 12:02:13 ct-mailsites3 uwsgi[51]: Tue Nov 13 12:02:13 2018 - [emperor...d
Nov 13 12:02:13 ct-mailsites3 uwsgi[51]: spawned uWSGI worker 1 (pid: 60, co...)
Nov 13 12:02:13 ct-mailsites3 uwsgi[51]: Tue Nov 13 12:02:13 2018 - [emperor...s
Nov 13 12:02:13 ct-mailsites3 systemd[1]: Started uWSGI Emperor Service.
Nov 13 12:02:18 ct-mailsites3 uwsgi[51]: -- unavailable modifier requested: 0 --
Nov 13 12:02:18 ct-mailsites3 uwsgi[51]: announcing my loyalty to the Emperor...
Nov 13 12:02:18 ct-mailsites3 uwsgi[51]: Tue Nov 13 12:02:18 2018 - [emperor...l
Nov 17 11:20:33 ct-mailsites3 uwsgi[51]: -- unavailable modifier requested: 0 --
Nov 17 11:20:33 ct-mailsites3 uwsgi[51]: -- unavailable modifier requested: 0 --
Hint: Some lines were ellipsized, use -l to show in full.

it is running

5

Re: a newly install iredadmin got 502 bad gateway error

Does your server have file /run/uwsgi/iredadmin.socket when uwsgi service is running?

How about try out cloud-based iRedMail installer instead?
https://www.iredmail.org/cloud.html

6

Re: a newly install iredadmin got 502 bad gateway error

Yes there is, but 0 bytes
-rw-r--r--  1 root  root    7 Nov 19 09:31 iredadmin.pid
srw-rw----  1 nginx nginx   0 Nov 19 09:31 iredadmin.socket
-rw-r--r--  1 root  root    7 Nov 19 09:31 uwsgi.pid
[root@ct-mailsites3 uwsgi]# systemctl status uwsgi
● uwsgi.service - uWSGI Emperor Service
   Loaded: loaded (/usr/lib/systemd/system/uwsgi.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2018-11-19 09:31:42 HKT; 34s ago
Main PID: 268259 (uwsgi)
   Status: "The Emperor is governing 1 vassals"
   CGroup: /system.slice/uwsgi.service
           ├─268259 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
           ├─268260 /usr/sbin/uwsgi --ini /etc/uwsgi.ini

7

Re: a newly install iredadmin got 502 bad gateway error

napoleon.lam wrote:

upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:"

Is the last ':' a typo error? Could you show me full content of file /etc/nginx/templates/iredadmin.tmpl?

8 (edited by napoleon.lam 2018-11-20 18:14:07)

Re: a newly install iredadmin got 502 bad gateway error

SOLVED!! by
yum -y install uwsgi-plugin-python2
service uwsgi restart
but i found out i did many things
some other sample after fresh installing using the command above result in Internal Server Error.

9

Re: a newly install iredadmin got 502 bad gateway error

Thanks for sharing. EPEL changed the package name few months ago.