Bug 986573

Summary: LVMError: lvdeactivate failed for root: running lvm lvchange -a n --config devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] } fedora/root failed
Product: [Fedora] Fedora Reporter: benjamin.t.boyle
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: anaconda-maint-list, azmeuk, dshea, earry2000, g.kaviyarasu, jonathan, mkolman, sbueno, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:7236d142ebe794544fa5b844f2dc9aa512a62685da203ec401e31e6ea2537527
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-08 22:54:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: anaconda-tb
none
File: anaconda.log
none
File: environ
none
File: lsblk_output
none
File: nmcli_dev_list
none
File: os_info
none
File: program.log
none
File: storage.log
none
File: ifcfg.log
none
File: packaging.log
none
anaconda-tb-i5IArs none

Description benjamin.t.boyle 2013-07-20 20:03:51 UTC
Description of problem:
started anaconda

Version-Release number of selected component:
anaconda-19.30.13-1.fc19.x86_64

The following was filed automatically by anaconda:
anaconda 19.30.13-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/devicelibs/lvm.py", line 405, in lvdeactivate
    raise LVMError("lvdeactivate failed for %s: %s" % (lv_name, msg))
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 2635, in _teardown
    lvm.lvdeactivate(self.vg.name, self._name)
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 760, in teardown
    self._teardown(recursive=recursive)
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 2888, in findExistingInstallations
    device.teardown()
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 424, in reset
    self.roots = findExistingInstallations(self.devicetree)
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 144, in storageInitialize
    storage.reset()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 168, in run
    threading.Thread.run(self, *args, **kwargs)
LVMError: lvdeactivate failed for root: running lvm lvchange -a n --config  devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora/root failed

Additional info:
cmdline:        /usr/bin/python  /sbin/anaconda
cmdline_file:   BOOT_IMAGE=/vmlinuz-3.9.9-302.fc19.x86_64 root=/dev/mapper/fedora-root ro rd.lvm.lv=fedora/swap rd.md=0 rd.dm=0 rd.luks=0 vconsole.keymap=us rd.lvm.lv=fedora/root rhgb quiet LANG=en_US.UTF-8
executable:     /sbin/anaconda
hashmarkername: anaconda
kernel:         3.9.9-302.fc19.x86_64
other involved packages: python-blivet-0.17-1.fc19.noarch, python-libs-2.7.5-3.fc19.x86_64
product:        Fedora
release:        Fedora release 19 (Schrödinger’s Cat)
type:           anaconda
version:        19

Comment 1 benjamin.t.boyle 2013-07-20 20:03:56 UTC
Created attachment 776227 [details]
File: anaconda-tb

Comment 2 benjamin.t.boyle 2013-07-20 20:04:00 UTC
Created attachment 776228 [details]
File: anaconda.log

Comment 3 benjamin.t.boyle 2013-07-20 20:04:03 UTC
Created attachment 776229 [details]
File: environ

Comment 4 benjamin.t.boyle 2013-07-20 20:04:06 UTC
Created attachment 776230 [details]
File: lsblk_output

Comment 5 benjamin.t.boyle 2013-07-20 20:04:10 UTC
Created attachment 776231 [details]
File: nmcli_dev_list

Comment 6 benjamin.t.boyle 2013-07-20 20:04:13 UTC
Created attachment 776232 [details]
File: os_info

Comment 7 benjamin.t.boyle 2013-07-20 20:04:17 UTC
Created attachment 776233 [details]
File: program.log

Comment 8 benjamin.t.boyle 2013-07-20 20:04:21 UTC
Created attachment 776234 [details]
File: storage.log

Comment 9 benjamin.t.boyle 2013-07-20 20:04:24 UTC
Created attachment 776235 [details]
File: ifcfg.log

Comment 10 benjamin.t.boyle 2013-07-20 20:04:27 UTC
Created attachment 776236 [details]
File: packaging.log

Comment 11 Steve Tyler 2013-07-20 20:37:28 UTC
How were you launching anaconda?

anaconda.log:
13:01:27,878 ERR anaconda.stdout: anaconda must be run as root.
13:01:40,682 INFO anaconda: /sbin/anaconda 19.30.13-1
...

program.log:
...
13:02:06,433 INFO program: Running... lvm lvchange -a n --config  devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora/root
13:02:06,454 INFO program:   Logical volume fedora/root contains a filesystem in use.
13:02:06,454 DEBUG program: Return code: 5
...

Comment 12 Steve Tyler 2013-07-22 07:00:52 UTC
Reproduced in a VM by installing anaconda and running it from the command line:
$ sudo yum install anaconda
$ sudo anaconda

The guest is running an updated F19 Gnome desktop install with default partitioning.

anaconda 19.30.13-1

