Symptoms
"[urn:vcloud:entity:vmware:capvcdCluster:xxxx], [error deleting resources by rde ID: [urn:vcloud:entity:vmware:capvcdCluster:xxxx] after [10] retry attempts: [<nil>]" error when deleting a kubernetes cluster in VMware Cloud Director.The kubernetes cluster cannot be deleted from the Cloud Director UI.In the cse.log file, you see entries similar to:
[error creating client using credentials from capi yaml: [unable to get swagger client from secrets: [unable to get bearer token from secrets: [failed to set authorization header: [message: Invalid refresh token - error: invalid_grant - error_description: Invalid refresh token - minorErrorCode: invalid_grant - : 400 Bad Request]]]]]"
Cause
This issue occurs as this task is a long-running process and the session that it uses to delete the kubernetes cluster expires and times out.
Resolution
Open the Provider portal of VMware Cloud Director.Click on the Administration tab.Under Settings, click General.On the Timeouts section click Edit.Note the default value for Idle session timeout.Change the Idle session timeout value to 360 and click Save. This new idle session timeout will be long enough to allow the process of deleting the kubernetes cluster to complete. Delete the kubernetes cluster as needed.Once the delete succeeds, return to the Idle session timeout and change it back to the default value and click save.