RBD: No such file or directory error on disconnect

Bug #1885293 reported by Gorka Eguileor on 2020-06-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cinderlib
Undecided
Gorka Eguileor

Bug Description

On the RBD driver, when doing a disconnect call inside a container when the "rbd_common" package is installed on the host we can get the following error:

2020-06-26 12:13:46.978 306474 WARNING os_brick.exception [req-d6ad358c-ebb6-4f9d-9904-06319b3fe093 cinderlib cinderlib - - -] Disconnect failed: oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
2020-06-26 12:13:46.979 306474 CRITICAL cinder [req-d6ad358c-ebb6-4f9d-9904-06319b3fe093 cinderlib cinderlib - - -] Unhandled error: oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
Command: sudo rm /dev/rbd/rbd/volume-7035f690-5ffa-406b-8e13-9d65c6e25220
Exit code: 1
Stdout: ''
Stderr: "rm: cannot remove '/dev/rbd/rbd/volume-7035f690-5ffa-406b-8e13-9d65c6e25220': No such file or directory\n"
2020-06-26 12:13:46.979 306474 ERROR cinder Traceback (most recent call last):
2020-06-26 12:13:46.979 306474 ERROR cinder File "<stdin>", line 1, in <module>
2020-06-26 12:13:46.979 306474 ERROR cinder File "/usr/local/lib/python3.7/site-packages/cinderlib/objects.py", line 567, in detach
2020-06-26 12:13:46.979 306474 ERROR cinder conn.detach(force, ignore_errors, exc)
2020-06-26 12:13:46.979 306474 ERROR cinder File "/usr/local/lib/python3.7/site-packages/cinderlib/objects.py", line 853, in detach
2020-06-26 12:13:46.979 306474 ERROR cinder ignore_errors=ignore_errors)
2020-06-26 12:13:46.979 306474 ERROR cinder File "/usr/local/lib/python3.7/site-packages/cinderlib/nos_brick.py", line 173, in disconnect_volume
2020-06-26 12:13:46.979 306474 ERROR cinder unlink_root(link_name)
2020-06-26 12:13:46.979 306474 ERROR cinder File "/usr/local/lib/python3.7/site-packages/cinderlib/nos_brick.py", line 243, in unlink_root
2020-06-26 12:13:46.979 306474 ERROR cinder root_helper=ROOT_HELPER)
2020-06-26 12:13:46.979 306474 ERROR cinder File "/usr/local/lib/python3.7/site-packages/oslo_concurrency/processutils.py", line 422, in execute
2020-06-26 12:13:46.979 306474 ERROR cinder cmd=sanitized_cmd)
2020-06-26 12:13:46.979 306474 ERROR cinder oslo_concurrency.processutils.ProcessExecutionError: Unexpected error while running command.
2020-06-26 12:13:46.979 306474 ERROR cinder Command: sudo rm /dev/rbd/rbd/volume-7035f690-5ffa-406b-8e13-9d65c6e25220
2020-06-26 12:13:46.979 306474 ERROR cinder Exit code: 1
2020-06-26 12:13:46.979 306474 ERROR cinder Stdout: ''
2020-06-26 12:13:46.979 306474 ERROR cinder Stderr: "rm: cannot remove '/dev/rbd/rbd/volume-7035f690-5ffa-406b-8e13-9d65c6e25220': No such file or directory\n"
2020-06-26 12:13:46.979 306474 ERROR cinder

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

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

Changed in cinderlib:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinderlib (master)

Reviewed: https://review.opendev.org/738226
Committed: https://git.openstack.org/cgit/openstack/cinderlib/commit/?id=efcec1d0ee7c892059519ad21791fce4943ac569
Submitter: Zuul
Branch: master

commit efcec1d0ee7c892059519ad21791fce4943ac569
Author: Gorka Eguileor <email address hidden>
Date: Fri Jun 26 16:31:36 2020 +0200

    RBD: Fix error on disconnect

    On the RBD driver, when doing a disconnect call inside a container, when
    the "rbd_common" package is installed on the host, we can get a "No such
    file or directory" error if the udev rule from the host removes the
    symlink before we do.

    This error is caused by the rm command returning 1 for different type of
    errors, so we'll now use -f to ensure we don't fail if the file is
    missing, which is what we intended before when passing the
    check_exit_code parameter to the execute call.

    Trivial-Fix
    Closes-Bug: #1885293
    Change-Id: Id1655614a8a60fba8ed225c6cea53ae1ed4b694a

Changed in cinderlib:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers