1

Topic: UWSGI Breaking issue

==== 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.
======== Required information ====
- iRedMail 0.9.7 MARIADB edition running on Debian 8.
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Just free, sorry.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Hey! So, I've been getting a bit of an issue from uwsgi. After looking at this issue - I got a basic understanding that UWSGI was to blame. Unfourtanately, no matter how many different shapes I try, I get no logs, no errors, just a broken UWSGI that will not start or restart. And yes, I have tried restarting.

Mail works fine. People are actually praising me for how speedy the mail is.

Here are some things if you want it:

Restarting UWSGI:

root@maimail:~# service uwsgi restart
Job for uwsgi.service failed. See 'systemctl status uwsgi.service' and 'journalctl -xn' for details.
root@maimail:~# systemctl status uwsgi.service
● uwsgi.service - LSB: Start/stop uWSGI server instance(s)
   Loaded: loaded (/etc/init.d/uwsgi)
   Active: failed (Result: exit-code) since Wed 2017-11-22 09:05:55 EST; 7s ago
  Process: 3090 ExecStart=/etc/init.d/uwsgi start (code=exited, status=1/FAILURE)

Nov 22 09:05:55 maimail.co uwsgi[3090]: Starting app server(s): uwsgi -> ! failed!
Nov 22 09:05:55 maimail.co systemd[1]: uwsgi.service: control process exited, code=exited status=1
Nov 22 09:05:55 maimail.co systemd[1]: Failed to start LSB: Start/stop uWSGI server instance(s).
Nov 22 09:05:55 maimail.co systemd[1]: Unit uwsgi.service entered failed state.

/etc/uwsgi/apps-enabled/iredadmin.ini

[uwsgi]
plugins = python
vhost = true
socket = /var/run/uwsgi_iredadmin.socket
#pidfile = /var/run/uwsgi_iredadmin.pid
chown-socket = www-data:www-data
chmod-socket = 660
uid = iredadmin
gid = iredadmin
enable-threads = true
logto = /var/log/iru.log

(Yes, I did add the logto - It's still not showing anything however.)

/var/log/nginx/error.log

2017/11/21 12:06:26 [crit] 15530#15530: *153 connect() to unix:/var/run/uwsgi_iredadmin.socket failed (2: No such file or directory) while connecting to upstream, client: Nah, server: maimail.co, request: "GET /iredadmin HTTP/1.1", upstream: "uwsgi://unix:/var/run/uwsgi_iredadmin.socket:", host: "maimail.co"

Any and all help would be very much appreciated. Thanks so much! x3

----

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

2

Re: UWSGI Breaking issue

Any log in /var/log/uwsgi.log (or /var/log/uwsgi/*)?

Also, please try command:

uwsgi --ini /etc/uwsgi.ini

Any error on console?

3

Re: UWSGI Breaking issue

Hey Zhang! Thanks for your response.
uwsgi.log

root@maimail:/var/www/html/mail/config# cat /var/log/uwsgi.log
cat: /var/log/uwsgi.log: No such file or directory
root@maimail:/var/www/html/mail/config# cat /var/log/uwsgi/*
cat: /var/log/uwsgi/*: No such file or directory

And Uwsgi:

root@maimail:/var/www/html/mail/config# uwsgi --ini /etc/uwsgi.ini
realpath() of /etc/uwsgi.ini failed: No such file or directory [core/utils.c line 3591]

4

Re: UWSGI Breaking issue

Hey, ZHB! After finding the code I think I needed, however, I'm still unsure why it will not stop.

cat /var/uwsgi/uwsgi.log

Tue Nov 28 09:16:06 2017 - *** Starting uWSGI 2.0.7-debian (64bit) on [Tue Nov 28 09:16:06 2017] ***
Tue Nov 28 09:16:06 2017 - compiled with version: 4.9.2 on 19 February 2017 21:37:28
Tue Nov 28 09:16:06 2017 - os: Linux-3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19)
Tue Nov 28 09:16:06 2017 - nodename: maimail.co
Tue Nov 28 09:16:06 2017 - machine: x86_64
Tue Nov 28 09:16:06 2017 - clock source: unix
Tue Nov 28 09:16:06 2017 - pcre jit disabled
Tue Nov 28 09:16:06 2017 - detected number of CPU cores: 1
Tue Nov 28 09:16:06 2017 - current working directory: /var/vmail/sieve
Tue Nov 28 09:16:06 2017 - writing pidfile to /var/run/uwsgi.pid
Tue Nov 28 09:16:06 2017 - detected binary path: /usr/bin/uwsgi-core
Tue Nov 28 09:16:06 2017 - uWSGI running as root, you can use --uid/--gid/--chroot options
Tue Nov 28 09:16:06 2017 - *** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Tue Nov 28 09:16:06 2017 - your processes number limit is 7778
Tue Nov 28 09:16:06 2017 - your memory page size is 4096 bytes
Tue Nov 28 09:16:06 2017 - detected max file descriptor number: 65536
Tue Nov 28 09:16:06 2017 - lock engine: pthread robust mutexes
Tue Nov 28 09:16:06 2017 - thunder lock: disabled (you can enable it with --thunder-lock)
Tue Nov 28 09:16:06 2017 - uwsgi socket 0 bound to UNIX address /var/run/uwsgi.socket fd 3
Tue Nov 28 09:16:06 2017 - your server socket listen backlog is limited to 100 connections
Tue Nov 28 09:16:06 2017 - your mercy for graceful operations on workers is 60 seconds
Tue Nov 28 09:16:06 2017 - mapped 218304 bytes (213 KB) for 2 cores
Tue Nov 28 09:16:06 2017 - *** Operational MODE: preforking ***
Tue Nov 28 09:16:06 2017 - *** no app loaded. going in full dynamic mode ***
Tue Nov 28 09:16:06 2017 - *** uWSGI is running in multiple interpreter mode ***
Tue Nov 28 09:16:06 2017 - !!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
Tue Nov 28 09:16:06 2017 - no request plugin is loaded, you will not be able to manage requests.
Tue Nov 28 09:16:06 2017 - you may need to install the package for your language of choice, or simply load it with --plugin.
Tue Nov 28 09:16:06 2017 - !!!!!!!!!!! END OF WARNING !!!!!!!!!!
Tue Nov 28 09:16:06 2017 - spawned uWSGI master process (pid: 11125)
Tue Nov 28 09:16:06 2017 - spawned uWSGI worker 1 (pid: 11127, cores: 1)
Tue Nov 28 09:16:06 2017 - spawned uWSGI worker 2 (pid: 11128, cores: 1)
Tue Nov 28 09:16:06 2017 - *** starting uWSGI Emperor ***

5

Re: UWSGI Breaking issue

Do you have /etc/uwsgi-enabled/iredadmin.ini?

6

Re: UWSGI Breaking issue

No, as mentioned up on post one, it's at /etc/uwsgi/apps-enabled/iredadmin.ini.

7

Re: UWSGI Breaking issue

Adamjenaine wrote:

Tue Nov 28 09:16:06 2017 - no request plugin is loaded, you will not be able to manage requests.

Show us the content of /etc/uwsgi/apps-enabled/iredadmin.ini please. Seems you have some plugins enabled.
Try to comment out the "plugins =" line and try again.