Bug 1661672
Summary: | libblockdev fs plugin fails to load | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 8 | Reporter: | John Pittman <jpittman> |
Component: | libblockdev | Assignee: | Vojtech Trefny <vtrefny> |
Status: | CLOSED NOTABUG | QA Contact: | guazhang <guazhang> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 8.0 | CC: | guazhang, nweddle, tcleveng |
Target Milestone: | rc | ||
Target Release: | 8.0 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-09-21 12:33:07 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
John Pittman
2018-12-21 22:57:59 UTC
Tested the other plugins that I could find and they all succeeded. lvm - pass fs - fail nvdimm - pass kbd - pass mdraid - pass part - pass loop - pass vdo - pass swap - pass dm - pass crypto - pass mpath - pass I reproduced this issue with sample_script.py for libblockdev-2.19-6.el8, let me add ACK+. DISTRO=RHEL-8.0-20181220.1 ARCHITECTURE=x86_64 --------------------------------------- # rpm -qa|egrep 'libblockdev-[0-9]|python3-blockdev' libblockdev-2.19-6.el8.x86_64 python3-blockdev-2.19-6.el8.x86_64 # python sample_script.py ** (process:30631): WARNING **: 00:30:16.665: The 'fsck.vfat' utility is not available The 'fatlabel' utility is not available The 'mkfs.vfat' utility is not available Traceback (most recent call last): File "sample_script.py", line 18, in <module> succ_ = bd.init(requested_plugins) File "/usr/lib64/python3.6/site-packages/gi/overrides/BlockDev.py", line 91, in init return _init(require_plugins, log_func) GLib.Error: g-bd-init-error-quark: Failed to load plugins (0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "sample_script.py", line 20, in <module> raise RuntimeError("Failed to initialize libbd and its plugins (%s)" % REQUESTED_PLUGIN_NAMES) RuntimeError: Failed to initialize libbd and its plugins ({'fs'}) # uname -r 4.18.0-56.el8.x86_64 # cat /etc/redhat-release Red Hat Enterprise Linux release 8.0 Beta (Ootpa) This is actually expected behavior. Libblockdev has checks for runtime dependencies during init by default and init fails if the dependencies are not available. You can use the "bd_switch_init_checks" function to disable this behavior. I've updated the API examples to do this by default -- https://github.com/storaged-project/api-examples/pull/6 I didn't find the issue on latest version of libblockdev-2.19-7.el8, libblockdev fs plugin can be loaded successfully in my testing. We can Resolve current bug. test.py ------------ #!/usr/bin/python3 import sys import os import gi gi.require_version("GLib", "2.0") gi.require_version("BlockDev", "2.0") from gi.repository import GLib from gi.repository import BlockDev as bd REQUESTED_PLUGIN_NAMES = {"fs"} requested_plugins = bd.plugin_specs_from_names(REQUESTED_PLUGIN_NAMES) # disable checks for runtime dependencies during init -- thanks to this init # won't fail if for example 'mke2fs' is not installed bd.switch_init_checks(False) try: succ_ = bd.init(requested_plugins) except GLib.GError as err: raise RuntimeError("Failed to initialize libbd and its plugins (%s)" % REQUESTED_PLUGIN_NAMES) Closing based on comment #4. Please to reopen the bug if you encounter the issue again. |