ceph-csi icon indicating copy to clipboard operation
ceph-csi copied to clipboard

Creation of PVC from non existing snapshot causes loop error

Open romantomchak opened this issue 6 years ago • 6 comments

Creation of PVC from non existing snapshot (through a typo) causes error in csi-provisioner and it is ok, but even after deleting PVC from cluster csi-provisioner still reports an error in loop that it trying to create PVC but source snapshot does not exist.

Environment details

  • Image/version of Ceph CSI driver
    • quay.io/k8scsi/csi-provisioner:v1.5.0
    • quay.io/k8scsi/csi-snapshotter:v2.0.0
    • quay.io/k8scsi/csi-attacher:v2.1.0
    • quay.io/k8scsi/csi-resizer:v0.4.0
    • quay.io/cephcsi/cephcsi:canary
  • Kubernetes cluster version v1.17.0

Steps to reproduce

Steps to reproduce the behavior:

  1. Create PVC from non existing snapshot
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: rbd-pvc-restore-test
spec:
  storageClassName: ceph-csi-rbd
  dataSource:
    name: rbd-snapshot-test
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  1. Delete created PVC

kubectl delete pvc rbd-pvc-restore-test -n default

  1. Check logs in csi-provisioner container in csi-rbdplugin-provisioner pod

Actual results

After deleting PVC (kubectl delete pvc rbd-pvc-restore-test -n default) csi-provisioner still reports an error in loop:

I0113 10:46:41.380477       1 controller.go:1199] provision "default/rbd-pvc-restore-test" class "ceph-csi-rbd": started
I0113 10:46:41.395340       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"748ca378-82db-40b5-a48c-885a25f9c0f2", APIVersion:"v1", ResourceVersion:"1808623", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/rbd-pvc-restore-test"
W0113 10:46:41.396556       1 controller.go:887] Retrying syncing claim "748ca378-82db-40b5-a48c-885a25f9c0f2", failure 748
E0113 10:46:41.396900       1 controller.go:910] error syncing claim "748ca378-82db-40b5-a48c-885a25f9c0f2": failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found
I0113 10:46:41.397054       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"748ca378-82db-40b5-a48c-885a25f9c0f2", APIVersion:"v1", ResourceVersion:"1808623", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found
I0113 10:47:20.320252       1 reflector.go:432] sigs.k8s.io/sig-storage-lib-external-provisioner/controller/controller.go:807: Watch close - *v1.StorageClass total 0 items received
I0113 10:47:24.924905       1 controller.go:1199] provision "default/rbd-pvc-restore-test" class "ceph-csi-rbd": started
I0113 10:47:24.942437       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"e7d50f4a-f26b-4a06-88ea-c5e8c86cd612", APIVersion:"v1", ResourceVersion:"1780862", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/rbd-pvc-restore-test"
W0113 10:47:24.943097       1 controller.go:887] Retrying syncing claim "e7d50f4a-f26b-4a06-88ea-c5e8c86cd612", failure 770
E0113 10:47:24.943292       1 controller.go:910] error syncing claim "e7d50f4a-f26b-4a06-88ea-c5e8c86cd612": failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found
I0113 10:47:24.943437       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"e7d50f4a-f26b-4a06-88ea-c5e8c86cd612", APIVersion:"v1", ResourceVersion:"1780862", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found
I0113 10:47:26.069549       1 controller.go:1199] provision "default/rbd-pvc-restore-test" class "ceph-csi-rbd": started
I0113 10:47:26.077916       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"208c224e-d944-4abb-ab06-ff8fe96f3ed2", APIVersion:"v1", ResourceVersion:"1730257", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/rbd-pvc-restore-test"
W0113 10:47:26.078446       1 controller.go:887] Retrying syncing claim "208c224e-d944-4abb-ab06-ff8fe96f3ed2", failure 812
E0113 10:47:26.078599       1 controller.go:910] error syncing claim "208c224e-d944-4abb-ab06-ff8fe96f3ed2": failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rdb-snapshot-test: error getting snapshot rdb-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rdb-snapshot-test" not found
I0113 10:47:26.078688       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"208c224e-d944-4abb-ab06-ff8fe96f3ed2", APIVersion:"v1", ResourceVersion:"1730257", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rdb-snapshot-test: error getting snapshot rdb-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rdb-snapshot-test" not found
I0113 10:49:06.317970       1 controller.go:1199] provision "default/rbd-pvc-restore-test" class "ceph-csi-rbd": started
I0113 10:49:06.330176       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"a61fbb13-e4d6-45d0-8c49-039d8f67acf3", APIVersion:"v1", ResourceVersion:"1796726", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/rbd-pvc-restore-test"
W0113 10:49:06.331315       1 controller.go:887] Retrying syncing claim "a61fbb13-e4d6-45d0-8c49-039d8f67acf3", failure 758
E0113 10:49:06.332327       1 controller.go:910] error syncing claim "a61fbb13-e4d6-45d0-8c49-039d8f67acf3": failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found
I0113 10:49:06.336468       1 event.go:281] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"rbd-pvc-restore-test", UID:"a61fbb13-e4d6-45d0-8c49-039d8f67acf3", APIVersion:"v1", ResourceVersion:"1796726", FieldPath:""}): type: 'Warning' reason: 'ProvisioningFailed' failed to provision volume with StorageClass "ceph-csi-rbd": error getting handle for DataSource Type VolumeSnapshot by Name rbd-snapshot-test: error getting snapshot rbd-snapshot-test from api server: volumesnapshots.snapshot.storage.k8s.io "rbd-snapshot-test" not found

Expected behavior

After deleting PVC provisioner should not report an error.

romantomchak avatar Jan 13 '20 10:01 romantomchak

we are not supporting quay.io/k8scsi/csi-snapshotter:v2.0.0 sidecar container, closing this issue

Madhu-1 avatar Jan 13 '20 11:01 Madhu-1

Hi @Madhu-1 ,

but this error is reported by csi-provisioner but not by csi-snapshotter. It's OK that provisioner cannot create PVC because snapshot is really absent, because it was a typo in snapshot name, but the main problem is that after deletion of PVC provisioner is still trying to create it.

romantomchak avatar Jan 13 '20 11:01 romantomchak

Hi @Madhu-1 ,

but this error is reported by csi-provisioner but not by csi-snapshotter. It's OK that provisioner cannot create PVC because snapshot is really absent, because it was a typo in snapshot name, but the main problem is that after deletion of PVC provisioner is still trying to create it.

as this is nothing to do with ceph-csi then the issue needs to be opened in external-provisioner repo. https://github.com/kubernetes-csi/external-provisioner

btw we have not updated csi-provisioner image to 1.5.0

Madhu-1 avatar Jan 13 '20 11:01 Madhu-1

btw we have not updated csi-provisioner image to 1.5.0

what do you mean?

there is 1.5.0 version in registry for this image

romantomchak avatar Jan 13 '20 11:01 romantomchak

btw we have not updated csi-provisioner image to 1.5.0

what do you mean?

there is 1.5.0 version in registry for this image

please check https://github.com/ceph/ceph-csi/blob/master/deploy/rbd/kubernetes/v1.14%2B/csi-rbdplugin-provisioner.yaml#L39 we have tested ceph-csi with only 1.4.0, not with 1.5.0

Madhu-1 avatar Jan 13 '20 11:01 Madhu-1

@Madhu-1 thank you

romantomchak avatar Jan 13 '20 12:01 romantomchak