← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1838332] Re: Glance adding image member fails with multibackend

 

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 <akekane@xxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1838332

Title:
  Glance adding image member fails with multibackend

Status in Glance:
  Fix Released

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1838332/+subscriptions


References