Docker port issue

I am in the process setting up PMM using the docker in a linux machine.
while trying to launch the PMM server i am getting the below port connectivity error.

[aquaman@lxrepfmsdev01 ~]$ docker run -d -p 80:80 -p 449:443 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
docker: Error response from daemon: Conflict. The container name "/pmm-server" is already in use by container "3da7c52b1f23f697454016a9b7f5fdecde20a29dfb7549c7ff64df41036c332c". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
[aquaman@lxrepfmsdev01 ~]$ docker rm pmm-server
pmm-server
[aquaman@lxrepfmsdev01 ~]$ docker run -d -p 80:81 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
cabce5daf0add28089a933831f5d9c342d5f1bd5f6ca0d226bcf2e5f4994bed4
docker: Error response from daemon: driver failed programming external connectivity on endpoint pmm-server (ef4352dd32eb2c198c0c85266c624bc441447959fd501c8947999e224bece855): Error starting userland proxy: listen tcp6 [::]:80: socket: address family not supported by protocol.
[aquaman@lxrepfmsdev01 ~]$ docker rm pmm-server
pmm-server
[aquaman@lxrepfmsdev01 ~]$ docker run -d -p 81:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
a1402eea929b3ff50449488f31456646023111287497e60b42da17bf5f3820ae
docker: Error response from daemon: driver failed programming external connectivity on endpoint pmm-server (ca50037571a3b41db2e99503e2a10ebe425a79229585b676a25334baef73945c): Error starting userland proxy: listen tcp6 [::]:81: socket: address family not supported by protocol.
[aquaman@lxrepfmsdev01 ~]$ docker rm pmm-server
pmm-server
[aquaman@lxrepfmsdev01 ~]$ docker run -d -p 8081:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
cf04ce1194cf70552c67dffc919e904770e8dab3987ad594dbe77a557a897478
docker: Error response from daemon: driver failed programming external connectivity on endpoint pmm-server (6350d5a6938687fd34837885774a62dbada5c0f55574c42163d47392b4be8b50): Error starting userland proxy: listen tcp6 [::]:8081: socket: address family not supported by protocol.
[aquaman@lxrepfmsdev01 ~]$ docker rm pmm-server
pmm-server
[aquaman@lxrepfmsdev01 ~]$ docker run -d -p 8080:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server:2
5f0f9a0f3b6872251649a3f039c96351f24004db29b6476b016f61a1b28ac53f
docker: Error response from daemon: driver failed programming external connectivity on endpoint pmm-server (a504e5321039ecc52f1da6d05cd8ce9c32668f2e29932b6bdd97788744a99654): Error starting userland proxy: listen tcp6 [::]:8080: socket: address family not supported by protocol.

I have tried using multiple ports and tried updating the ipv6 settings like mentioned in the below link .

But none of them seems to work.

Docker version details:

[aquaman@lxrepfmsdev01 ~]$ docker version
Client: Docker Engine - Community
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        370c289
 Built:             Fri Apr  9 22:45:33 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:43:57 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0

Can somebody help me on addressing this error ?

Hi @velumal thank you for posting!
I tried to reproduce your scenario but I cannot. I provisioned an Ubuntu 20.04 instance and installed Docker stable. I was able to bring up PMM Server cleanly:

root@ubuntu-s-1vcpu-1gb-nyc3-01:~# docker ps -a
CONTAINER ID   IMAGE                  COMMAND                CREATED         STATUS                   PORTS                                           NAMES
9c07cbdc88a2   percona/pmm-server:2   "/opt/entrypoint.sh"   5 minutes ago   Up 5 minutes (healthy)   80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   pmm-server
33be1b4e5be2   percona/pmm-server:2   "/bin/true"            5 minutes ago   Created                                                                  pmm-data

Here are the commands I executed:

apt-get remove docker docker-engine docker.io containerd runc
apt-get install     apt-transport-https     ca-certificates     curl     gnupg     lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get install docker-ce docker-ce-cli containerd.io
systemctl start docker
docker create --volume /srv --name pmm-data percona/pmm-server:2 /bin/true
docker run --detach --restart always --publish 443:443 --volumes-from pmm-data --name pmm-server percona/pmm-server:2

PMM Server does not require IPv6 so if this appears to be a source of contention you can safely disable it in docker and at the OS level.

1 Like

Thank you so much Michael.

Just to get clarity, can I run the below commands in the existing docker instance ?

1 Like

Hi @velumal
The commands I posted are intended to be executed from the linux host outside of the container, they are what I used to deploy a new PMM Server from scratch.

1 Like

Thanks Mike.
I often get this error in my PMM server.

How do i resolve this ?

2 Likes

Hi @velumal
This error is due to grafana not being able to start properly. The cause I usually see is due to disk-full conditions, check whether you have exhausted all space on the mountpoint where you store your docker volumes (usually under /var/lib/docker).

1 Like