glasskube / glasskube

🧊 The next generation Package Manager for Kubernetes 📦 Featuring a GUI and a CLI. Glasskube packages are dependency aware, GitOps ready and can get automatic updates via a central public package repository.
https://glasskube.dev
Apache License 2.0
2.9k stars 172 forks source link

Check if port 3000 is already in use #306

Closed berendt closed 6 months ago

berendt commented 6 months ago

It is assumed that port 3000 can be used in the forwarding. In my case, however, a Docusaurus process is already running on port 3000. An error should occur at this point or another port should be used. Instead, the browser was simply opened on port 3000 (where Docusaurus was running)

ui   |I| Forwarding from 127.0.0.1:3000 -> 80
pmig commented 6 months ago

Which version of Glasskube have you tested?

tldr:

We are actually doing it already, but the Docusaurus (node) webserver is a specific case. It binds on all interfaces and not only on localhost, but we don't want to bind on all network interfaces for security purposes.

_You can read about the full technical details in the original pull request review comment: https://github.com/glasskube/glasskube/pull/208#discussion_r1481948763_

berendt commented 6 months ago

Tested with

$ glasskube --version
glasskube version 0.0.3
kosmoz commented 6 months ago

Hi @berendt, thank you for your report! As @pmig already mentioned, such a check is already in place, although the error is not really propagated to the UI yet.

I just tried the same (also running a docusaurus dev server in the background) and got the correct error message:

could not open cyclops: could not open entrypoint ui: tcp port 3000 is not free

Could you please try to reproduce this bug again and then run netstat -ntlp. The output could be very helpful for us.

kosmoz commented 6 months ago

Another issue that can happen in this situation is that the browser still has a cached version of the other site. This can happen even if the docusaurus dev server is no longer running. Reloading the page once usually resolves this issue.

christophenne commented 6 months ago

@berendt we are closing this issue now, if it still persists feel free to open again.