Bug 1845852 - Image creation fails with 500 error when glance cinder backend and cinder nfs backend is used
Summary: Image creation fails with 500 error when glance cinder backend and cinder nfs...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-glance-store
Version: 16.0 (Train)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: z2
: 16.1 (Train on RHEL 8.2)
Assignee: Cyril Roelandt
QA Contact: Mike Abrams
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-10 09:06 UTC by Takashi Kajinami
Modified: 2020-11-11 12:00 UTC (History)
5 users (show)

Fixed In Version: python-glance-store-1.0.2-1.20200825163437.bc62bb4.el8ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-28 15:37:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 726648 0 None MERGED Add config for cinder mounting needs 2021-01-19 02:02:51 UTC
OpenStack gerrit 726650 0 None MERGED Add lock per share for cinder nfs mount/umount 2021-01-19 02:02:51 UTC
Red Hat Product Errata RHEA-2020:4284 0 None None None 2020-10-28 15:37:55 UTC

Description Takashi Kajinami 2020-06-10 09:06:55 UTC
Description of problem:

When we use cinder as glance backend, and nfs as cinder backend, Image creation fails because of 500 error
while uploading the image content.

In glance-api log, we observe that glance tries to perform chown command agaist mounted volume file under
/var/lib/cinder, but it fails because the command doesn't match the pattern defined in rootwrap configuration.
~~~
2020-06-01 11:22:33.000 31 ERROR glance_store._drivers.cinder Command: sudo glance-rootwrap /etc/glance/rootwrap.conf chown 42415 /var/lib/cinder/mnt/bc07aa1376c04aeeac02143dda44b869/volume-c34e75ac-303a-4161-8663-4c979b47f390
2020-06-01 11:22:33.000 31 ERROR glance_store._drivers.cinder Exit code: 99
2020-06-01 11:22:33.000 31 ERROR glance_store._drivers.cinder Stdout: ''
2020-06-01 11:22:33.000 31 ERROR glance_store._drivers.cinder Stderr: '/usr/bin/glance-rootwrap: Unauthorized command: chown 42415 /var/lib/cinder/mnt/bc07aa1376c04aeeac02143dda44b869/volume-c34e75ac-303a-4161-8663-4c979b47f390 (no filter matched)\n'
2020-06-01 11:22:33.000 31 ERROR glance_store._drivers.cinder 
~~~

~~~
[heat-admin@controller-0 ~]$ sudo podman exec -it glance_api cat /etc/glance/rootwrap.d/glance_cinder_store.filters
# glance-rootwrap command filters for glance cinder store
# This file should be owned by (and only-writable by) the root user

[Filters]
# cinder store driver
disk_chown: RegExpFilter, chown, root, chown, \d+, /dev/(?!.*/\.\.).*

# os-brick library commands
# os_brick.privileged.run_as_root oslo.privsep context
# This line ties the superuser privs with the config files, context name,
# and (implicitly) the actual python code invoked.
privsep-rootwrap: RegExpFilter, privsep-helper, root, privsep-helper, --config-file, /etc/(?!\.\.).*, --privsep_context, os_brick.privileged.default, --privsep_sock_path, /tmp/.*
~~~

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Deploy overcloud with glance cinder backend + cinder nfs backend
2. Create an image

Actual results:
Image creation fails because of 500 error during uploading image file

Expected results:
Image creation succeeds without any errors

Additional info:

Comment 2 Cyril Roelandt 2020-06-10 15:21:41 UTC
The patch you mention is available in python-glance-store 0.23.1-0.20190916165252.cc7ecc1 . This has not been released, but should be part of 13zXX.

Have you been able to try the updated rootwrap filters on your installation?

Comment 3 Takashi Kajinami 2020-06-10 23:23:53 UTC
(In reply to Cyril Roelandt from comment #2)
> The patch you mention is available in python-glance-store
> 0.23.1-0.20190916165252.cc7ecc1 . This has not been released, but should be
> part of 13zXX.
> 
> Have you been able to try the updated rootwrap filters on your installation?

The issue I reported here is not for OSP13, but OSP16.
Is the patch[1] already backported to OSP16 as well ?

[1] https://review.opendev.org/#/c/716874/

Comment 6 Cyril Roelandt 2020-09-02 21:33:11 UTC
The fix for this seems to be available, let's hand it to QA :)

Comment 17 errata-xmlrpc 2020-10-28 15:37:36 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenStack Platform 16.1 bug fix and enhancement advisory), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4284


Note You need to log in before you can comment on or make changes to this bug.