The error occurs in specific case where cinder_volume_type is defined for the store but not cinder_store_user_name, cinder_store_password, cinder_store_auth_address, cinder_store_project_name, cinder_store_project_domain_name.
Since there is no context passed while creating cinderclient [1] and cinder_store_user_name is not defined, failed to create cinderclient object.
Probably this should leave a WARNING message in logs instead of stopping the glance-api service just like the behaviour when cinder service is not started.
glance-api service stops with the following error with cinder storage backend.
ERROR: 'NoneType' object has no attribute 'user_id'
Glance-api configuration that lead to the error:
[DEFAULT] store_datadir = /var/lib/ glance/ images/ store_datadir = /var/lib/ glance/ images/ chunk_size = 8 timeout = 0
...
enabled_backends = local:file, ceph:rbd, __DEFAULT__:cinder
...
[glance_store]
default_backend = ceph
filesystem_
...
...
[local]
filesystem_
store_description = Local filesystem store
[ceph]
rbd_store_
rbd_store_pool = glance
rbd_store_user = glance
rados_connect_
rbd_store_ceph_conf = /etc/ceph/ceph.conf
[__DEFAULT__]
cinder_volume_type = __DEFAULT__
The error occurs in specific case where cinder_volume_type is defined for the store but not cinder_ store_user_ name, cinder_ store_password, cinder_ store_auth_ address, cinder_ store_project_ name, cinder_ store_project_ domain_ name.
Since there is no context passed while creating cinderclient [1] and cinder_ store_user_ name is not defined, failed to create cinderclient object.
Probably this should leave a WARNING message in logs instead of stopping the glance-api service just like the behaviour when cinder service is not started.
[1] https:/ /opendev. org/openstack/ glance_ store/src/ branch/ master/ glance_ store/_ drivers/ cinder. py#L498