Tested with:
$ qemu-kvm -m 4096 -hda f19-test-1.img -cdrom ~/xfr/fedora/F19/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

Comment 13 Steve Tyler 2013-07-22 07:08:52 UTC
Created attachment 776761 [details]
anaconda-tb-i5IArs

anaconda 19.30.13-1 exception report
Traceback (most recent call first):
  File "/usr/lib/python2.7/site-packages/blivet/devicelibs/lvm.py", line 405, in lvdeactivate
    raise LVMError("lvdeactivate failed for %s: %s" % (lv_name, msg))
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 2635, in _teardown
    lvm.lvdeactivate(self.vg.name, self._name)
  File "/usr/lib/python2.7/site-packages/blivet/devices.py", line 760, in teardown
    self._teardown(recursive=recursive)
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 2888, in findExistingInstallations
    device.teardown()
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 424, in reset
    self.roots = findExistingInstallations(self.devicetree)
  File "/usr/lib/python2.7/site-packages/blivet/__init__.py", line 144, in storageInitialize
    storage.reset()
  File "/usr/lib64/python2.7/threading.py", line 764, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/pyanaconda/threads.py", line 168, in run
    threading.Thread.run(self, *args, **kwargs)
LVMError: lvdeactivate failed for root: running lvm lvchange -a n --config  devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora/root failed

Local variables in innermost frame:
msg: running lvm lvchange -a n --config  devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora/root failed
args: ['lvchange', '-a', 'n', '--config', ' devices { filter=["r|/loop0$|","r|/loop1$|","r|/loop2$|","r|/loop3$|","r|/loop4$|","r|/loop5$|","r|/loop6$|","r|/loop7$|"] } ', 'fedora/root']
vg_name: fedora
lv_name: root

Comment 14 David Lehman 2013-07-22 23:03:14 UTC
Running the 'anaconda' command from the command line is not supported. If you are running from live media you should run 'liveinst'. If you are doing an install to disk image files you should do the same. If you are trying to install an OS onto your system you should be booting from installation media -- not running anaconda from a shell prompt.

Comment 15 Steve Tyler 2013-07-23 01:40:55 UTC
Thanks, David.

This is not the first bug that has been reported against anaconda for failing when it is launched from the command line. If that is unsupported, the installer should say so and exit gracefully, instead of wasting everyone's time with specious bug reports.

What is confusing is that the anaconda command behaves like any other command in some ways:

$ which anaconda
/usr/sbin/anaconda

$ anaconda --version
Starting installer, one moment...
dm.c: 1693: not running as root returning empty list
anaconda 19.30.13-1

$ sudo anaconda --version
Starting installer, one moment...
anaconda 19.30.13-1

$ sudo anaconda --help
Starting installer, one moment...
Usage: anaconda [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -C, --cmdline         
...
  --leavebootorder      
  --noeject             
  --extlinux

Comment 16 Steve Tyler 2013-07-23 02:57:26 UTC
In Bug 896687, the reporter tried to launch anaconda from the command line.

Comment 17 Steve Tyler 2013-07-23 03:04:00 UTC
See also Bug 917160 -- the user tried to run anaconda "from the shell".

Comment 18 benjamin.t.boyle 2013-07-23 04:48:53 UTC
I did launch this from the command line.  As David points out, anaconda is not intended to run from the command line.  However, at the time I was not aware of this.  As Steve suggests, an error condition would have prevented me from reporting this issue, so it may be beneficial from a maintenance perspective to keep this bug or a related one to update the output.

Comment 19 Éloi Rivard 2013-09-24 14:05:51 UTC
I launched anaconda a first time, it has crashed during installation a first time. Then as soon as I re-launched it, it crashed again.

cmdline:        /usr/bin/python  /sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min --lang fr_FR.utf8
cmdline_file:   initrd=initrd0.img root=live:CDLABEL=LIVE rootfstype=vfat ro rd.live.image quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0  BOOT_IMAGE=vmlinuz0 
hashmarkername: anaconda
kernel:         3.9.5-301.fc19.x86_64
other involved packages: python-blivet-0.17-1.fc19.noarch, python-libs-2.7.5-1.fc19.x86_64
package:        anaconda-19.30.13-1.fc19.x86_64
packaging.log:  
product:        Fedora
reason:         LVMError: lvdeactivate failed for root: running lvm lvchange -a n --config  devices { filter=["r|/loop5$|","r|/loop6$|","r|/loop7$|"] }  fedora_pc-eloi/root failed
release:        Fedora release 19 (Schrödinger’s Cat)
version:        19

Comment 20 David Shea 2014-12-08 22:54:04 UTC
As noted in comment 14, running anaconda directly is not supported except in the cases of --dirinstall or --image. If run directly anaconda will attempt to access of your storage and it will fail because your storage is in use.