Skip to content

Bug: Unable to Edit Existing Cluster Bearer Token - Error "Unauthorized: Token Seems Invalid or Does Not Have Sufficient Permissions" #5281

@badal773

Description

@badal773

📜 Description

I have an existing cluster added in Devtron using a DNS name. I recently changed the DNS to point to a new cluster API server. When I attempt to update the bearer token in Devtron, I encounter the following error: "Unauthorized: Token seems invalid or does not have sufficient permissions.

{"level":"error","ts":1717694846.591179,"caller":"k8s/K8sUtil.go:545","msg":"error in getting livez call","err":"the server has asked for the client to provide credentials","clusterName":"xxxxxx-devtron","stacktrace":"github.com/devtron-labs/common-lib/utils/k8s.K8sServiceImpl.DiscoveryClientGetLiveZCall\n\t/go/src/github.com/devtron-labs/devtron/vendor/github.com/devtron-labs/common-lib/utils/k8s/K8sUtil.go:545\ngithub.com/devtron-labs/devtron/pkg/cluster.ClusterServiceImpl.CheckIfConfigIsValidAndGetServerVersion\n\t/go/src/github.com/devtron-labs/devtron/pkg/cluster/ClusterService.go:834\ngithub.com/devtron-labs/devtron/pkg/cluster.


{"level":"error","ts":1717694846.591232,"caller":"cluster/ClusterRestHandler.go:476","msg":"service err, Update","error":"Unauthorized : token seems invalid or does not have sufficient permissions","payload":{"id":27,"cluster_name":"xxxxx-devtron","description":"","server_url":"https://xxxxxx.xxxxxx.devtron.ai:16443","active":true,"config":

Screenshot 2024-06-10 at 12 01 42 PM

👟 Reproduction steps

  1. Add a cluster using a DNS name (instead of adding directly, as the DNS name is a primary key in ArgoCD).
  2. Successfully add the cluster for the first time.
  3. Change the API server DNS to point to the new API server.
  4. Attempt to update the existing cluster bearer token in Devtron with a new bearer token.

Devtron does not allow the existing cluster bearer token to be edited and throws an error indicating that the token seems invalid or lacks sufficient permissions.

👍 Expected behavior

It should be edit without any error Unauthorized : token seems invalid or does not have sufficient permissions

👎 Actual Behavior

It is throwing error

☸ Kubernetes version

1.28

Cloud provider

Details aws

🌍 Browser

Chrome

🧱 Your Environment

No response

✅ Proposed Solution

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find any similar issue

🏢 Have you read the Code of Conduct?

AB#9953

Metadata

Metadata

Labels

ENT-CDbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions