IBM Cloud Docs
Why am I not authorized when running TKE CLI plug-in commands?

Why am I not authorized when running TKE CLI plug-in commands?

You receive an error message after you run a tke CLI command.

The message might be similar to the following one:

ibmcloud tke cryptounits FAILED Error querying service instances. Status code: 401 Message: Unauthorized Your access token is invalid, expired, or does not have the necessary permissions to access this instance.

To run TKE CLI plug-in commands that send requests to the IBM Cloud, you must have a valid authentication token. An authentication token is created when you log in to the IBM Cloud, but it expires after 1 hour. After 1 hour, you must log in again to continue to send requests to the IBM Cloud.

Log in to IBM Cloud again with the ibmcloud login command to refresh the token.