Tasks to "detach a virtual disk" error with "The object or item referred to could not be found."
root@SV [ ~ ]# kubectl get events -n <vsphere-namespace>
LAST SEEN TYPE REASON OBJECT MESSAGE
1m Warning UpdateFailed cnsvolumemetadata/[...] ReconcileCnsVolumeMetadata: Failed to delete entry in CNS for instance with name "#####" and entity type "POD" in the guest cluster "#######-####-####-####-############". Requeuing request.
2m Warning UpdateFailed cnsvolumemetadata/[...] ReconcileCnsVolumeMetadata: Failed to delete entry in CNS for instance with name "#####" and entity type "POD" in the guest cluster "#######-####-####-####-############". Requeuing request.
root@SV [ ~ ]# kubectl logs -n vmware-system-csi vsphere-csi-controller-#########-##### vsphere-syncer | grep "op timeout"
{"level":"info","time":"####-##-##T##:##:##.000Z","caller":"volume/listview.go:253","msg":"op timeout. context deadline exceeded. using listview context without a timeout","TraceId":"########-####-####-####-############"}
VMware vSphere 8.0 / 9.0
VMware vSphere Kubernetes Service
The vsphere-csi-controller fails to detect task completion in rare circumstances.
Workaround
To workaround this issue, please restart the vsphere-csi-controller on the Supervisor:
# kubectl rollout restart deployment -n vmware-system-csi vsphere-csi-controller
Depending on the environment size, please allow the environment some minutes (around 5-15 minutes) to catch up.