Glance adding image member fails with multibackend

Bug #1838332 reported by Nathaniel Sherry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Abhishek Kekane
Stein
Fix Released
High
Abhishek Kekane
Train
Fix Released
Critical
Abhishek Kekane

Bug Description

When adding an image member to a shared image, we get the following traceback on glance-api:

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glance/common/wsgi.py", line 1427, in __call__
    request, **action_args)
  File "/usr/lib/python2.7/site-packages/glance/common/wsgi.py", line 1470, in dispatch
    return method(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/glance/common/utils.py", line 417, in wrapped
    return func(self, req, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/glance/api/v2/image_members.py", line 117, in create
    member_repo.add(new_member)
  File "/usr/lib/python2.7/site-packages/glance/api/authorization.py", line 170, in add
    self.member_repo.add(image_member)
  File "/usr/lib/python2.7/site-packages/glance/notifier.py", line 556, in add
    super(ImageMemberRepoProxy, self).add(member)
  File "/usr/lib/python2.7/site-packages/glance/domain/proxy.py", line 121, in add
    self.base.add(self.member_proxy_helper.unproxy(member))
  File "/usr/lib/python2.7/site-packages/glance/api/policy.py", line 254, in add
    self.member_repo.add(member)
  File "/usr/lib/python2.7/site-packages/glance/location.py", line 567, in add
    self._set_acls()
  File "/usr/lib/python2.7/site-packages/glance/location.py", line 563, in _set_acls
    context=self.context)
  File "/usr/lib/python2.7/site-packages/glance_store/backend.py", line 550, in set_acls
    loc = location.get_location_from_uri(location_uri, conf=CONF)
  File "/usr/lib/python2.7/site-packages/glance_store/location.py", line 77, in get_location_from_uri
    raise exceptions.UnknownScheme(scheme=pieces.scheme)
UnknownScheme: Unknown scheme 'file' found in URI

Related config is:
[DEFAULT]
enabled_backends = gpfs:file
[gpfs]
filesystem_store_datadir = /path/to/Openstack/Glance

If I'm reading this right, the issue is related to glance_store.location.SCHEME_TO_CLS_MAP being empty. This causes backend.get_location_from_uri to fail to look up the scheme.

I think this is happening because backend.py is populating location.SCHEME_TO_CLS_MAP, but multi_backend is populating location.SCHEME_TO_CLS_BACKEND_MAP. Because location.get_location_from_uri is only looking at SCHEME_TO_CLS_MAP, when it is called with a multi-backend config, it fails to find any registered schemes.

description: updated
Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

Hi Could you please add steps of how you are adding member to image?

Changed in glance:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
importance: Undecided → High
importance: High → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.opendev.org/673453

Changed in glance:
status: New → In Progress
Revision history for this message
Nathaniel Sherry (nsherry4) wrote :

We're adding it using the python glance client API.

glance.image_members.create(image_id, project_id)
glance.image_members.update(image_id, project_id, "accepted")

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.opendev.org/673453
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=aca6996ea93d4ab491a996e714831adb82888ad3
Submitter: Zuul
Branch: master

commit aca6996ea93d4ab491a996e714831adb82888ad3
Author: Abhishek Kekane <email address hidden>
Date: Tue Jul 30 08:45:26 2019 +0000

    Adding member to image fails for multiple stores

    If multiple stores is enabled then adding member to image fails with
    UnknownScheme: Unknown scheme 'XXXX' found in URI while setting _acls
    to the store.

    Made provision to call 'set_acls_for_multi_store' if multiple stores
    are enabled.

    Change-Id: I7594185396f7a58a3c0aeeacab891b5eb18a8bf3
    Closes-Bug: #1838332

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 19.0.0.0b1

This issue was fixed in the openstack/glance 19.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/692952

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/stein)

Reviewed: https://review.opendev.org/692952
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=843d878eb0c61added97a669ccd8d22ae951cc77
Submitter: Zuul
Branch: stable/stein

commit 843d878eb0c61added97a669ccd8d22ae951cc77
Author: Abhishek Kekane <email address hidden>
Date: Tue Jul 30 08:45:26 2019 +0000

    Adding member to image fails for multiple stores

    If multiple stores is enabled then adding member to image fails with
    UnknownScheme: Unknown scheme 'XXXX' found in URI while setting _acls
    to the store.

    Made provision to call 'set_acls_for_multi_store' if multiple stores
    are enabled.

    (backport note: change name 'store' back to 'backend' since it is
    before the bp:multi-store-vocabulary-correction)

    Change-Id: I7594185396f7a58a3c0aeeacab891b5eb18a8bf3
    Closes-Bug: #1838332
    (cherry picked from commit aca6996ea93d4ab491a996e714831adb82888ad3)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 18.0.1

This issue was fixed in the openstack/glance 18.0.1 release.

Changed in glance:
status: Fix Committed → Fix Released
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.