Bug 1729023 - The error message is inappropriate when run `imgbase layout --init` on current layout
Summary: The error message is inappropriate when run `imgbase layout --init` on curren...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: redhat-virtualization-host
Version: 4.3.5
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.3.5
: 4.3.5
Assignee: Yuval Turgeman
QA Contact: Qin Yuan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-11 08:40 UTC by Qin Yuan
Modified: 2022-07-09 14:47 UTC (History)
9 users (show)

Fixed In Version: imgbased-1.1.9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-12 11:54:28 UTC
oVirt Team: Node
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHV-47476 0 None None None 2022-07-09 14:47:18 UTC
Red Hat Product Errata RHSA-2019:2437 0 None None None 2019-08-12 11:54:41 UTC
oVirt gerrit 101727 0 master MERGED core: check for layer tag on lv 2019-07-15 06:50:05 UTC
oVirt gerrit 101795 0 ovirt-4.3 MERGED core: check for layer tag on lv 2019-07-16 13:41:51 UTC

Description Qin Yuan 2019-07-11 08:40:59 UTC
Description of problem:

When run `imgbase layout --init` on the current layout, it should fail with an error that tells user there is already a working imgbase, but the current error message, as following, shows wrong information.

[root@ati-local-01 ~]# imgbase layout --init
2019-07-11 16:25:10,282 [INFO] (MainThread) Trying to create a manageable base from '/'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/imgbased/__main__.py", line 53, in <module>
    CliApplication()
  File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, in CliApplication
    app.hooks.emit("post-arg-parse", args)
  File "/usr/lib/python2.7/site-packages/imgbased/hooks.py", line 120, in emit
    cb(self.context, *args)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 173, in post_argparse
    layout.initialize(args.source, args.init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 220, in initialize
    self.app.imgbase.init_layout_from(source, init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 286, in init_layout_from
    self.init_tags_on(existing_lv)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 252, in init_tags_on
    self._assert_tags(lv)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 136, in _assert_tags
    "and logical volumes, then retry" % tag)
imgbased.imgbase.VgTaggedLvNotTagged: 
A tagged volume group was found, but no logical volumes were tagged with: imgbased:init
Please remove tags from volume groups and logical volumes, then retry


Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.3.5-20190710.2.el7_7
imgbased-1.1.8-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install redhat-virtualization-host-4.3.5-20190710.2.el7_7
2. Boot into the system after installation finished
3. Run `imgbase layout --init`

Actual results:
1. The error message is as above

Expected results:
1. The error message should tell user there is already a working imgbase

Additional info:

Comment 2 Qin Yuan 2019-07-18 06:06:55 UTC
Test with:
redhat-virtualization-host-4.3.5-20190717.0.el7_7
imgbased-1.1.9-0.1.el7ev.noarch

The output of `imgbase layout --init` on the current layer is:

[root@ati-fc-02 ~]# imgbase layout --init
2019-07-18 13:57:00,192 [INFO] (MainThread) Trying to create a manageable base from '/'
Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/imgbased/__main__.py", line 53, in <module>
    CliApplication()
  File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, in CliApplication
    app.hooks.emit("post-arg-parse", args)
  File "/usr/lib/python2.7/site-packages/imgbased/hooks.py", line 120, in emit
    cb(self.context, *args)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 173, in post_argparse
    layout.initialize(args.source, args.init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 220, in initialize
    self.app.imgbase.init_layout_from(source, init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 286, in init_layout_from
    self.init_tags_on(existing_lv)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 252, in init_tags_on
    self._assert_tags(lv)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 138, in _assert_tags
    "Looks like the system already has imgbase working properly.\n"
imgbased.imgbase.ExistingImgbaseWithTags: Looks like the system already has imgbase working properly.
However, imgbase was called with --init. If this was intentional, please untag the existing volumes and try again.

The error message is correct. The bug is fixed, move to VERIFIED.

Comment 5 errata-xmlrpc 2019-08-12 11:54:28 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, 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/RHSA-2019:2437


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