"Error: Something went wrong" is back

I set up my new server and got a LE Certificate. All was well.

Can’t say what I did, but I wanted to check (…/admin#system_status) that all was set properly and got “Error. Something went wrong, sorry.”

Here’s the syslog.

Jun  9 21:38:26 box1 start[781]: [2022-06-09 21:38:26,625] ERROR in app: Exception on /system/status [POST]
Jun  9 21:38:26 box1 start[781]: Traceback (most recent call last):
Jun  9 21:38:26 box1 start[781]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
Jun  9 21:38:26 box1 start[781]:     response = self.full_dispatch_request()
Jun  9 21:38:26 box1 start[781]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
Jun  9 21:38:26 box1 start[781]:     rv = self.handle_user_exception(e)
Jun  9 21:38:26 box1 start[781]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
Jun  9 21:38:26 box1 start[781]:     rv = self.dispatch_request()
Jun  9 21:38:26 box1 start[781]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
Jun  9 21:38:26 box1 start[781]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
Jun  9 21:38:26 box1 start[781]:   File "/root/mailinabox/management/daemon.py", line 75, in newview

I saw in some issues that there was a cryptography error around v20. This doesn’t seem the same error though.

Is anything else not working?

Did you receive any messages from MiaB about errors?

All seems to be working fine, even the LE certificate.

The only message from MiaB is the one I posted that pops up when I select " System Status Checks" from the first pull down menu.

image

I found in the meantime that I can run this from the console:

:~/mailinabox/management# ./status_checks.py 

System
======
Missing privilege separation directory: /run/sshd
Traceback (most recent call last):
  File "./status_checks.py", line 1084, in <module>
    run_checks(False, env, ConsoleOutput(), pool)
  File "./status_checks.py", line 51, in run_checks
    if not run_services_checks(env, output, pool):
  File "./status_checks.py", line 91, in run_services_checks
    ret = pool.starmap(check_service, ((i, service, env) for i, service in enumerate(get_services())), chunksize=1)
  File "./status_checks.py", line 34, in get_services
    { "name": "SSH Login (ssh)", "port": get_ssh_port(), "public": True, },
  File "./status_checks.py", line 72, in get_ssh_port
    output = shell('check_output', ['sshd', '-T'])
  File "/root/mailinabox/management/utils.py", line 123, in shell
    ret = getattr(subprocess, method)(cmd_args, **kwargs)
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['sshd', '-T']' returned non-zero exit status 255.

The problem is described here: 16.04 - SSH failed to start - Missing privilege separation directory: /var/run/sshd - Ask Ubuntu

I think I can fix it, but is it something that should be taken care of by the mailinabox script?

UPDATE: Since I running MiaB in a lxc, my kernel version may be newer than expected.
According to this post it could be caused by an old kernel, but I’m running 5.15.

# uname -a
Linux box1.business.za.org 5.15.35-1-pve #1 SMP PVE 5.15.35-2 (Thu, 05 May 2022 13:54:35 +0200) x86_64 x86_64 x86_64 GNU/Linux

My system has neither /usr/lib/tmpfiles.d/sshd.conf nor /etc/init/ssh.conf so I think this is due to systemd being used by 18.04.

So I need some help to fix this please.

In the above the following appears:

Workaround 2: Use Cron job that will create /var/run/sshd and restart the SSH server, you can use the root’s crontab for this purpose - execute sudo crontab -e and add the following entry:

@reboot mkdir -p -m0755 /var/run/sshd && systemctl restart ssh.service

Currently I’m using this solution, so it is also tested.

This fixed it, but can we add a check for this into the MiaB script?

I see you marked this as “Unsupported Modifications” …

However, in the Pre-flight Checklist at Mail-in-a-Box Setup Guide it says:

What will it cost?
This is going to cost you about $12 per month. Most of the cost is in having a (virtual) machine connected to the Internet 24/7. You can divide this among friends and share your Mail-in-a-Box if you’d like to split it up.

We run a private hosting service for clients and all our Linux machines are LXC containers, not QEMU/KVM machines. Running LXCs is much more efficient and thus cost effective, so not having LXC supported as a platform removes this for entry level users. I’m specifically investigating how we can list this as an option for clients that want to host their private mail server with us.

Can we get involved and make the required code changes and submit them?

(If this was marked this way for other reasons, can you please briefly explain?)

The project source is hosted at GitHub and PRs are welcome, though no guarantees on what will be accepted.

However, do note that historically the project is focused on individual users far more than business applications of the project, itself (e.g., supporting application servers).

And, of course, the project is FOSS, so it can be forked. One popular fork that may not be what you are looking for is Power Mail-in-a-Box, but just to give an example of what can be done using MiaB.

1 Like