With one of the last updates the access to control panel was broken.
When trying to access it I’ll get 500 error code “Internal Error 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.”
nginx-error.log contains this message: "*2144 “/home/user-data/www/default/admin/index.html” is not found " as well as “2256 open() “/home/user-data/www/default/.env” failed”.
I tried to reinstall Mail in a box twice. Didn’t change anything. Can I restore those files without complete reinstalling and restoring MiaB? I don’t know how long access does not work and so I can not rely on a consistent backup.
From the mailinabox install directory, run: sudo tools/web_update
And restart nginx
The file /home/user-data/www/default/admin/index.html should not be there. In fact, the box should not try to serve it to you if you access the admin page. Are you sure you’re using box.<domain>/admin to access the admin page?
Access to roundcube and nextcloud works like a charm.
I found those messages:
"Dec 23 14:33:20 gunicorn[2522]: Exception on / [GET]
Traceback (most recent call last):
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 1455, in wsgi_app
response = self.full_dispatch_request()
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 869, 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 867, in full_dispatch_request
rv = self.dispatch_request()
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/app.py”, line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File “/root/mailinabox/management/daemon.py”, line 128, in index
return render_template(‘index.html’,
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/templating.py”, line 151, in render_template
template = app.jinja_env.get_or_select_template(template_name_or_list)
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/jinja2/environment.py”, line 1081, in get_or_select_template
return self.get_template(template_name_or_list, parent, globals)
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/jinja2/environment.py”, line 1010, in get_template
return self._load_template(name, globals)
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/jinja2/environment.py”, line 969, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/jinja2/loaders.py”, line 126, in load
source, filename, uptodate = self.get_source(environment, name)
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/templating.py”, line 65, in get_source
return self._get_source_fast(environment, template)
File “/usr/local/lib/mailinabox/env/lib/python3.10/site-packages/flask/templating.py”, line 99, in _get_source_fast
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html
"
I think the best way is to restore the git repository that is your mailinabox installation directory. It is strange that these files are missing, and there might be other files missing as well.
What is the output of git status when run from the installation directory?
Then do a git status again. There should be no more deleted files.
Then check the control panel again, (perhaps another sudo systemctl restart mailinabox is needed)
After resetting and re-checking out everything worked.
Thank you very much for helping me solving this issue.
I checked the logs of my AV. There were no deletions recently.
What I found and I have to investigate is that these files
were identified by git status:
management/testdisk.log
wget-log
This is a VM in a datacenter where I have no access to run testdisk and ftp is not allowed