"Http failure response for /api/providers/vsphere" error during Tanzu Kubernetes Grid management cluster deployment through the UI
search cancel

"Http failure response for /api/providers/vsphere" error during Tanzu Kubernetes Grid management cluster deployment through the UI

book

Article ID: 319314

calendar_today

Updated On: 06-05-2024

Products

VMware Tanzu Kubernetes Grid VMware Tanzu Kubernetes Grid 1.x

Issue/Introduction

Symptoms:
You are using Tanzu Kubernetes Grid (TKG) UI to create a management cluster on vSphere. After you enter your vSphere credentials in the UI and click Connect, you observe the following error:

Failed to connect to the specified vCenter Server. Http failure response for /api/providers/vsphere:0 Unknown Error



 



Environment

VMware Tanzu Kubernetes Grid 1.x

Cause

This error occurs due to the following reasons:
  • Your previous tkg init attempt failed and the backend session has ended but you are trying to use the same browser tab to create a new TKG management cluster.
  • Your previous tkg init attempt failed and there are still stale connections left on the jump box.

Resolution

To resolve this issue, follow these steps:

1. Verify that there is no TKG process running on the system where you launched the UI from using this command: 

 ps -ef | grep -i tkg

If there is a stale process stop it using the kill command.


2. Verify there are no stale connections on the system where you launched the UI from using this command: 

 netstat -lantup | grep 8080

If there are stale connections and the process associated with the connection is not running, you need to remove the stale connections. To remove the stale connections, a reboot of the system where you installed the TKG CLI is be needed.


3. Verify the kind cluster used to bootstrap the older TKG management cluster is stopped or removed. You can identify the cluster using docker ps. To remove the stale cluster, use this command:

docker rm -f -v <container id>