1 (edited by caiojames 2017-08-17 23:45:00)

Topic: Unable to connect to iredadmin socket

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

This is a fresh install of iRedmail on CentOS 7. Nginx / MySQL backend.

When I attempt to go to the iredadmin, I get a "Bad Gateway" error from Nginx. Looking at the nginx log, I see the following:

2017/08/17 08:32:18 [error] 3607#0: *1 connect() to unix:/run/uwsgi/iredadmin.socket failed (111: Connection refused) while connecting to upstream, client: 64.145.94.85, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "box.rca.io"
2017/08/17 08:32:54 [error] 3607#0: *1 connect() to unix:/run/uwsgi/iredadmin.socket failed (111: Connection refused) while connecting to upstream, client: 64.145.94.85, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "box.rca.io"
2017/08/17 08:32:55 [error] 3607#0: *1 connect() to unix:/run/uwsgi/iredadmin.socket failed (111: Connection refused) while connecting to upstream, client: 64.145.94.85, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "box.rca.io"
2017/08/17 08:32:56 [error] 3607#0: *1 connect() to unix:/run/uwsgi/iredadmin.socket failed (111: Connection refused) while connecting to upstream, client: 64.145.94.85, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "box.rca.io"
2017/08/17 08:37:19 [error] 3607#0: *6 connect() to unix:/run/uwsgi/iredadmin.socket failed (111: Connection refused) while connecting to upstream, client: 64.145.94.85, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "box.rca.io"

Confirmed that uwsgi is running:

# ps aux | grep uwsgi
root      3215  0.0  0.2  60480  5632 ?        Ss   08:31   0:00 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
root      3217  0.0  0.1  60028  3248 ?        S    08:31   0:00 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
root      3218  0.0  0.0  60480   760 ?        S    08:31   0:00 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
root      3219  0.0  0.0  60480   760 ?        S    08:31   0:00 /usr/sbin/uwsgi --ini /etc/uwsgi.ini
root      5095  0.0  0.0      0     0 ?        Z    08:38   0:00 [uwsgi] <defunct>
root      5097  0.0  0.1 112656  2204 pts/0    S+   08:38   0:00 grep --color=auto uwsgi

Contents of /etc/uwsgi:

# ls -la
total 8
drwxr-xr-x  2 uwsgi uwsgi 100 Aug 17 08:44 .
drwxr-xr-x 26 root  root  740 Aug 17 08:31 ..
-rw-r--r--  1 root  root    5 Aug 17 08:44 iredadmin.pid
srw-rw----  1 nginx nginx   0 Aug 17 08:44 iredadmin.socket
-rw-r--r--  1 root  root    5 Aug 17 08:31 uwsgi.pid

Rebooted the server a few times to make sure. Wondering what's next to troubleshoot?

I'm really only doing this because Apache support is going away (why, I don't know). My intention is to transition from my current server to a fresh one with the latest supported goods.

Thanks,

C

----

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

2

Re: Unable to connect to iredadmin socket

uwsgi should create socket /run/uwsgi/iredadmin.socket. Please check our uwsgi config file template here:
https://bitbucket.org/zhb/iredmail/src/ … les/nginx/

3

Re: Unable to connect to iredadmin socket

ZhangHuangbin wrote:

uwsgi should create socket /run/uwsgi/iredadmin.socket. Please check our uwsgi config file template here:
https://bitbucket.org/zhb/iredmail/src/ … les/nginx/

Thanks for the reply!

I check /run/uwsgi:

# cd /run/uwsgi
# ls -l
total 8
-rw-r--r-- 1 root  root  5 Aug 17 21:13 iredadmin.pid
srw-rw---- 1 nginx nginx 0 Aug 17 21:13 iredadmin.socket
-rw-r--r-- 1 root  root  5 Aug 17 13:34 uwsgi.pid

The configuration files seem to match as well.

Not sure what else to try here. This is literally after running the installer. No other changes on my part.

Also I confirmed selinux is disabled.

C

4

Re: Unable to connect to iredadmin socket

So you have socket /run/uwsgi/iredadmin.socket, try to restart Nginx and uwsgi service, then try to access iRedAdmin again, it should work.

5

Re: Unable to connect to iredadmin socket

Restarted both services. Still getting 502 bad gateway.

# service uwsgi restart
Redirecting to /bin/systemctl restart  uwsgi.service
# service nginx restart
Redirecting to /bin/systemctl restart  nginx.service

6

Re: Unable to connect to iredadmin socket

What's the error message in Nginx now? Still cannot find socket file?