Steps 3 to 8 should not be necessary. Mail-in-a-Box detects the Nextcloud version number from the configuration file, which is stored under $STORAGE_ROOT. Did you get an error if you did not do this?
Because NC is two major version behind on Power MIAB, the automatic upgrade fails. When a manual v24 is installed, the upgrade succeeds.
Interesting, because the MiaB installation code should be able to cope with that. Do you know where or how it fails? Was there an error message? I know you come from a power MiaB installation, but it might still lead to an improvement of MiaB.
I’m about to do a migration from P-MiaB to MiaB, so I will report what happens exactly.
Pertaining to the experimental upgrade route (attempting to “upgrade” p-miab v.60 to maib v.73:
After regenerating the python environment, I get an HTML error 500 during the setup process:
Primary Hostname: box3.whatever.com
Public IP Address: 197.xxx.yyy.zzz
Private IP Address: 192.168.aaa.bbb
Mail-in-a-Box Version: v73
Updating system packages...
Installing system packages...
Initializing system random number generator...
Firewall is active and enabled on system startup
Synchronizing state of fail2ban.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable fail2ban
Installing nsd (DNS server)...
Installing Postfix (SMTP server)...
Installing Dovecot (IMAP server)...
Installing OpenDKIM/OpenDMARC...
Installing SpamAssassin...
Installing Nginx (web server)...
Installing Roundcube (webmail)...
Installing Nextcloud (contacts/calendar)...
Nextcloud is already latest version
Installing Z-Push (Exchange/ActiveSync server)...
Installing Mail-in-a-Box system management daemon...
Installing Munin (system monitoring)...
<!doctype html>
<html lang=en>
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>
-----------------------------------------------
Your Mail-in-a-Box is running.
However, I can’t find the error in any logs (even with grep), so what is generating this and where can I find the cause?
When I check the web interface, I get “error. Something went wrong, sorry” message on the status page, the users page, and an error 502 “Gateway not found” on the /cloud page.
/var/log/nginx/error.log has:
2025/10/26 09:15:05 [error] 14384#14384: *2875 open() "/usr/local/lib/owncloud/cloud/apps/richdocumentscode/proxy.php" failed (2: No such file or directory), client: 192.168.aaa.bbb, server: box3.whatever.com, request: "GET /cloud/cloud/apps/richdocumentscode/proxy.php?req=/hosting/capabilities HTTP/1.1", host: "box3.whatever.com"
2025/10/26 09:47:03 [crit] 477251#477251: *12 connect() to unix:/var/run/php/php-default.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.fff.ggg, server: box3.whatever.com, request: "GET /cloud/index.php/apps/contacts/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php-default.sock:", host: "box3.whatever.com", referrer: "https://box3.whatever.com/admin"
Check if there’s something reported by sudo journalctl -u mailinabox
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: [2025-10-26 17:29:38,402] ERROR in app: Exception on /ssl/status [GET]
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: Traceback (most recent call last):
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 1511, in wsgi_app
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: response = self.full_dispatch_request()
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 919, in full_dispatch_request
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: rv = self.handle_user_exception(e)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 917, in full_dispatch_request
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: rv = self.dispatch_request()
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 902, in dispatch_request
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/daemon.py", line 75, in newview
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: return viewfunc(*args, **kwargs)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/daemon.py", line 433, in ssl_get_status
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: provision, cant_provision = get_certificates_to_provision(env, show_valid_certs=False)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/ssl_certificates.py", line 186, in get_certificates_to_provision
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: plausible_web_domains = get_web_domains(env, exclude_dns_elsewhere=False)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/web_update.py", line 25, in get_web_domains
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: domains |= {'www.' + zone for zone, zonefile in get_dns_zones(env)}
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/dns_update.py", line 36, in get_dns_zones
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: domains = get_dns_domains(env)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/dns_update.py", line 29, in get_dns_domains
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: domains |= set(get_web_domains(env, include_www_redirects=False))
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/web_update.py", line 40, in get_web_domains
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: domains -= get_domains_with_a_records(env)
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/web_update.py", line 54, in get_domains_with_a_records
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: for domain, rtype, value in dns:
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: File "/root/mailinabox/management/dns_update.py", line 835, in get_custom_dns_config
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: raise ValueError
Oct 26 17:29:38 box2.gtahardware.co.za start[70832]: ValueError
Oct 26 17:29:38 box2.gtahardware.co.za gunicorn[70832]: Exception on /ssl/status [GET]
Traceback (most recent call last):
File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/root/mailinabox/management/daemon.py", line 75, in newview
return viewfunc(*args, **kwargs)
File "/root/mailinabox/management/daemon.py", line 433, in ssl_get_status
provision, cant_provision = get_certificates_to_provision(env, show_valid_certs=False)
File "/root/mailinabox/management/ssl_certificates.py", line 186, in get_certificates_to_provision
plausible_web_domains = get_web_domains(env, exclude_dns_elsewhere=False)
File "/root/mailinabox/management/web_update.py", line 25, in get_web_domains
domains |= {'www.' + zone for zone, zonefile in get_dns_zones(env)}
File "/root/mailinabox/management/dns_update.py", line 36, in get_dns_zones
domains = get_dns_domains(env)
File "/root/mailinabox/management/dns_update.py", line 29, in get_dns_domains
domains |= set(get_web_domains(env, include_www_redirects=False))
File "/root/mailinabox/management/web_update.py", line 40, in get_web_domains
domains -= get_domains_with_a_records(env)
File "/root/mailinabox/management/web_update.py", line 54, in get_domains_with_a_records
for domain, rtype, value in dns:
File "/root/mailinabox/management/dns_update.py", line 835, in get_custom_dns_config
raise ValueError
ValueError
I also receive this error on a new install, when I restore the backup and re-run “mailinabox”.
Do you have a custom.yaml file under $STORAGE_ROOT/dns? Looks like there´s an issue there. Perhaps some value that the Power MiaB recognizes?
Yes. I do, and it contains a substantial number or custom DNS entries.
However, this error occurs with all there URL’s:
gunicorn[70832]: Exception on /ssl/status [GET]
gunicorn[70832]: Exception on /dns/custom [GET]
gunicorn[70832]: Exception on /dns/custom [GET]
gunicorn[70832]: Exception on /web/update [POST]
gunicorn[60703]: Exception on /system/status [POST]
Full log here: mailinabox.log - Pastebin.com
Actually, if I remove the dns/custom.yml file, the errors go away, but I don’t have the dns entries anymore… So you’re right.
I’ll try to eliminate the components that are specific to Power-MIAB.
I found the issue. Power-MIAB adds TTL settings among other things to the DNS, which I was using. So in my custom.yaml file I had (for example):
light-living.co.za:
A:
value: 197.214.119.181
ttl: 300
MIAB doesn’t support that record layout in the file, so I had to change it to:
light-living.co.za:
A: 197.214.119.181
which resolved the problem.
Confirmed, I just looked at the Power MiaB code, and came here to say this ![]()
How is it looking overall?
Otherwise I don’t see any problems.
One of the things I’ve been looking forward to is the updated version of Nextcloud, specifically the ability to run Onlyoffice Community Server and the Onlyoffice Nextcloud app to edit spreadsheets or document online. I’m figuring out now what I need to do, since it doesn’t seem the authentication token is passed from the MIAB Nextcloud instance to the Onlyoffice Server Service.
That is however something for a different thread, so I won’t pursue that here.
It’s been running since yesterday evening and all seems fine as far as I can tell. Thanks for the assistance, @KiekerJan and @stylnchris!
You’re right @KiekerJan, the upgrade of Nextcloud happens automatically… not sure why it didn’t work the first time around. I may have started the service before running mailinabox setup again after restoring the backup.