[CLI] Improve error messages related to k8s connectivity
Description
Environment
None
Activity
Edith Erika Puclla Pareja December 18, 2024 at 1:14 PM
Edith Erika Puclla Pareja
December 18, 2024 at 1:14 PM
@Manish Chawla this still hapenning in version v1.4.0-rc1
in the command: ./everestctl install
edithpuclla@MacBookPro ~/workspace/testing-workspace/dev/GKE ./everestctl version 1 ↵ 10203 13:12:27
ProjectName: everestctl
Version: v1.4.0-rc1
FullCommit: f307b51b21fbeec8dd7515ec74d0d88fa6fc24a6
edithpuclla@MacBookPro ~/workspace/testing-workspace/dev/GKE ./everestctl install ✔ 10204 13:12:30
Error: Failed to fetch credentials for cluster "ae6d3f3f-d45d-4c3c-9f22-dcb7ee06f41b": cluster not found
2024-12-18T13:12:34Z error commands/install.go:58 Get "https://ae6d3f3f-d45d-4c3c-9f22-dcb7ee06f41b.k8s.ondigitalocean.com/version": getting credentials: exec: executable doctl failed with exit code 1
Manish Chawla November 26, 2024 at 5:53 AM
Manish Chawla
November 26, 2024 at 5:53 AM
Cli version
ProjectName: everestctl
Version: v0.0.0-f0c563b7
FullCommit: f0c563b74c93a9597b64ce90a9d734ba7a5cab6e
Now cli is displaying error messages for various scenarios
Kubeconfig is not available
./bin/everestctl install --version-metadata-url https://check-dev.percona.com --version 0.0.0
2024-11-26T05:15:41Z error commands/install.go:57 open /home/manish.chawla/.kube/config: no such file or directory
could not read kubeconfig file
Could not connect to kubernetes cluster
./bin/everestctl install --version-metadata-url https://check-dev.percona.com --version 0.0.0
2024-11-26T04:22:17Z error install/install.go:194 Could not connect to Kubernetes. Make sure Kubernetes is running and is accessible from this computer/server.
Invalid credentials
./bin/everestctl install --version-metadata-url https://check-dev.percona.com --version 0.0.0
F1126 05:27:44.204484 1540513 cred.go:145] print credential failed with error: Failed to retrieve access token:: failure while executing gcloud, with args [config config-helper --format=json]: exit status 1 (err: ERROR: (gcloud.config.config-helper) There was a problem refreshing your current auth tokens: ('invalid_grant: Invalid grant: account not found', {'error': 'invalid_grant', 'error_description': 'Invalid grant: account not found'})
Please run:
$ gcloud auth login
to obtain new credentials.
If you have already logged in with a different account, run:
$ gcloud config set account ACCOUNT
to select an already authenticated account to use.
)
2024-11-26T05:27:44Z error install/install.go:194 Could not connect to Kubernetes. Make sure Kubernetes is running and is accessible from this computer/server.
2024-11-26T05:27:44Z error commands/install.go:57 Get version: getting credentials: exec: executable gke-gcloud-auth-plugin failed with exit code 1
Invalid configuration in kubeconfig
./bin/everestctl install --version-metadata-url https://check-dev.percona.com --version 0.0.0
2024-11-26T05:40:49Z error commands/install.go:57 invalid configuration: default cluster has no server defined
Since cli is displaying error messages, hence closing this issue.
Michal November 14, 2024 at 1:46 PM
Michal
November 14, 2024 at 1:46 PM
@Manish Chawla this seems to be fixed. Can you please test?
Cli version
ProjectName: everestctl Version: v0.0.0-1471f784 FullCommit: 1471f784cd02951c05e5ee48c305953ada57508c
There are some scenarios for which cli doesn’t display any errors for install command. If the kubeconfig is not available, cluster configuration is incorrect or cluster can’t be connected to, then cli will just exit and display no errors
./bin/everestctl install --version-metadata-url https://check-dev.percona.com --version 0.0.0
I was able collect some errors using debug logging
Kubeconfig is not available
2024-07-09T08:45:21.132Z ERROR commands/install.go:58 open /home/manish.chawla/.kube/config: no such file or directory could not read kubeconfig file
Cluster configuration is incorrect in kubeconfig
2024-07-09T08:45:49.802Z ERROR commands/install.go:58 invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
Invalid credentials
F0709 08:49:21.137390 3780183 cred.go:145] print credential failed with error: Failed to retrieve access token:: failure while executing gcloud, with args [config config-helper --format=json]: exit status 1 2024-07-09T08:49:35.338Z ERROR install/install.go:177 Could not connect to Kubernetes. Make sure Kubernetes is running and is accessible from this computer/server.
Could not connect to kubernetes cluster
2024-07-09T08:49:35.338Z ERROR install/install.go:177 Could not connect to Kubernetes. Make sure Kubernetes is running and is accessible from this computer/server.
Please check if there may are more scenarios. We should add similar error messages in upgrade/uninstall commands also.