Back to all scenarios
Scenario #366
Storage
Kubernetes v1.26, custom CSI plugin

CSI Plugin Panic on Missing Mount Option

Missing mountOptions in StorageClass led to runtime nil pointer exception in CSI driver.

Find this helpful?
What Happened

StorageClass defined mountOptions: null, causing driver to crash during attach.

Diagnosis Steps
  • 1CSI logs showed panic: nil pointer dereference.
  • 2StorageClass YAML had an empty mountOptions: field.
Root Cause

Plugin didn't check for nil before reading options.

Fix/Workaround
• Removed mountOptions: from manifest.
• Patched CSI driver to add nil checks.
Lessons Learned

CSI drivers must gracefully handle incomplete specs.

How to Avoid
  • 1Validate StorageClass manifests.
  • 2Write defensive CSI plugin code.