Glance should set container ACLs when using swift store
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Triaged
|
Medium
|
Unassigned |
Bug Description
With glance v2 and swift as the store, glance is unable to delete images.
Tested with Queens and Rocky.
Code snippit:
import glanceclient.v2 as glance_clientv2
glance = glance_
image = glance.
glance.
glance.
Throws:
glanceclient.
Leads to the following error in glance-api.log
2018-08-29 21:49:03.367 21964 INFO swiftclient [req-4f5b43a9-
2018-08-29 21:49:03.368 21964 INFO swiftclient [req-4f5b43a9-
2018-08-29 21:49:03.368 21964 INFO swiftclient [req-4f5b43a9-
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi [req-4f5b43a9-
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi Traceback (most recent call last):
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi request, **action_args)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi return method(*args, **kwargs)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi return func(self, req, *args, **kwargs)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi image.delete()
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi self.base.delete()
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi self.base.delete()
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi return self.image.delete()
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi self.base.delete()
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi location)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi safe_delete_
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi context=context)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi return store.delete(loc, context=context)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi return store_op_fun(store, *args, **kwargs)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi location.container, location.obj)
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi query_string=
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi service_
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi File "/usr/lib/
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi raise ClientException
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi ClientException: Object HEAD failed: http://
2018-08-29 21:49:03.369 21964 ERROR glance.common.wsgi
2018-08-29 21:49:03.376 21964 INFO eventlet.
Tested with openstack client for create and delete with same results.
As the glance user using the swift client directly, the initial image part is not readable:
$ swift list glance
02a6c228-
02a6c228-
$ swift stat glance 02a6c228-
Content Type: application/
Content Length: 12716032
Last Modified: Wed, 29 Aug 2018 21:49:00 GMT
X-Openstack-
$ swift stat glance 02a6c228-
Object HEAD failed: http://
Failed Transaction ID: tx088744539df24
Note the glance container has no ACLs set:
$ swift stat glance
Read ACL:
Write ACL:
Sync To:
Sync Key:
X-
X-Openstack-
After adding read ACLs to the container, the image is deleteable
swift post glance --read-acl ".r:*,.rlistings"
Glance v2 should create its swift store container with correct read ACLS.
Changed in glance: | |
status: | New → Triaged |
importance: | Undecided → Medium |