Error “error getting handle for DataSource Type VolumeSnapshot”
Summary
You may sometimes see this type of error in the job activity logs:
error getting handle for DataSource Type VolumeSnapshot by Name <SNAPSHOT-NAME>: snapshot <SNAPSHOT-NAME> is currently being deleted
Details
By default, CloudCasa creates a CSI snapshot of a PVC and then creates a PVC from that snapshot, to be used as source of the backup. You will see the above mentioned error if the CSI snapshot is deleted during this process. This is typically done by GitOps tools such as Argo CD and Flux CD. These tools can be configured to manage all the resources on a cluster and if they see resources being created by other components, they will try to delete them. You can confirm this by checking the Kubernetes audit logs.
In case of Argo CD, you may want to consider not enabling the following option:
prune all resources not managed by ArgoCD
The general solution is to exclude management of some resources from GitOps. For example, you can use the following configuration to exclude CSI snapshot resources from Argo CD.
resourceExclusions: |
...
...
- apiGroups:
clusters:
- '*'
kinds:
- VolumeSnapshots
- VolumeSnapshotsContents
Please note that the above recommendations should only be taken as a guideline as the exact syntax and options may vary based on the version of the tools and other factors.