I am trying to setup a Matrix server with this Ansible playbook: https://github.com/spantaleev/matrix-docker-ansible-deploy The basic setup works, but the Coturn container can not be started. I extracted the command which should start the container and run it on the command line:
/usr/bin/env docker run --rm --name matrix-coturn \
--log-driver=none \
--user=999:1001 \
--cap-drop=ALL \
--cap-add=NET_BIND_SERVICE \
--entrypoint=turnserver \
--read-only \
--tmpfs=/var/tmp:rw,noexec,nosuid,size=100m \
--network=matrix-coturn \
-p 3478:3478 \
-p 3478:3478/udp \
-p 5349:5349 \
-p 5349:5349/udp \
-p 49152-49172:49152-49172/udp \
--mount type=bind,src=/matrix/coturn/turnserver.conf,dst=/turnserver.conf,ro \
-v /matrix/ssl/config:/matrix/ssl/config:ro \
docker.io/coturn/coturn:4.5.2-r8-alpine \
-c /turnserver.conf
The result is:
docker: Error response from daemon: driver failed programming external connectivity on endpoint matrix-coturn (2f4ae9e860b8636ef3a7cc385679ffedc865d9ba8cb3a180e7992bf938e5290e): Error starting userland proxy:.
ERRO[0001] error waiting for container: context canceled
To pin down the problem I tried to start the container without the different -p arguments.
If I remove the UDP port range 49152-49172:49152-49172/udp the container can be started.
But warns, (obviously), about the missing ports.
Furthermore these ports are not bound by another process:
# sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 909/docker-proxy
tcp 0 0 0.0.0.0:8448 0.0.0.0:* LISTEN 820/docker-proxy
tcp 0 0 0.0.0.0:22022 0.0.0.0:* LISTEN 287/sshd: /usr/sbin
tcp 0 0 127.0.0.1:587 0.0.0.0:* LISTEN 331/sendmail: MTA:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 979/docker-proxy
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 175/systemd-resolve
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 331/sendmail: MTA:
tcp6 0 0 :::443 :::* LISTEN 923/docker-proxy
tcp6 0 0 :::8448 :::* LISTEN 874/docker-proxy
tcp6 0 0 :::22022 :::* LISTEN 287/sshd: /usr/sbin
tcp6 0 0 :::80 :::* LISTEN 994/docker-proxy
udp 0 0 127.0.0.53:53 0.0.0.0:* 175/systemd-resolve
I searched for the error message and I most cases there is an detailed message e.g. listen tcp 0.0.0.0:80: bind: An attempt was made to access a socket in a way forbidden by its access permissions..
But my detailed message is: .
These questions are similar but the do not have an (accepted) answer:
- https://www.reddit.com/r/docker/comments/pzfisa/error_starting_userland_proxy_when_starting/
- Docker/Docker-compose error starting userland proxy
I am using a Ubuntu 20.04 on a VPS. The version of Docker is 20.10.12.