error: You must be logged in to the server (Unauthorized)E0121 15:56:22.427329 1568345 memcache.go:265] "Unhandled Error" err="couldn't get current server API group list: the server has asked for the client to provide credentials"
This was seen on Tanzu Hub environments during upgrade from 10.2.1 to 10.3.0.
During the upgrade from Tanzu hub 10.2.1 to 10.3, the password for the admin use in kubeconfig on the Registry VM is updated. Depending on the stage of upgrade at which the failure occurs, the password might be updated in Credhub, but not propagated to the kubeconfig on the Registry VM yet.
Manually gather the password from Credhub and update the /var/vcap/jobs/hubsm-install/config/kubeconfig file:
credhub get -n /p-bosh/hub-<DEPLOYMENT_ID>/kube-apiserver-admin-password
/var/vcap/jobs/hubsm-install/config/kubeconfig file:sudo cp /var/vcap/jobs/hubsm-install/config/kubeconfig /var/vcap/jobs/hubsm-install/config/kubeconfig.bak
/var/vcap/jobs/hubsm-install/config/kubeconfig file, change the token value to match the password gathered from Credhub CLI