podman-desktop icon indicating copy to clipboard operation
podman-desktop copied to clipboard

Detection of port already in use fails

Open feloy opened this issue 1 year ago • 1 comments

Bug description

Steps to reproduce:

  • On Podman Desktop, go to the Images page

  • choose an image (for example nginx), and select the icon > (Create a container from image)

  • look at port mapping, it should be 9000

  • Start Container

  • Container should be running

  • choose the same image, and select again > (Create a container from image)

  • look at the port mapping, it should be 9001

On Mac, the port displayed is still 9000.

Debugging the code, I have seen that https://github.com/containers/podman-desktop/blob/main/packages/main/src/plugin/util/port.ts#L64C19-L64C20 tries to listen on 127.0.0.1:port, and on my system the detection fails. If I change to 0.0.0.0:port, the detection works correctly.

Operating system

mac m3 (Sonoma 14.3 (23D56))

Installation Method

None

Version

next (development version)

Steps to reproduce

No response

Relevant log output

No response

Additional context

No response

feloy avatar Feb 14 '24 11:02 feloy

Was able to reproduce this issue on M1 Pro with 100% repro rate, the port does not increment even though there is an active container already running.

cbr7 avatar Feb 19 '24 11:02 cbr7