/admin 502 Bad Gateway

hi
there is “502 Bad Gateway” when open https://mysite/admin after update.

root@mail:~/mailinabox/management# systemctl status mailinabox
● mailinabox.service - Mail-in-a-Box System Management Service
   Loaded: loaded (/lib/systemd/system/mailinabox.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2021-08-04 17:49:57 EEST; 2s ago
  Process: 24009 ExecStart=/usr/local/lib/mailinabox/start (code=exited, status=1/FAILURE)
 Main PID: 24009 (code=exited, status=1/FAILURE)

Aug 04 17:49:57 mail.ypi.com.ua start[24009]: Traceback (most recent call last):
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:   File "/root/mailinabox/management/daemon.py", line 17, in <module>
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:     import auth, utils
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:   File "/root/mailinabox/management/auth.py", line 7, in <module>
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:     from mfa import get_hash_mfa_state, validate_auth_mfa
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:   File "/root/mailinabox/management/mfa.py", line 5, in <module>
Aug 04 17:49:57 mail.ypi.com.ua start[24009]:     import pyotp
Aug 04 17:49:57 mail.ypi.com.ua start[24009]: ModuleNotFoundError: No module named 'pyotp'
Aug 04 17:49:57 mail.ypi.com.ua systemd[1]: mailinabox.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 17:49:57 mail.ypi.com.ua systemd[1]: mailinabox.service: Failed with result 'exit-code'.

So this is something to do with TOTP.

What MiaB version is this?

Have you modified any files?

Did you enable TOTP?

0.54 version now

no - all after upgrade from older version (as I remember less than 0.4)

can’t say - if it could be done from /admin panel - client may enable by himself.
can I see it from ssh root?

Did you try the recommended steps here:

The error you are seeing means that the admin panel is missing a python package that is expected to be installed.
pyotp was added in v0.51 and should be installed as part of the setup script (mailinabox/management.sh at 9b07d86bf786bda73bc8c5ad95d2d9cb9e08be3f · mail-in-a-box/mailinabox · GitHub).

as above poster suggested, running the maintenance steps should resolve the errors.

hi
I’ve tried sudo mailinabox, but had “Package PHP-XSL has no installation candidate” error
fixed by /root/mailinabox/setup/zpush.sh

<------>php-soap php-imap libawl-php hp-xsl

changed to

<------>php-soap php-imap libawl-php

but there is another problem:

root@mail:~/mailinabox/setup# systemctl status munin-node
● munin-node.service - Munin Node
Loaded: loaded (/lib/systemd/system/munin-node.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-08-18 10:26:11 EEST; 7s ago
Docs: man:munin-node(1)
munin-node — Munin 2.0.73-detached-2023-03-21-c1-g286dfb8f documentation
Process: 2556 ExecStart=/usr/sbin/munin-node $DAEMON_ARGS (code=exited, status=25)

Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Control process exited, code=exited status=25
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Failed with result ‘exit-code’.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: Failed to start Munin Node.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Service hold-off time over, scheduling restart.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Scheduled restart job, restart counter is at 5.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: Stopped Munin Node.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Start request repeated too quickly.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: munin-node.service: Failed with result ‘exit-code’.
Aug 18 10:26:11 mail.ypi.com.ua systemd[1]: Failed to start Munin Node.

This topic was automatically closed 40 days after the last reply. New replies are no longer allowed.