Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to expose port :443 -> 192.168.127.2:443: listen tcp :443: bind: address already in use #4124

Open
marindobeka opened this issue Apr 23, 2024 · 6 comments
Assignees
Labels
kind/bug Something isn't working priority/major

Comments

@marindobeka
Copy link

General information

  • OS: macOS
  • Hypervisor: vfkit
  • Did you run crc setup before starting it (Yes/No)? Yes
  • Running CRC on: Laptop

CRC version

CRC version: 2.34.1+b470b5
OpenShift version: 4.15.3
Podman version: 4.4.4

CRC status

DEBU CRC version: 2.34.1+b470b5
DEBU OpenShift version: 4.15.3
DEBU Podman version: 4.4.4
DEBU Running 'crc status'
CRC VM:          Stopped
OpenShift:       Stopped (v4.15.3)
RAM Usage:       0B of 0B
Disk Usage:      0B of 0B (Inside the CRC VM)
Cache Usage:     38.37GB
Cache Directory: /Users/usrmb/.crc/cache

CRC config

- consent-telemetry                     : no

Host Operating System

ProductName:		macOS
ProductVersion:		14.4.1
BuildVersion:		23E224

Steps to reproduce

  1. crc start

Expected

OpenShift cluster is started successfully

Actual

Following error is through while running the command crc start
failed to expose port :443 -> 192.168.127.2:443: listen tcp :443: bind: address already in use

Logs

https://gist.github.com/marindobeka/f4ae1b7737908aee27ec295068924d67
@marindobeka marindobeka added kind/bug Something isn't working status/need triage labels Apr 23, 2024
@cfergeau
Copy link
Contributor

Do you have a webserver or some podman machine container, or 'something' listening on your macbook on port 443?

@cfergeau
Copy link
Contributor

You can set crc config set ingress-https-port 7443 or to some other value to change the port crc will bind to.

@marindobeka
Copy link
Author

marindobeka commented Apr 23, 2024

Do you have a webserver or some podman machine container, or 'something' listening on your macbook on port 443?

I have checked with the following cmd, and everything looks ok.

netstat -a -n | grep 'LISTEN '

tcp4       0      0  127.0.0.1.444          *.*                    LISTEN
tcp4       0      0  127.0.0.1.6443         *.*                    LISTEN
tcp4       0      0  127.0.0.1.2222         *.*                    LISTEN
tcp6       0      0  ::1.42050              *.*                    LISTEN
tcp4       0      0  127.0.0.1.8182         *.*                    LISTEN
tcp4       0      0  127.0.0.1.4767         *.*                    LISTEN
tcp4       0      0  *.59869                *.*                    LISTEN
tcp6       0      0  *.5000                 *.*                    LISTEN
tcp4       0      0  *.5000                 *.*                    LISTEN
tcp6       0      0  *.7000                 *.*                    LISTEN
tcp4       0      0  *.7000                 *.*                    LISTEN
tcp6       0      0  *.49166                *.*                    LISTEN
tcp4       0      0  *.49166                *.*                    LISTEN
tcp6       0      0  ::1.3128               *.*                    LISTEN
tcp4       0      0  127.0.0.1.3128         *.*                    LISTEN
tcp4       0      0  127.0.0.1.631          *.*                    LISTEN
tcp6       0      0  ::1.631                *.*                    LISTEN
tcp4       0      0  127.0.0.1.8021         *.*                    LISTEN
tcp6       0      0  ::1.8021               *.*                    LISTEN

You can set crc config set ingress-https-port 7443 or to some other value to change the port crc will bind to.

Tried it, unfortunately, I get another error down the line:

INFO Adding crc-admin and crc-developer contexts to kubeconfig...
ERRO Cannot update kubeconfig: Head "https://oauth-openshift.apps-crc.testing": dial tcp 127.0.0.1:443: connect: connection refused
Started the OpenShift cluster.

The server is accessible via web console at:
  https://console-openshift-console.apps-crc.testing

Log in as administrator:
  Username: ....
  Password: .....

Log in as user:
  Username: ....
  Password: .....

Use the 'oc' command line interface:
  $ eval $(crc oc-env)
  $ oc login -u developer https://api.crc.testing:6443


Warning: Port 7443 is used for OpenShift HTTPS routes instead of the default
You have to add this port to HTTPS URLs when accessing OpenShift application,
such as https://myapp.apps-crc.testing:7443

The cluster is running, but it cannot be accessed.

@praveenkumar
Copy link
Member

INFO Adding crc-admin and crc-developer contexts to kubeconfig...
ERRO Cannot update kubeconfig: Head "https://oauth-openshift.apps-crc.testing": dial tcp 127.0.0.1:443: connect: connection refused
Started the OpenShift cluster.

This is something we fixed long time back, I am not sure why it is not checking with 7443 instead 443. Also you run this after crc delete => crc cleanup => crc setup => crc start ?

@marindobeka
Copy link
Author

INFO Adding crc-admin and crc-developer contexts to kubeconfig...
ERRO Cannot update kubeconfig: Head "https://oauth-openshift.apps-crc.testing": dial tcp 127.0.0.1:443: connect: connection refused
Started the OpenShift cluster.

This is something we fixed long time back, I am not sure why it is not checking with 7443 instead 443. Also you run this after crc delete => crc cleanup => crc setup => crc start ?

That is exactly the order in which I run the commands.

@praveenkumar
Copy link
Member

Looks like there is some regression on our user mode networking side and DialContext is not able to get oauth request :(

I tried an older version of crc-2.28 (around that time I put that code for this logic 2484015 ) and it works but with latest version it doesn't even using same bundle which we ship with 2.28 (so it is not regression on bundle side but on the networking side).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working priority/major
Projects
Status: Work In Progress
Development

No branches or pull requests

4 participants