Describe the bug
The trident-csi deployment was crashlooping because of
I1207 08:20:13.609384 1 connection.go:186] GRPC error: rpc error: code = FailedPrecondition desc = Trident initialization failed; error attempting to clean up snapshot snapshot-SOMEUUID from backend ontapnas.... : error reading volume size: flexvol trident_pvc_SOMEOTHERUUID not found
For some reason trident-csi was following leftover references to a snapshot on a PVC backend that didn't support snapshots.
The snapshot itself didn't exist for that PVC anymore (it might have been mistakenly created in kubernetes in the past [>1 month ago]). I even had deleted the original PVC. But the real problem was that deleting the "volumesnapshot" object for that snapshot, didn't seem to delete all the other references to it.
The backend was "ontap-nas-economy" ( https://netapp-trident.readthedocs.io/en/latest/kubernetes/operations/tasks/backends/ontap/drivers.html , the q-tree one).
It sort of looked like CSI was trying to locate a snapshot for a PV (qtree) provisioned on an 'economy' backend, but it was actually checking for the pvc volume in the regular ontap-nas backend. Which is set as our default too. I suspect this issue happened because the default storage class was the economy one, when the snapshot was created. That changed later on to set the default to ontap-nas which support backend, but the references were probably broken/not properly cleaned up at that point (?).
Those other references include:
Deleting the past references fixes the issue.
Initial state:
Some time ago, a volumesnapshot resource was created for a backend that didn't support it. Deleting that volumesnapshot didn't seem to delete the references to it on other trident crd objects.
What triggered the bug:
Restarting some nodes, restarted the kubelet on one of the nodes that had the volumeattachment for the snapshot/pvc.
Environment
Openshift 4.6.*
To Reproduce
Expected behavior
No crashlooping on broken TridentTransaction references.
Print a warning and continue OR cleanup the broken reference OR add a flag to toggle this behaviour on/off.
Workaround is to delete the trident transactions manually and restart the trident pods. this is still a bug that needs to be addressed.
Steps for the workaround below
Check for the entries in the tridenttransactions CRD.
# oc get tridenttransaction -n trident
# oc get tridenttransaction -n trident -o json
[corona@stablrebco2 ~]$ oc get ttx -n trident
NAME AGE
pvc-63836175-1515-4326-b73f-cae3e0963be7-snapshot-0462e2ea-f167-4846-86a3-10cc6599b4a8 8d
3) Delete the entries present in the tridenttransaction CRD.
Before deleting the tridenttransaction CRD entry, you may need to edit the CRD resource entry and remove the finalizers(trident.netapp.io)
To edit the CRD, use a vi editor: (Remember to save the change)
ïƒ Delete the line under the finalizers containing entry "trident.netapp.io".
4) To delete the tridenttransaction CRD.
Confirm the tridenttransaction has been deleted.
5) After this the Trident pods should come up and be in Running status. If not, delete the main trident pod, (the pod with the longest pod name).
This should spawn a new trident pod which will try to initialize again and it should successfully initialize because there are no stale transactions to be handled during initialization.
will there be a patch release to fix the bug
Hi @promothp,
This bug along all other bugs are evaluated based on severity and prioritized to be fixed accordingly. If possible a bug fix for this issue would be included in the Trident v21.01 release at the end of January.
Add my vote to having a patch sooner than later!
This fix is included in the Trident v21.01 release with commit 0ce1aaf.