/mail and /admin Nginx page issues after upgrading 0.50 -> 0.52

I just upgraded from version 0.50 to 0.52 and noticed that my /admin and /mail pages will no longer load correctly. The IP address and DNS entries for my DigitalOcean instance did not change. I can also still send/receive mail through the server from my iPhone.

I updated with the regular curl -s https://mailinabox.email/setup.sh | sudo bash execution and when I noticed the page loading issues, I attempted to rerun both that exact command as well as just mailinabox while logged in as root, then a reboot. None of this resolved the issues.

In the Nginx logs, I can see the following whenever /mail is accessed:

/var/log/nginx/access.log
{REMOTE IP ADDRESS} - - [07/Feb/2021:22:33:17 -0800] "GET /mail/ HTTP/2.0" 500 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"

/var/log/nginx/error.log

2021/02/07 22:34:19 [error] 19677#19677: *19 FastCGI sent in stderr: "PHP message: PHP Warning:  session_start(): Failed to read session data: user (path: /var/lib/php/sessions) in /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_session.php on line 136
PHP message: PHP Fatal error:  Uncaught Error: Undefined class constant 'MYSQL_ATTR_FOUND_ROWS' in /usr/local/lib/roundcubemail/program/lib/Roundcube/db/mysql.php:149
Stack trace:
#0 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php(152): rcube_db_mysql->dsn_options(Array)
#1 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php(138): rcube_db->conn_create(Array)
#2 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php(230): rcube_db->dsn_connect(Array, 'w')
#3 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php(416): rcube_db->db_connect('w', true)
#4 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php(379): rcube_db->_query('SELECT `vars`, ...', 0, 0, Array)
#5 /usr/local/lib/roundcubemail/program/lib/Roundcube/session/db.php(106): rcube_db->query('SELECT `vars`, ...', '{SESSION ID}')
#6 [internal function]: rcube_session_db->read('{SESSION ID}')
#7 /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_session.php(136): session_sta" while reading response header from upstream, client: {REMOTE IP ADDRESS}, server: {SERVER DNS NAME}, request: "GET /mail/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "{SERVER DNS NAME}"

The following is seen when /admin is accessed:

/var/log/nginx/access.log

{REMOTE IP ADDRESS} - - [07/Feb/2021:22:38:27 -0800] "GET /admin HTTP/2.0" 200 36619 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
{REMOTE IP ADDRESS} - - [07/Feb/2021:22:38:27 -0800] "GET /admin/assets/bootstrap/css/bootstrap.min.css HTTP/2.0" 403 124 "https://{SERVER DNS NAME}/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
{REMOTE IP ADDRESS} - - [07/Feb/2021:22:38:27 -0800] "GET /admin/assets/bootstrap/css/bootstrap-theme.min.css HTTP/2.0" 403 124 "https://{SERVER DNS NAME}/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
{REMOTE IP ADDRESS} - - [07/Feb/2021:22:38:27 -0800] "GET /admin/assets/jquery.min.js HTTP/2.0" 403 124 "https://{SERVER DNS NAME}/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"
{REMOTE IP ADDRESS} - - [07/Feb/2021:22:38:27 -0800] "GET /admin/assets/bootstrap/js/bootstrap.min.js HTTP/2.0" 403 124 "https://{SERVER DNS NAME}/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0"

/var/log/nginx/error.log

2021/02/07 22:41:12 [error] 19677#19677: *24 open() "/usr/local/lib/mailinabox/vendor/assets/bootstrap/css/bootstrap.min.css" failed (13: Permission denied), client: {REMOTE IP ADDRESS}, server: {SERVER DNS NAME}, request: "GET /admin/assets/bootstrap/css/bootstrap.min.css HTTP/2.0", host: "{SERVER DNS NAME}", referrer: "https://{SERVER DNS NAME}/admin"
2021/02/07 22:41:12 [error] 19677#19677: *24 open() "/usr/local/lib/mailinabox/vendor/assets/bootstrap/css/bootstrap-theme.min.css" failed (13: Permission denied), client: {REMOTE IP ADDRESS}, server: {SERVER DNS NAME}, request: "GET /admin/assets/bootstrap/css/bootstrap-theme.min.css HTTP/2.0", host: "{SERVER DNS NAME}", referrer: "https://{SERVER DNS NAME}/admin"
2021/02/07 22:41:12 [error] 19677#19677: *24 open() "/usr/local/lib/mailinabox/vendor/assets/jquery.min.js" failed (13: Permission denied), client: {REMOTE IP ADDRESS}, server: {SERVER DNS NAME}, request: "GET /admin/assets/jquery.min.js HTTP/2.0", host: "{SERVER DNS NAME}", referrer: "https://{SERVER DNS NAME}/admin"
2021/02/07 22:41:12 [error] 19677#19677: *24 open() "/usr/local/lib/mailinabox/vendor/assets/bootstrap/js/bootstrap.min.js" failed (13: Permission denied), client: {REMOTE IP ADDRESS}, server: {SERVER DNS NAME}, request: "GET /admin/assets/bootstrap/js/bootstrap.min.js HTTP/2.0", host: "{SERVER DNS NAME}", referrer: "https://{SERVER DNS NAME}/admin"

/mail does not load at all due to the 500 error and /admin partially loads but is missing all of its styling and interface because of the access issues.

In the journal logs for the mailinabox daemon, each GET for the admin page looks like this:
Feb 07 23:11:24 {SERVER DNS NAME} start[20219]: 127.0.0.1 - - [07/Feb/2021 23:11:24] "GET / HTTP/1.0" 200 -

If there are any recommended troubleshooting steps from this point, please let me know!

those {} are added by you or?

I added those in place of the IPs and DNS names that were there before. Apologies for the confusion.

Your nginx running under the correct user? When you do sudo ps -aux | grep nginx do you see the following?

www-data 1670 0.0 1.7 207312 17760 ? S 17:09 0:03 nginx: worker process

If you don’t, then try

sudo ./mailinabox/tools/web_update
sudo service nginx stop
sudo service nginx start

Yes, the worker is running under www-data.

> sudo ps aux | grep nginx
root     19675  0.0  0.1 198152  1700 ?        Ss   Feb07   0:00 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
www-data 19677  0.0  0.9 200832  9352 ?        S    Feb07   0:00 nginx: worker process
root     21654  0.0  0.0   7968   452 pts/1    S+   Feb07   0:00 tail -f /var/log/nginx/access.log

I’m getting the same errors. I cleared my cookies/cache as well just for sanity.

how about daemon.py, it’s suppose to run as root. sudo ps -aux | grep daemon.py

Yep, that is running as root. (Note: In the output, the Python file is located in my user’s home directory)

root 20219 0.0 3.9 202952 39856 ? Ss Feb07 0:13 python /home/{USER}/mailinabox/management/daemon.py

strange if it’s permission is okay. I sometimes get the same 500 error after I restart server, but I can get it up with nginx stop/start + clearing all cookies + cache.

I’m at a loss because I have never encountered any issues like this before. I’m inclined to believe it’s something specific to my VM or something else that I’ve managed to mess up since there aren’t any other similar/recent complaints, but I can’t find anything.

I also have tried multiple browsers. Same problems.

I filed a GitHub issue for additional visibility: https://github.com/mail-in-a-box/mailinabox/issues/1921

For anyone that joins the conversation at this point, I have migrated away from MIAB and self-hosting. Leaving this for reference for the future. I never could resolve it.