Kubeconfig token gets automatically disabled after some time (no store found)

Hello, I posted this issue on GitHub: Kubeconfig token gets automatically disabled after some time (no store found) · Issue #30905 · rancher/rancher · GitHub

Was wondering if anyone faced same issue or have a workaround.

The problem I face is, I am unable to use kubectl command on a cluster created from Rancher.
Get following error:
“error: You must be logged in to the server (the server has asked for the client to provide credentials)”

As a workaround, I delete the token and download the new kubeconfig file. After that I am able to run kubectl commands for 30 mins or so before I run into this issue again.

Can see that the corresponding token has enabled set to false.

{
"annotations": {
"lifecycle.cattle.io/create.cat-token-controller_c-tvkq7": "true"
},
"authProvider": "local",
"baseType": "token",
"clusterId": "c-tvkq7",
"created": "2021-01-19T14:55:10Z",
"createdTS": 1611068110000,
"creatorId": null,
"current": false,
"description": "Kubeconfig token",
"enabled": false,
"expired": false,
"expiresAt": "",
"groupPrincipals": null,
"id": "kubeconfig-user-8ttkw.c-tvkq7",
"isDerived": true,
"labels": {
"authn.management.cattle.io/kind": "kubeconfig",
"authn.management.cattle.io/token-userId": "user-8ttkw",
"cattle.io/creator": "norman"
},
"lastUpdateTime": "",
"links": {
"remove": "…/v3/tokens/kubeconfig-user-8ttkw.c-tvkq7",
"self": "…/v3/tokens/kubeconfig-user-8ttkw.c-tvkq7",
"update": "…/v3/tokens/kubeconfig-user-8ttkw.c-tvkq7"
},
"name": "kubeconfig-user-8ttkw.c-tvkq7",
"ttl": 0,
"type": "token",
"userId": "user-8ttkw",
"userPrincipal": "map[metadata:map[creationTimestamp:<nil>]]",
"uuid": "21803f6b-1905-4a96-ab2f-4980e166e7cd"
}

If I try to set it back to enable, I get “store not found error”

{
"baseType": "error",
"code": "NotFound",
"message": "no store found",
"status": 404,
"type": "error"
}

I have also tried disabling the kubeconfig-generate-token setting so that I can login using username/password but even in that case I faced the same problem.

This is quite annoying and would really like a solution, Thanks,

Hello, this issue is really coming in the way of using Rancher. I am unable to use Rancher CLI since the tokens keep getting disabled. Can someone help please?

So finally I did a re-installation of Rancher and K3s including creating a new external MySQL DB. That has resolved this problem.