ensure luks temp files are cleaned up if convert_image fails

Bug #1842493 reported by Eric Harney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Eric Harney

Bug Description

If convert_image fails with something like this, via _encrypt_image in the RBD driver:

2019-08-29 02:22:20.413 36 DEBUG cinder.volume.drivers.rbd [req-236efa2d-8076-4f22-8326-6df4eebc0671 - -
- - -] connecting to openstack@ceph (conf=/etc/ceph/ceph.conf, timeout=-1). _do_conn /usr/lib/python3.6/s
ite-packages/cinder/volume/drivers/rbd.py:402
2019-08-29 02:22:20.540 36 DEBUG cinder.volume.drivers.rbd [req-236efa2d-8076-4f22-8326-6df4eebc0671 - -
- - -] connecting to openstack@ceph (conf=/etc/ceph/ceph.conf, timeout=-1). _do_conn /usr/lib/python3.6/s
ite-packages/cinder/volume/drivers/rbd.py:402
2019-08-29 02:22:20.658 36 DEBUG cinder.volume.drivers.rbd [req-236efa2d-8076-4f22-8326-6df4eebc0671 - -
/Traceback
...skipping
Stdout: ''
Stderr: "qemu-img: Could not open '/var/lib/cinder/conversion/tmps33yfypx.luks': Parameter 'key-secret' i
s required for cipher\n"
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils Traceback (most recent call last):
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/volu
me/utils.py", line 1148, in copy_image_to_volume
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils context, volume, image_service, image_id)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/volu
me/drivers/rbd.py", line 1511, in copy_image_to_encrypted_volume
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils encrypted=True)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/volu
me/drivers/rbd.py", line 1557, in _copy_image_to_volume
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils self._encrypt_image(context, volume, tmp_dir, tm
p.name)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/volu
me/drivers/rbd.py", line 1540, in _encrypt_image
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils passphrase_file=pass_file.name)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/imag
e/image_utils.py", line 300, in convert_image
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils passphrase_file=passphrase_file)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/imag
e/image_utils.py", line 244, in _convert_image
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils utils.execute(*cmd, run_as_root=run_as_root)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/cinder/util
s.py", line 128, in execute
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils return processutils.execute(*cmd, **kwargs)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils File "/usr/lib/python3.6/site-packages/oslo_concur
rency/processutils.py", line 424, in execute
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils cmd=sanitized_cmd)
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils oslo_concurrency.processutils.ProcessExecutionError:
 Unexpected error while running command.
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils Command: qemu-img convert -O luks -f raw -o cipher-a
lg=aes-256,cipher-mode=xts,ivgen-alg=plain64 --object secret,id=luks_sec,format=raw,file=/var/lib/cinder/
conversion/luks_tvrmcome -o key-secret=*** /var/lib/cinder/conversion/tmps33yfypx /var/lib/cinder/convers
ion/tmps33yfypx.luks
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils Exit code: 1
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils Stdout: ''
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils Stderr: "qemu-img: Could not open '/var/lib/cinder/c
onversion/tmps33yfypx.luks': Parameter 'key-secret' is required for cipher\n"
2019-08-29 05:45:46.248 36 ERROR cinder.volume.utils

The target tmps33yfypx.luks file is not removed. It needs to be removed by the RBD driver or possibly should be managed in the image_utils code.

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.