'NoneType' object has no attribute 'availability'

Bug #2046364 reported by Peter Jose De Sousa
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder CSI
Fix Committed
Undecided
Adam Dyess

Bug Description

Hello

[problem]

When setting availabilty-zone on the cinder-csi charm - I hit the following error:

AttributeError: 'NoneType' object has no attribute 'availability'

Full trace:

unit-cinder-csi-1: 16:50:27 ERROR unit.cinder-csi/1.juju-log kube-control:16: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 231, in <module>
    main(CinderCSICharm)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/main.py", line 438, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/main.py", line 150, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 355, in emit
    framework._emit(event) # noqa
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 856, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/framework.py", line 931, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 195, in _merge_config
    if self._install_or_upgrade(event, config_hash=new_hash):
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/./src/charm.py", line 208, in _install_or_upgrade
    controller.apply_manifests()
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 298, in apply_manifests
    self.apply_resources(*self.resources)
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 160, in resources
    additions: List[AnyResource] = list(
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/venv/ops/manifests/manifest.py", line 164, in <genexpr>
    manipulate()
  File "/var/lib/juju/agents/unit-cinder-csi-1/charm/src/storage_manifests.py", line 71, in __call__
    sc.parameters.availability = az
AttributeError: 'NoneType' object has no attribute 'availability'

[workaround]

Create the storage class manually with appropriate availability zone

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: csi-sc-cinderplugin
provisioner: cinder.csi.openstack.org
parameters:
  availability: "nova"

Thanks,
Peter

description: updated
description: updated
description: updated
Revision history for this message
Peter Jose De Sousa (pjds) wrote :

hitting this in a customer deployment, marking field high

Revision history for this message
Adam Dyess (addyess) wrote :
Changed in charm-cinder-csi:
milestone: none → 1.30
status: New → In Progress
Adam Dyess (addyess)
Changed in charm-cinder-csi:
status: In Progress → Fix Committed
assignee: nobody → Adam Dyess (addyess)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.