Skip to content

matrixsynapse: Riot causes matrix-synapse to restart

I'm running plinth 0.38.0 on Raspberry Pi 3. I have configured the domain name, acquired a Let's Encrypt certificate, installed Matrix Synapse and set its domain.

The Matrix Synapse page shows that the service is running. However, if I go to https://riot.im/app/# and set the Home server URL to my domain, I get a message "Can't connect to homeserver". If I then reload the Matrix Synapse page in plinth, I see that the service is not running. After a few seconds, if I reload the page again, then it shows the service is running again.

journalctl shows the following error:

[None] SynapseSite (TLS) starting on 8448
[] Traceback (most recent call last):
[]   File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
[]     "__main__", fname, loader, pkg_name)
[]   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
[]     exec code in run_globals
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 582, in <module>
[]     main()
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 577, in main
[]     hs = setup(sys.argv[1:])
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 378, in setup
[]     hs.start_listening()
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 258, in start_listening
[]     self._listener_http(config, listener)
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/homeserver.py", line 158, in _listener_http
[]     self.tls_server_context_factory,
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/_base.py", line 175, in listen_ssl
[]     check_bind_error(e, address, bind_addresses)
[]   File "/usr/lib/python2.7/dist-packages/synapse/app/_base.py", line 196, in check_bind_error
[]     raise e
[] twisted.internet.error.CannotListenError: Couldn't listen on 0.0.0.0:8448: [Errno 98] Address already 
e.service: Main process exited, code=exited, status=1/FAILURE
e.service: Failed with result 'exit-code'.
e.service: Service RestartSec=3s expired, scheduling restart.
e.service: Scheduled restart job, restart counter is at 1343.
se Matrix homeserver.
pse Matrix homeserver...
se Matrix homeserver.
ne] ***** STARTING SERVER *****