# virt-install has a problem with urlgrabber

## Aad-Jan

Hi guys,

I'm running into a problem running virt-install with the --location option. The urlgrabber package seems to fail to parse a directory. 

This is (part of) the command I run

# virt-install --name=master-centos6\

--ram=1024\ 

--vcpus=1 \

--os-type=linux \

--os-variant=rhel6 \

--disk path=/kvmlab/storage/images/master-centos6.qcow2,bus=virtio \

[..more..]

--location=/kvmlab/storage/mnt/storage/centos/6/os/x86_64 \

--extra-args=ks=hd:vdb:/kickstart/master-centos6-ks.cfg noipv6 \

--noreboot

The output this generates is as follows;-

ERROR    Traceback (most recent call last):

  File "/usr/lib64/python2.7/site-packages/urlgrabber/grabber.py", line 1072, in _retrieve

    size  = self.size + self._reget_length

I've tried a number of things. all of which failed.

- Rummaging in the grabber.py file I saw a self.size variable being initialized as None. Initializing it to 0 opens a whole new can of worms...

- Using file:// to prefix the location path doesn't help as the virt-install script doesn't accept it as valid

I've isntalled the following packages

app-emulation/virt-manager-0.10.0

app-emulation/libvirt-1.1.3-r1

i would like to know if anyone has run into this and whether there's a fix for it.

Additional information is available.

Greets Aad-jan

----------

## Aad-Jan

To move things forward I decided to use my Apache installation and linked /kvmlab/storage/mnt/storage into my htdocs directory.

Using --location="http://localhost/storage/centos/6/os/x86_64" solved my immediate problem of getting the kickstart installation going.

It does leave the problem of using the plain path. Before I report this as a possible bug with either the virt-manager or the urlgrabber developers, could others please confirm this might be a bug or simply an oversight on my part.

Thx in advance

----------

## Maitreya

It's too bad that python does not give the reason of the error here in the traceback.

self.size sounds like a class variable and yes changing from None to 0 is a big difference.

Is there maybe a reason why the apache user is able to read the files but not the user running virt-install?

----------

## Aad-Jan

It's not a question of access rights. I run virt-install as root.

I'm still working on getting kvm and it utilities to work under a specific user.

It looks to be a problem that has to do with parsing the bare file path. I've tried using the file:// prefix but virt-install won't accept that one with the message that it cannot find the directory.

Thx for your reply. I'm continuing my search.

 :Smile: 

----------

