0

I had a wg-easy (https://github.com/wg-easy/wg-easy) docker container running well for months, but one day I could not connect. I found the container stopped so I attempted to restart it, but it complained that the port 51820/udp was already in use.

I could not find a process associated with the port using netstat -tulpn.

First thing I tried was making sure I reinstalled the proper docker from the website's documentation (since I was using snap before). Then I made sure all the docker containers were removed. After that, I did some reboots and restarted networking a few times. This was repeated after each of the following attempts to fix the issue.

I tested a solution that seemed promising from studgeek: netstat shows a listening port with no pid but lsof does not

However, after using the inode associated with the port, I was only able to find an associated PID once. After attempting to kill that PID, no other PIDs associated with that port appeared again (I reran ss -tulpne to get the new inode for the open port).

netstat -tulpne shows

udp    UNCONN  0       0                                 0.0.0.0:51820          0.0.0.0:*      ino:10007 sk:5 cgroup:unreachable:138a <->

I also tried using fuser and rpcinfo -p as suggested by several answers on stack overflow but to no avail.

Appreciate any help! The fact that it persists across reboots really has me feeling a little stuck just short of completely reinstalling Ubuntu. I also tried reboots with docker/docker.socket disabled and stopped.

Additional details: This is running on Ubuntu 24.02 Server on a mini pc with 8 GB RAM.

1 Answers1

0

A friend suggested I try "rmmod wireguard since WireGuard is a kernel module and might not have an associated process ID." That immediately unbound the port.

Lesson here is to check for conflicting installations. Turns out I had installed WireGuard prior to going for a containerized solution, and it took the port the first opportunity it had. Followed the rmmod with apt remove wireguard.

Dave M
  • 4,494