[Solved] Matrix synapse internal 500 error

im getting a internal error on matrix app when i click it
how do i fix this and is it possible to make a make a new user name here is the log

Did you try to wait a long (more than 10min) amount of time and then re-try if it works? I think I ran into this but it was just due to FreedomBox needing time to do some installation in the background.

@ohioman3, Log is missing from your post, in case you intended to post it. Also does the problem occur when you try to install it or even before you see the installation page? Or is the app already installed and you get the error when you try to visit the page?

its after i installed the matrix this problem happened after i tried to make a certificate for my domain name and now matrix is unusable i tried waiting not sure what to do i cant uninstall the app to try again so im stuck .

is there a way to make a new login username to restart the process?

also heres the logs
– Logs begin at Thu 2019-06-20 02:40:52 UTC, end at Thu 2019-06-20 02:45:50 UTC. –
Jun 20 02:41:39 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/pagekite’, ‘is-disabled’]
Jun 20 02:41:39 freedombox sudo[1021]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/pagekite is-disabled
Jun 20 02:41:39 freedombox sudo[1021]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:41:43 freedombox sudo[1021]: pam_unix(sudo:session): session closed for user root
Jun 20 02:41:43 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/pagekite’, ‘get-kite’]
Jun 20 02:41:44 freedombox sudo[1029]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/pagekite get-kite
Jun 20 02:41:44 freedombox sudo[1029]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:41:48 freedombox sudo[1029]: pam_unix(sudo:session): session closed for user root
Jun 20 02:41:48 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/pagekite’, ‘get-frontend’]
Jun 20 02:41:48 freedombox sudo[1033]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/pagekite get-frontend
Jun 20 02:41:48 freedombox sudo[1033]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:41:51 freedombox sudo[1033]: pam_unix(sudo:session): session closed for user root
Jun 20 02:41:51 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/cockpit’, ‘add-domain’, None]
Jun 20 02:41:51 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/letsencrypt’, ‘get-status’]
Jun 20 02:41:51 freedombox sudo[1040]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt get-status
Jun 20 02:41:51 freedombox sudo[1040]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:41:54 freedombox sudo[1040]: pam_unix(sudo:session): session closed for user root
Jun 20 02:41:54 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/letsencrypt’, ‘manage_hooks’, ‘status’]
Jun 20 02:41:54 freedombox sudo[1044]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/letsencrypt manage_hooks status
Jun 20 02:41:54 freedombox sudo[1044]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:41:58 freedombox sudo[1044]: pam_unix(sudo:session): session closed for user root
Jun 20 02:41:58 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/tor’, ‘get-status’]
Jun 20 02:41:58 freedombox sudo[1049]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/tor get-status
Jun 20 02:41:58 freedombox sudo[1049]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:43:01 freedombox sudo[1049]: pam_unix(sudo:session): session closed for user root
Jun 20 02:43:01 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/cockpit’, ‘add-domain’, ‘qe7xqtf7jztlatykdnq3bmxjjv2kwcvd227ioakenyqrddrlcpyttvyd.onion’]
Jun 20 02:43:01 freedombox sudo[1058]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/cockpit add-domain qe7xqtf7jztlatykdnq3bmxjjv2kwcvd227ioakenyqrddrlcpyttvyd.onion
Jun 20 02:43:01 freedombox sudo[1058]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:43:02 freedombox sudo[1058]: pam_unix(sudo:session): session closed for user root
Jun 20 02:43:02 freedombox /usr/bin/plinth[410]: Error executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/cockpit’, ‘add-domain’, ‘qe7xqtf7jztlatykdnq3bmxjjv2kwcvd227ioakenyqrddrlcpyttvyd.onion’], , Traceback (most recent call last):
File “/usr/share/plinth/actions/cockpit”, line 139, in
main()
File “/usr/share/plinth/actions/cockpit”, line 135, in main
subcommand_method(arguments)
File “/usr/share/plinth/actions/cockpit”, line 107, in subcommand_add_domain
aug.save()
File “/usr/lib/python3/dist-packages/augeas.py”, line 488, in save
raise IOError(“Unable to save to file!”)
OSError: Unable to save to file!
Jun 20 02:43:02 freedombox /usr/bin/plinth[410]: Added domain qe7xqtf7jztlatykdnq3bmxjjv2kwcvd227ioakenyqrddrlcpyttvyd.onion of type hiddenservice with services [‘http’, ‘https’, ‘ssh’]
Jun 20 02:43:02 freedombox /usr/bin/plinth[410]: Running regular setup.
Jun 20 02:43:02 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/packages’, ‘is-package-manager-busy’]
Jun 20 02:43:02 freedombox /usr/bin/plinth[410]: Setting up CherryPy server
Jun 20 02:43:02 freedombox sudo[1063]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/packages is-package-manager-busy
Jun 20 02:43:02 freedombox sudo[1063]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Listening for SIGTERM.
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Listening for SIGHUP.
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Listening for SIGUSR1.
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Bus STARTING
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Started monitor thread ‘_TimeoutMonitor’.
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Serving on http://127.0.0.1:8000
Jun 20 02:43:03 freedombox /usr/bin/plinth[410]: [20/Jun/2019:02:43:03] ENGINE Bus STARTED
Jun 20 02:43:03 freedombox sudo[1063]: pam_unix(sudo:session): session closed for user root
Jun 20 02:43:04 freedombox /usr/bin/plinth[410]: Running setup for modules, essential - True, selected modules - None
Jun 20 02:43:04 freedombox /usr/bin/plinth[410]: Setup thread finished.
Jun 20 02:45:06 freedombox /usr/bin/plinth[410]: AXES: Successful login by {user: ‘test1’, ip: ‘192.168.1.78’, user-agent: ‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36’, path: ‘/accounts/login/’}.
Jun 20 02:45:06 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/auth-pubtkt’, ‘generate-ticket’, ‘–uid’, ‘test1’, ‘–private-key-file’, ‘/etc/apache2/auth-pubtkt-keys/privkey.pem’, ‘–tokens’, ‘admin’]
Jun 20 02:45:06 freedombox sudo[1183]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/auth-pubtkt generate-ticket --uid test1 --private-key-file /etc/apache2/auth-pubtkt-keys/privkey.pem --tokens admin
Jun 20 02:45:06 freedombox sudo[1183]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:09 freedombox sudo[1183]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:09 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/users’, ‘get-user-groups’, ‘test1’]
Jun 20 02:45:09 freedombox sudo[1187]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/users get-user-groups test1
Jun 20 02:45:09 freedombox sudo[1187]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:11 freedombox ldapsearch[1230]: DIGEST-MD5 common mech free
Jun 20 02:45:11 freedombox ldapsearch[1235]: DIGEST-MD5 common mech free
Jun 20 02:45:11 freedombox ldapsearch[1245]: DIGEST-MD5 common mech free
Jun 20 02:45:11 freedombox ldapsearch[1255]: DIGEST-MD5 common mech free
Jun 20 02:45:12 freedombox ldapsearch[1271]: DIGEST-MD5 common mech free
Jun 20 02:45:12 freedombox sudo[1187]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:17 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/users’, ‘get-user-groups’, ‘test1’]
Jun 20 02:45:17 freedombox sudo[1280]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/users get-user-groups test1
Jun 20 02:45:17 freedombox sudo[1280]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:19 freedombox ldapsearch[1323]: DIGEST-MD5 common mech free
Jun 20 02:45:19 freedombox ldapsearch[1328]: DIGEST-MD5 common mech free
Jun 20 02:45:19 freedombox ldapsearch[1338]: DIGEST-MD5 common mech free
Jun 20 02:45:19 freedombox ldapsearch[1348]: DIGEST-MD5 common mech free
Jun 20 02:45:19 freedombox ldapsearch[1364]: DIGEST-MD5 common mech free
Jun 20 02:45:20 freedombox sudo[1280]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:29 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/users’, ‘get-user-groups’, ‘test1’]
Jun 20 02:45:29 freedombox sudo[1373]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/users get-user-groups test1
Jun 20 02:45:29 freedombox sudo[1373]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:31 freedombox ldapsearch[1416]: DIGEST-MD5 common mech free
Jun 20 02:45:31 freedombox ldapsearch[1421]: DIGEST-MD5 common mech free
Jun 20 02:45:31 freedombox ldapsearch[1431]: DIGEST-MD5 common mech free
Jun 20 02:45:31 freedombox ldapsearch[1441]: DIGEST-MD5 common mech free
Jun 20 02:45:31 freedombox ldapsearch[1457]: DIGEST-MD5 common mech free
Jun 20 02:45:31 freedombox sudo[1373]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:36 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/users’, ‘get-user-groups’, ‘test1’]
Jun 20 02:45:36 freedombox sudo[1466]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/users get-user-groups test1
Jun 20 02:45:36 freedombox sudo[1466]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:37 freedombox ldapsearch[1509]: DIGEST-MD5 common mech free
Jun 20 02:45:37 freedombox ldapsearch[1514]: DIGEST-MD5 common mech free
Jun 20 02:45:37 freedombox ldapsearch[1524]: DIGEST-MD5 common mech free
Jun 20 02:45:37 freedombox ldapsearch[1534]: DIGEST-MD5 common mech free
Jun 20 02:45:38 freedombox ldapsearch[1550]: DIGEST-MD5 common mech free
Jun 20 02:45:38 freedombox sudo[1466]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:40 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/matrixsynapse’, ‘public-registration’, ‘status’]
Jun 20 02:45:40 freedombox sudo[1561]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/matrixsynapse public-registration status
Jun 20 02:45:40 freedombox sudo[1561]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:42 freedombox sudo[1561]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:42 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/matrixsynapse’, ‘letsencrypt’, ‘get-status’]
Jun 20 02:45:42 freedombox sudo[1565]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/matrixsynapse letsencrypt get-status
Jun 20 02:45:42 freedombox sudo[1565]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jun 20 02:45:44 freedombox sudo[1565]: pam_unix(sudo:session): session closed for user root
Jun 20 02:45:44 freedombox /usr/bin/plinth[410]: Error executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/matrixsynapse’, ‘letsencrypt’, ‘get-status’], , Traceback (most recent call last):
File “/usr/share/plinth/actions/matrixsynapse”, line 251, in
main()
File “/usr/share/plinth/actions/matrixsynapse”, line 247, in main
sub_command_method(arguments)
File “/usr/share/plinth/actions/matrixsynapse”, line 223, in subcommand_letsencrypt
print(‘valid’ if _get_certificate_status() else ‘invalid’)
File “/usr/share/plinth/actions/matrixsynapse”, line 82, in _get_certificate_status
if filecmp.cmp(source_certificate_path, dest_certificate_path) and
File “/usr/lib/python3.7/filecmp.py”, line 51, in cmp
s1 = _sig(os.stat(f1))
FileNotFoundError: [Errno 2] No such file or directory: ‘/etc/letsencrypt/live/matrix-synapse/fullchain.pem’
Jun 20 02:45:45 freedombox /usr/bin/plinth[410]: Internal Server Error: /plinth/apps/matrixsynapse/
Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/usr/lib/python3/dist-packages/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/usr/lib/python3/dist-packages/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/usr/lib/python3/dist-packages/django/views/generic/base.py”, line 68, in view
return self.dispatch(request, *args, **kwargs)
File “/usr/lib/python3/dist-packages/plinth/modules/matrixsynapse/views.py”, line 75, in dispatch
return super().dispatch(request, *args, **kwargs)
File “/usr/lib/python3/dist-packages/django/views/generic/base.py”, line 88, in dispatch
return handler(request, *args, **kwargs)
File “/usr/lib/python3/dist-packages/django/views/generic/edit.py”, line 174, in get
return self.render_to_response(self.get_context_data())
File “/usr/lib/python3/dist-packages/plinth/modules/matrixsynapse/views.py”, line 83, in get_context_data
context[‘has_valid_certificate’] = has_valid_certificate()
File “/usr/lib/python3/dist-packages/plinth/modules/matrixsynapse/init.py”, line 167, in has_valid_certificate
status = actions.superuser_run(‘matrixsynapse’, [‘letsencrypt’, ‘get-status’])
File “/usr/lib/python3/dist-packages/plinth/actions.py”, line 118, in superuser_run
log_error=log_error)
File “/usr/lib/python3/dist-packages/plinth/actions.py”, line 208, in _run
raise ActionError(action, output, error)
plinth.errors.ActionError: (‘matrixsynapse’, ‘’, ‘Traceback (most recent call last):\n File “/usr/share/plinth/actions/matrixsynapse”, line 251, in \n main()\n File “/usr/share/plinth/actions/matrixsynapse”, line 247, in main\n sub_command_method(arguments)\n File “/usr/share/plinth/actions/matrixsynapse”, line 223, in subcommand_letsencrypt\n print(‘valid’ if _get_certificate_status() else ‘invalid’)\n File “/usr/share/plinth/actions/matrixsynapse”, line 82, in _get_certificate_status\n if filecmp.cmp(source_certificate_path, dest_certificate_path) and \\n File “/usr/lib/python3.7/filecmp.py”, line 51, in cmp\n s1 = _sig(os.stat(f1))\nFileNotFoundError: [Errno 2] No such file or directory: ‘/etc/letsencrypt/live/matrix-synapse/fullchain.pem’\n’)
Jun 20 02:45:50 freedombox /usr/bin/plinth[410]: Executing command - [‘sudo’, ‘-n’, ‘/usr/share/plinth/actions/help’, ‘get-logs’]
Jun 20 02:45:50 freedombox sudo[1569]: plinth : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/share/plinth/actions/help get-logs
Jun 20 02:45:50 freedombox sudo[1569]: pam_unix(sudo:session): session opened for user root by (uid=0)

