After running apt get update && apt get upgrade
and rebooting the server, I’m getting 502 Bad Gateway
error instead of the privacyIDEA login page. Also, there are zero PI daemons running now where, before the restart, there were several.
- Did the installation script not install a systemd configuration for daemon auto-start?
- How do I correctly do that now, without “breaking” anything?
Details
I followed the installation instructions here for Ubuntu 18.04 and Nginx. The installation worked reliably for two weeks, until this reboot.
Prior to the reboot, I thought to check whether and how many daemons existed.
thomas@mfa_proxy:~$ ps aux | grep 'priva[c]y'
privacy+ 58503 0.0 0.2 237532 2188 ? S Oct30 1:05 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --xmlconfig /etc/uwsgi/apps-enabled/privacyidea.xml --daemonize /var/log/uwsgi/app/privacyidea.log
privacy+ 58699 0.0 3.6 290460 32720 ? S Oct30 0:13 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --xmlconfig /etc/uwsgi/apps-enabled/privacyidea.xml --daemonize /var/log/uwsgi/app/privacyidea.log
privacy+ 85360 0.0 2.0 370348 18456 ? S Nov06 0:14 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --xmlconfig /etc/uwsgi/apps-enabled/privacyidea.xml --daemonize /var/log/uwsgi/app/privacyidea.log
privacy+ 132526 0.0 3.4 244548 30680 ? S 00:58 0:01 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --xmlconfig /etc/uwsgi/apps-enabled/privacyidea.xml --daemonize /var/log/uwsgi/app/privacyidea.log
privacy+ 133455 0.0 8.3 264552 74872 ? S 01:55 0:02 /usr/bin/uwsgi --ini /usr/share/uwsgi/conf/default.ini --xmlconfig /etc/uwsgi/apps-enabled/privacyidea.xml --daemonize /var/log/uwsgi/app/privacyidea.log
After rebooting as follows…
thomas@mfa_proxy:~$ sudo shutdown -r now
Connection to 172.16.1.56 closed by remote host.
Connection to 172.16.1.56 closed.
… there are zero daemons running and attempts to access the privacyIDEA instances URL via browser return 502 Bad Gateway
. This tells me that the WSGI socket doesn’t exist and/or has nothing “running on the other side”.
A search for daemons returns nothing:
thomas@mfa_proxy:~$ ps aux | grep 'privac[y]'
thomas@mfa_proxy:~$
Every time I refresh the browser, the following two lines are written to the Nginx error log (at /var/log/privacyidea/error.log
):
2020/11/12 13:02:22 [crit] 1227#1227: *75 connect() to unix:/run/uwsgi/app/privacyidea/privacyidea.socket failed (2: No such file or directory) while connecting to upstream, client: 172.16.1.1, server: mfa_proxy, request: "GET / HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/app/privacyidea/privacyidea.socket:", host: "privacyidea.ncsglobalinc.com"
2020/11/12 13:02:23 [crit] 1227#1227: *75 connect() to unix:/run/uwsgi/app/privacyidea/privacyidea.socket failed (2: No such file or directory) while connecting to upstream, client: 172.16.1.1, server: mfa_proxy, request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/app/privacyidea/privacyidea.socket:", host: "privacyidea.ncsglobalinc.com", referrer: "https://privacyidea.ncsglobalinc.com/"
Clearly, the calls to the UWSGI socket are failing.
I’ll deeply appreciate any help getting the daemons back and configuring them to stay back after subsequent reboots.