Hi all,
TL;DR: I had a problem (solved now) with voice and videochat on Matrix. There seemed something wrong with the external IP in /etc/matrix-synapse/coturn.conf
, there was %\n behind it (newline?).
After recreating the config, things started working again. (I think I used a YNH-command for it, but I didn’t get a chance to document it before my log became unavailable)
Now I just upgraded Synapse, keeping a bit of an eye on it because of earlier trouble. I noticed the script recreates the config, complete with %\n
behind the IP. This time coturn does not seem to care, yunohost service restart coturn-synapse
completes without error.
I’m confused
My YunoHost server
Hardware: Proxmox on AMD x64
YunoHost version:
I have access to my server : SSH, web, keyboard if need be
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If your request is related to an app, specify its name and version: app Matrix-synapse 1.94, coturn-synapse
Description of my issue
Below is the text in the CLI while upgrading over SSH. Notice a warning about config change, -external-ip=45.138.52.95
and +external-ip=45.138.52.95%\n
:
Info: Now upgrading synapse...
Info: [....................] > Loading installation settings...
Info: [+...................] > Ensuring downward compatibility...
Info: [#+++++++............] > Backing up the app before upgrading (may take a while)...
Info: [########++..........] > Upgrading dependencies...
Info: [##########++........] > Upgrading source files...
Info: [############........] > Updating synapse config...
Info: [############+.......] > Upgrading NGINX web server configuration...
Info: [#############.......] > Configuring application...
Info: [#############.......] > Updating Coturn config...
Warning: File /etc/matrix-synapse/coturn.conf has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
Warning: --- /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908 2023-10-22 12:41:05.763359952 +0000
Warning: +++ /etc/matrix-synapse/coturn.conf 2023-10-23 12:49:09.433364101 +0000
Warning: @@ -26,4 +26,4 @@
Warning: pidfile=/run/coturn-synapse/turnserver.pid
Warning: simple-log
Warning: -external-ip=45.138.52.95
Warning: +external-ip=45.138.52.95%\n
Info: [#############+......] > Upgrading systemd configuration...
Info: [##############++....] > Reconfiguring Fail2Ban...
Info: The service fail2ban has correctly executed the action reload-or-restart.
Info: [################....] > Configuring permissions...
Warning: Additional URL 'osba.nl/.well-known/matrix' already removed in the additional URL for permission 'synapse.server_api'
Info: [################++..] > Restarting Synapse services...
Info: The service matrix-synapse has correctly executed the action restart.
Info: [####################] > Upgrade of synapse completed
Success! synapse upgraded
Snippet of the log mentioning the external-ip and a warning of config change:
2023-10-23 12:49:07,663: INFO - [#############.......] > Updating Coturn config...
2023-10-23 12:49:07,664: DEBUG - ++ curl -s ip.yunohost.org
2023-10-23 12:49:08,007: DEBUG - + public_ip4=xx.xx.xx.xx
2023-10-23 12:49:08,008: DEBUG - ++ curl -s ipv6.yunohost.org
2023-10-23 12:49:08,087: DEBUG - + public_ip6=
2023-10-23 12:49:08,088: DEBUG - + true
2023-10-23 12:49:08,088: DEBUG - + turn_external_ip=
2023-10-23 12:49:08,088: DEBUG - + '[' -n xx.xx.xx.xx ']'
2023-10-23 12:49:08,088: DEBUG - + ynh_validate_ip4 --ip_address=xx.xx.xx.xx
2023-10-23 12:49:08,107: DEBUG - + ynh_validate_ip --family=4 --ip_address=xx.xx.xx.xx
2023-10-23 12:49:08,158: DEBUG - + '[' 4 == 4 ']'
2023-10-23 12:49:08,159: DEBUG - + python3 /dev/stdin
2023-10-23 12:49:08,206: DEBUG - + turn_external_ip+='external-ip=xx.xx.xx.xx%\n'
2023-10-23 12:49:08,206: DEBUG - + '[' -n '' ']'
2023-10-23 12:49:08,206: DEBUG - + ynh_add_config --template=turnserver.conf --destination=/etc/matrix-synapse/coturn.conf
2023-10-23 12:49:08,255: DEBUG - + '[' -f /var/cache/yunohost/app_tmp_work_dirs/app_js2rxhag/conf/turnserver.conf ']'
2023-10-23 12:49:08,255: DEBUG - + template_path=/var/cache/yunohost/app_tmp_work_dirs/app_js2rxhag/conf/turnserver.conf
2023-10-23 12:49:08,256: DEBUG - + ynh_backup_if_checksum_is_different --file=/etc/matrix-synapse/coturn.conf
2023-10-23 12:49:08,271: DEBUG - + local checksum_setting_name=checksum__etc_matrix-synapse_coturn.conf
2023-10-23 12:49:08,271: DEBUG - ++ ynh_app_setting_get --app=synapse --key=checksum__etc_matrix-synapse_coturn.conf
2023-10-23 12:49:08,272: DEBUG - ++ local _globalapp=synapse
2023-10-23 12:49:08,321: DEBUG - ++ app=synapse
2023-10-23 12:49:08,321: DEBUG - ++ [[ checksum__etc_matrix-synapse_coturn.conf =~ (unprotected|protected|skipped)_ ]]
2023-10-23 12:49:08,321: DEBUG - ++ ynh_app_setting get synapse checksum__etc_matrix-synapse_coturn.conf
2023-10-23 12:49:08,400: DEBUG - + local checksum_value=2940a02137cef01f94b298244c8f09a3
2023-10-23 12:49:08,401: DEBUG - + backup_file_checksum=
2023-10-23 12:49:08,401: DEBUG - + '[' -n 2940a02137cef01f94b298244c8f09a3 ']'
2023-10-23 12:49:08,401: DEBUG - + '[' -e /etc/matrix-synapse/coturn.conf ']'
2023-10-23 12:49:08,401: DEBUG - + md5sum --check --status
2023-10-23 12:49:08,405: DEBUG - ++ date +%Y%m%d.%H%M%S
2023-10-23 12:49:08,407: DEBUG - + backup_file_checksum=/var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
2023-10-23 12:49:08,408: DEBUG - ++ dirname /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
2023-10-23 12:49:08,410: DEBUG - + mkdir --parents /var/cache/yunohost/appconfbackup//etc/matrix-synapse
2023-10-23 12:49:08,413: DEBUG - + cp --archive /etc/matrix-synapse/coturn.conf /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
2023-10-23 12:49:08,416: DEBUG - + ynh_print_warn 'File /etc/matrix-synapse/coturn.conf has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908'
2023-10-23 12:49:08,432: DEBUG - + ynh_print_log 'File /etc/matrix-synapse/coturn.conf has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908'
2023-10-23 12:49:08,433: DEBUG - + echo -e 'File /etc/matrix-synapse/coturn.conf has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908'
2023-10-23 12:49:08,433: DEBUG - + echo /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
2023-10-23 12:49:08,433: DEBUG - /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
2023-10-23 12:49:08,438: WARNING - File /etc/matrix-synapse/coturn.conf has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/matrix-synapse/coturn.conf.backup.20231023.124908
My actual coturn.config in /etc/matrix-synapse indeed has the %/n in the IP:
....
external-ip=45.138.52.95%\n
~
"/etc/matrix-synapse/coturn.conf" 29 lines, 529 bytes
I had intended to post my solution to the earlier solution, but unfortunately the details are no longer available (I relied on bash history in screen
, but after a power cut the history of the ‘wrong’ session was in bash history; the log of the actual error in the coturn log does not seem to be available anymore after upgrading matrix-synapse, journalctl does not show me the log I’m after) .
The log mentioned something along the lines of
turnserver[426]: 0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
turnserver[426]: 0: : ===========Discovering listener addresses: =========
turnserver[426]: 0: : ERROR: main: Cannot configure any meaningful IP listener address
systemd[1]: Started Coturn.
turnserver[215839]: error resolving '45.138.52.95%\n' hostname: Name or service not known
systemd[1]: Stopping Coturn...
(I copied some lines from journalctl that showed up, but the timestamps are not from the times I was troubleshooting and got these errors on the CLI)
Anyway, I’d love to hear what the right setting is, even if it works now; for everyone getting to this thread because Matrix / Element voice and video chat do not connect, maybe my story helps you