[Bug 1865037] Re: make the service fail gracefully if unable to load modules
Billy Olsen
1865037 at bugs.launchpad.net
Thu Jun 24 18:52:22 UTC 2021
This bug is also a problem on focal. When trying to install in a
container, the service fails to start with:
invoke-rc.d: initscript rtslib-fb-targetctl, action "start" failed.
● rtslib-fb-targetctl.service - Restore LIO kernel target configuration
Loaded: loaded (/lib/systemd/system/rtslib-fb-targetctl.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-06-24 18:08:27 UTC; 13ms ago
Process: 1232 ExecStart=/usr/bin/mkdir -p /etc/rtslib-fb-target (code=exited, status=0/SUCCESS)
Process: 1233 ExecStart=/usr/bin/targetctl restore (code=exited, status=1/FAILURE)
Main PID: 1233 (code=exited, status=1/FAILURE)
Jun 24 18:08:27 closing-anemone target[1233]: File "/usr/bin/targetctl", line 47, in restore
Jun 24 18:08:27 closing-anemone target[1233]: errors = RTSRoot().restore_from_file(restore_file=from_file)
Jun 24 18:08:27 closing-anemone target[1233]: File "/usr/lib/python3/dist-packages/rtslib_fb/root.py", line 85, in __init__
Jun 24 18:08:27 closing-anemone target[1233]: modprobe('target_core_mod')
Jun 24 18:08:27 closing-anemone target[1233]: File "/usr/lib/python3/dist-packages/rtslib_fb/utils.py", line 428, in modprobe
Jun 24 18:08:27 closing-anemone target[1233]: raise RTSLibError(stderrdata)
Jun 24 18:08:27 closing-anemone target[1233]: rtslib_fb.utils.RTSLibError: b'modprobe: FATAL: Module target_core_mod not found in directory /lib/modules/5.8.0-55-generic\n'
Jun 24 18:08:27 closing-anemone systemd[1]: rtslib-fb-targetctl.service: Main process exited, code=exited, status=1/FAILURE
Jun 24 18:08:27 closing-anemone systemd[1]: rtslib-fb-targetctl.service: Failed with result 'exit-code'.
Jun 24 18:08:27 closing-anemone systemd[1]: Failed to start Restore LIO kernel target configuration.
dpkg: error processing package python3-rtslib-fb (--configure):
installed python3-rtslib-fb package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (2dmesg: read kernel buffer failed: Operation not permitted
I can confirm that the ConditionVirtualization=!container directive
added to the service file addresses the issue.
** Also affects: cloud-archive
Importance: Undecided
Status: New
** Also affects: cloud-archive/ussuri
Importance: Undecided
Status: New
** Changed in: cloud-archive
Status: New => Triaged
** Changed in: cloud-archive
Importance: Undecided => High
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to python-rtslib-fb in Ubuntu.
https://bugs.launchpad.net/bugs/1865037
Title:
make the service fail gracefully if unable to load modules
Status in Ubuntu Cloud Archive:
Triaged
Status in Ubuntu Cloud Archive ussuri series:
New
Status in rtslib-fb:
Unknown
Status in python-rtslib-fb package in Ubuntu:
Fix Released
Status in python-rtslib-fb source package in Focal:
Confirmed
Status in python-rtslib-fb source package in Groovy:
Fix Released
Bug description:
[Impact]
========
The LIO interfaces is inherently tied to the kernel.
That makes the service fail on e.g. a container install:
See "systemctl status rtslib-fb-targetctl.service" and "journalctl -xe" for details.
root at f:~# systemctl status rtslib-fb-targetctl.service
● rtslib-fb-targetctl.service - Restore LIO kernel target configuration
Loaded: loaded (/lib/systemd/system/rtslib-fb-targetctl.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-02-27 14:10:35 UTC; 3s ago
Process: 23831 ExecStart=/usr/bin/mkdir -p /etc/rtslib-fb-target (code=exited, status=0/SUCCESS)
Process: 23832 ExecStart=/usr/bin/targetctl restore (code=exited, status=1/FAILURE)
Main PID: 23832 (code=exited, status=1/FAILURE)
Feb 27 14:10:35 f target[23832]: File "/usr/bin/targetctl", line 47, in restore
Feb 27 14:10:35 f target[23832]: errors = RTSRoot().restore_from_file(restore_file=from_file)
Feb 27 14:10:35 f target[23832]: File "/usr/lib/python3/dist-packages/rtslib_fb/root.py", line 85, in __init__
Feb 27 14:10:35 f target[23832]: modprobe('target_core_mod')
Feb 27 14:10:35 f target[23832]: File "/usr/lib/python3/dist-packages/rtslib_fb/utils.py", line 428, in modprobe
Feb 27 14:10:35 f target[23832]: raise RTSLibError(stderrdata)
Feb 27 14:10:35 f target[23832]: rtslib_fb.utils.RTSLibError: b"modprobe: ERROR: ../libkmod/libkmod.c:611 kmod_search_moddep() could not open moddep file '/lib/modules/5.3.0-40-generic/modu>
Feb 27 14:10:35 f systemd[1]: rtslib-fb-targetctl.service: Main process exited, code=exited, status=1/FAILURE
Feb 27 14:10:35 f systemd[1]: rtslib-fb-targetctl.service: Failed with result 'exit-code'.
Feb 27 14:10:35 f systemd[1]: Failed to start Restore LIO kernel target configuration.
It is ok that this doesn't work in a container, but it also breaks the
package installation status which should be avoided.
[Test Plan]
===========
To reproduce this bug, simply do the following:
$ lxc launch ubuntu-daily:groovy python-rtslib-fb-lp1865037-groovy
$ lxc shell python-rtslib-fb-lp1865037-groovy
# apt update && apt upgrade
# reboot
# apt install python3-rtslib-fb
...and this should fail to install.
To make sure that this bug is indeed fixed, install the patched
version of this package and that should install fine.
[Where problems could occur]
============================
This is a workaround since there doesn't seem to be a in-container use case. But in case there is one, then that'd fail to work, so we might better find a better solution for this in the long term.
The disccusion has been initiated upstream (cf: https://github.com
/open-iscsi/rtslib-fb/issues/157) and probably we'll wait for upstream
to state some in-container use case(s).
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1865037/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list