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

[BUG] error: connect: connection refused - verify you have provided the correct host and port and that the server is currently running. #4121

Open
rtaparay opened this issue Apr 19, 2024 · 5 comments
Labels
kind/bug Something isn't working nested-virt To identify issues that are related to nested virtualization status/need triage

Comments

@rtaparay
Copy link

General information

  • OS: Linux
  • Hypervisor: KVM (WSL)
  • Did you run crc setup before starting it (Yes/No)? YES
  • Running CRC on: VM

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:          Running
OpenShift:       Unreachable (v4.15.3)
RAM Usage:       642.1MB of 10.96GB
Disk Usage:      19.02GB of 32.68GB (Inside the CRC VM)
Cache Usage:     26.29GB
Cache Directory: /home/rtaparay/.crc/cache

CRC config

- consent-telemetry                     : no

Host Operating System

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Steps to reproduce

  1. Install
    $ wget https://developers.redhat.com/content-gateway/rest/mirror/pub/openshift-v4/clients/crc/latest/crc-linux-amd64.tar.xz
    $ tar xvf crc-linux-amd64.tar.xz
    $ cd crc-linux-2.34.1-amd64
    $ sudo cp crc /usr/local/bin/
    $ crc setup
    $ crc start -> when prompted enter pull secret
    $ crc oc-env
    $ export PATH="/home/rtaparay/.crc/bin/oc:$PATH" // export PATH=$PATH:$HOME/bin
    $ echo 'export PATH="/home/rtaparay/.crc/bin/oc:$PATH"' >> .bashrc // echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
    [rtaparay@localhost ~]$ crc version
    CRC version: 2.33.0+c43b17
    OpenShift version: 4.14.12
    Podman version: 4.4.4

  2. crc start

INFO Loading bundle: crc_libvirt_4.15.3_amd64...
INFO A CRC VM for OpenShift 4.15.3 is already running
Started the OpenShift cluster.

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

Log in as administrator:
Username: kubeadmin
Password: tNXXXXX

Log in as user:
Username: developer
Password: developer

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

  1. login:
    oc login -u developer -p developer https://api.crc.testing:6443
    #error: dial tcp 172.30.31.54:6443: connect: connection refused - verify you have provided the correct host and port and that the server is currently running.

Expected

I would have logged in with the user developer

Actual

crc failed to start

Logs

Before gather the logs try following if that fix your issue

$ crc delete -f
$ crc cleanup
$ crc setup
$ crc start --log-level debug

DEBU SSH command results: err: Process exited with status 1, output:  
DEBU E0419 00:22:22.893426    7309 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": dial tcp 172.30.31.54:6443: connect: connection refused
E0419 00:22:22.894704    7309 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": dial tcp 172.30.31.54:6443: connect: connection refused  
E0419 00:22:22.899337    7309 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": dial tcp 172.30.31.54:6443: connect: connection refused  
E0419 00:22:22.900793    7309 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": dial tcp 172.30.31.54:6443: connect: connection refused  
E0419 00:22:22.902188    7309 memcache.go:265] couldn't get current server API group list: Get "https://api.crc.testing:6443/api?timeout=32s": dial tcp 172.30.31.54:6443: connect: connection refused  
The connection to the server api.crc.testing:6443 was refused - did you specify the right host or port?
DEBU error: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 1
 - sleeping 1s
DEBU RetryAfter timeout after 126 tries
DEBU Making call to close driver server
DEBU (crc) Calling .Close
DEBU Successfully made call to close driver server
DEBU Making call to close connection to plugin binary
DEBU (crc) DBG | time="2024-04-18T19:22:23-05:00" level=debug msg="Closing plugin on server side"
Error waiting for apiserver: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 1
 (x126)
 
@rtaparay rtaparay added kind/bug Something isn't working status/need triage labels Apr 19, 2024
@rtaparay rtaparay changed the title [BUG] [BUG] error: connect: connection refused - verify you have provided the correct host and port and that the server is currently running. Apr 19, 2024
@praveenkumar praveenkumar added the nested-virt To identify issues that are related to nested virtualization label Apr 22, 2024
@praveenkumar
Copy link
Member

@rtaparay Are you running crc in a linux environment which is running under wsl? This is something we never tested. Any reason why can't you use it directly on windows host instead this?

@bergner
Copy link

bergner commented Apr 23, 2024

This looks very similar to the experience I and some of my colleagues had when trying to run CRC 2.34.1 on Rocky 9 Linux and latest Manjaro Linux a few days after 2.34.1 was released. During crc start we ran into the errors below and the CRC system never became usable. We ended up reverting back to CRC 2.33 which worked fine.

INFO Waiting for kube-apiserver availability... [takes around 2min] 
Error waiting for apiserver: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 1
 (x2)
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 124
 
Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 1
 (x187)

@acornett21
Copy link

I've gotten the same error on Linux (fedora 39) since the switch to OCP 4.15.

Error waiting for apiserver: Temporary error: ssh command error:
command : timeout 5s oc get nodes --context admin --cluster crc --kubeconfig /opt/kubeconfig
err     : Process exited with status 1
 (x223)

@praveenkumar
Copy link
Member

We recently found out that due to recent change in the networking operator in 4.15 it does change the /etc/resolv.conf content on the instance which not able to resolve the api endpoint domains. Can you folks try #4144 (comment) one and see if that works?

@acornett21
Copy link

@praveenkumar I was able to download and test the files in #4144 and it seems to be working fine on Fedora 39. Below is some info.

~/Downloads/linux binary and rpm 
❯ ./crc version 
CRC version: 2.35.0+feaaa6
OpenShift version: 4.15.10
Podman version: 4.4.4

~/Downloads/linux binary and rpm 
❯ ./crc status
CRC VM:          Running
OpenShift:       Running (v4.15.10)
RAM Usage:       6.954GB of 16.77GB
Disk Usage:      24.4GB of 34.83GB (Inside the CRC VM)
Cache Usage:     50.56GB
Cache Directory: /home/acornett/.crc/cache

Let me know if you'd like to see more info. Thanks.

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 nested-virt To identify issues that are related to nested virtualization status/need triage
Projects
None yet
Development

No branches or pull requests

4 participants