Wort case scenario you can uninstall the app and reinstall. Unfortunately, unstalling is a bit of a painful process. Please login via SSH and run the following commands:

apt remove --purge matrix-synapse
apt autoremove
apt install -y sqlite3
echo "delete from plinth_module where name='matrixsynapse';" | sqlite3 /var/lib/plinth/plinth.sqlite3

Also please post the log in the 500 error page so that we can debug the issue. While you are connected via SSH you can also collect details logs by running the following command:

journalctl -u plinth > plinth.log

Then post plinth.log here.

Looking at the log, the certificate that is supposed to copied over is not found. Could you please try unchecking the “manage certificate for matrix-syanpse” checkbox in the lets encrypt page and then check it again?

theres no checkbox for matrix its just a domain im using the unstable version im not sure if its different from the stable version

thanks for the line of code i was able to install it again

okay now that ive done this when trying to create a new user for riot after inputing the domain name im getting this error on the riot.im app

Cannot reach homeserver

Ensure you have a stable internet connection, or get in touch with the server admin

these are my diagnostic restults from the freedombox

Diagnostic Results

Module: matrixsynapse

Listening on tcp4 port 8008 passed
Listening on tcp4 port 8448 passed
Access URL https://127.0.0.1/_matrix on tcp4 failed
Access URL https://[::1]/_matrix on tcp6 failed
Access URL https://192.168.1.72/_matrix on tcp4 failed
Access URL https://[fe80::2829:2987:750d:6a9e%enp0s3]/_matrix on tcp6 failed
Access URL https://localhost/_matrix on tcp4 failed
Access URL https://localhost/_matrix on tcp6 failed
Access URL https://freedombox/_matrix on tcp4 failed

Good to know that you were able to install again successfully. Thanks for creating a separate thread for the new problem. Marking this one as solved.

Don’t worry about the failed diagnostics, they don’t indicate that Matrix Synapse is actually faulty. We have corrected them in newer versions of FreedomBox.