Failed to get /version for clusterId= Unauthorized

Hi Team,
When I try to connect the kubernetes cluster i got into below issue:
Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized
I can connect to my cluster using kubectl from Mac terminal.

Here is my kube config.
➜ ~ k config view --minify
apiVersion: v1
clusters:

  • cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://XXXXXXXX.sk1.us-west-1.eks.amazonaws.com
    name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    contexts:
  • context:
    cluster: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    user: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    current-context: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    kind: Config
    preferences: {}
    users:
  • name: arn:aws:eks:us-west-1:XXXXXXXX:cluster/kkrwest-eks0
    user:
    exec:
    apiVersion: client.authentication.k8s.io/v1beta1
    args:
    - --region
    - us-west-1
    - eks
    - get-token
    - --cluster-name
    - kkrwest-eks0
    command: aws
    env:
    - name: AWS_PROFILE
    value: AWSAdministratorAccess-XXXXXX
    interactiveMode: IfAvailable
    provideClusterInfo: false
    ➜ ~

ailed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

Failed to get /version for clusterId=d01ecc1e4120e55ab1b1ef6dae0d707c: Unauthorized

were you able to solve this? I have the exact same issue

1 Like

For those stucked here, make sure to update your awscli to latest and update your apiVersion URL to latest.

Currently is apiVersion: client.authentication.k8s.io/v1beta1

1 Like

I solved this by configuring config map aws-auth:

kubectl edit configmap aws-auth --namespace kube-system
mapUsers: |
  - userarn: arn:aws:iam::XXXXXXXXXXXX:user/testuser
    username: testuser
    groups:
      - system:masters
1 Like

I had the same issue and tried everything on the internet but had no luck. However, opening the Lens via the launcher seems to have caused this issue, and I tried to run it from the terminal using open /Applications/Lens.app/ and it solved my problem.

Using a Mac with Iterm2.

1 Like

I guess I have the same issue after I have upgraded to lens 2023.9.
Working against:

  • Windows 11 laptop
  • Azure Kubernetes Service 1.28
  • Azure RBAC enabled auth
  • User has role “Azure Kubernetes Service RBAC Cluster Admin”
  • kubectl just works
    *kubectl get --raw /version even works
  • kubelogin version 0.1.0
  • az cli 2.60
  • using AKS with local users enabled and admin account just works in Lens. It is really the Azure RBAC user account

Finally I discovered the culprit! I am using a separate az config file which obviously is not used when Lens is running kubelogin.

Hello,

Thank you for reaching out to Lens forum!

We already have the topic with the same issue. Could you try to check it, please? It may help you.

Best Regards,
Tikhon Kudinov
Lens Support Engineer
Mirantis, Inc