Bug 325591 - virt-install "Invalid file location given" when install RHEL guests
virt-install "Invalid file location given" when install RHEL guests
Product: Fedora
Classification: Fedora
Component: python-virtinst (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Daniel Berrange
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2007-10-09 16:57 EDT by Chris Lalancette
Modified: 2007-11-30 17:12 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-10-11 14:00:47 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Fixed exception handling (484 bytes, patch)
2007-10-11 11:43 EDT, Daniel Berrange
no flags Details | Diff

  None (edit)
Description Chris Lalancette 2007-10-09 16:57:10 EDT
Description of problem:
When attempting to install a RHEL-5 guest on F-8 Test3 (plus latest updates),
using this command-line:

# virt-install -d -n manage -r 512 -f /var/lib/xen/images/manage.dsk -s 10
--nonsparse -p --nographics -l

I get the following backtrace:

Tue, 09 Oct 2007 09:40:32 DEBUG    Disk path not found: Assuming file disk type.

Starting install...
libvir: Xen Daemon error : GET operation failed: 
Tue, 09 Oct 2007 09:40:32 DEBUG    Preparing mount at
Tue, 09 Oct 2007 09:40:32 DEBUG    Distro None.
Tue, 09 Oct 2007 09:40:32 DEBUG    Acquiring file from
Tue, 09 Oct 2007 09:40:32 DEBUG    Cleaning up mount at
Invalid file location given: No such file or directory
Domain installation may not have been
 successful.  If it was, you can restart your domain
 by running 'virsh start manage'; otherwise, please
 restart your installation.
Tue, 09 Oct 2007 09:40:32 ERROR    Invalid file location given: No such file or
Traceback (most recent call last):
  File "/usr/sbin/virt-install", line 485, in <module>
  File "/usr/sbin/virt-install", line 449, in main
    dom = guest.start_install(conscb,progresscb)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 722, in
  File "/usr/lib/python2.5/site-packages/virtinst/ParaVirtGuest.py", line 48, in
    self._installer.prepare(guest = self, meter = meter)
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 683,
in prepare
    self._prepare_kernel_and_initrd(guest, distro, meter)
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 653,
in _prepare_kernel_and_initrd
    distro = distro)
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 583,
in acquireKernel
    progresscb=progresscb, distro=distro, scratchdir=scratchdir)
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 566,
in _storeForDistro
    if store.isValidStore(fetcher, progresscb):
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 213,
in isValidStore
    if fetcher.hasFile("fedora.css", progresscb):
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 160,
in hasFile
    tmpfile = self.acquireFile(filename, progresscb)
  File "/usr/lib/python2.5/site-packages/virtinst/DistroManager.py", line 150,
in acquireFile
    raise ValueError, _("Invalid file location given: ") + msg
ValueError: Invalid file location given: No such file or directory

The problem is in virtinst/DistroManager.py; if you can't find fedora.css in the
FedoraImageStore.isValidStore() method, it stacktraces instead of trying
additional OS's.  That is, *any* PV guest that is not Fedora is going to fail,
since it will stack trace when looking in the directory structure.  In
_storeForDistro, I changed:

    for store in stores:
        if store.isValidStore(fetcher, progresscb):
            return store


    for store in stores:
            if store.isValidStore(fetcher, progresscb):
                return store

which allowed me to start the RHEL-5 install.  This is with
python-virtinst-0.300.1-2.fc8, by the way.
Comment 1 Michael Carney 2007-10-11 10:16:24 EDT
Could we *PLEASE* not depend on Fedora distro directory artifacts when trying to
discern if a distro is Fedora / Redhat??? I warned about exactly this problem in
273781. Just implement the solution proposed there moving forward to avoid this
problem in the future. Thanks.

Chris, could you bump up the severity to "high"?
Comment 2 Daniel Berrange 2007-10-11 11:43:44 EDT
Created attachment 224491 [details]
Fixed exception handling

The bug is actually in the hasFile method for MountedImageFetcher which is used
for NFS. It was catching  RuntimeError, but the method it calls raises a
ValueError, which isn't a subclass of RuntimeError. This was broken back in
changeset   209:9d8165be6060   which switched from raising RuntimeError to
ValueError, but didn't switch all the callers.
Comment 3 Daniel Berrange 2007-10-11 14:00:47 EDT
Fix built into rawhide.

* Thu Oct 11 2007 Daniel P. Berrange <berrange@redhat.com> - 0.300.1-3.fc8
- Fix missing file exception check with NFS installs (rhbz #325591)

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