error creating new machine with "Fedora20+" profile

Bug #1391673 reported by Christian Kirbach
80
This bug affects 15 people
Affects Status Importance Assigned to Milestone
One Hundred Papercuts
Medium
Unassigned
virt-manager (Ubuntu)
Medium
Unassigned
Utopic
Undecided
Unassigned
Vivid
Undecided
Unassigned
Wily
Medium
Unassigned

Bug Description

error creating new machine with "Fedora20+" profile

in the wizard:
using local ISO install image
selecting OS Linux/Fedora 20 or later
and any storage option

error message then is

Installation could not be completed: «global name 'fetcher' is not defined»

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1820, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 384, in start_install
    self._prepare_install(meter, dry)
  File "/usr/share/virt-manager/virtinst/guest.py", line 277, in _prepare_install
    util.make_scratchdir(self.conn, self.type))
  File "/usr/share/virt-manager/virtinst/installer.py", line 201, in prepare
    self._prepare(guest, meter, scratchdir)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 442, in _prepare
    dev = self._prepare_cdrom_url(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 341, in _prepare_cdrom_url
    store = urlfetcher.getDistroStore(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 338, in getDistroStore
    if store.isValidStore():
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 960, in isValidStore
    elif fetcher.hasFile("initrd.gz") and fetcher.hasFile("linux"):
NameError: global name 'fetcher' is not defined

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: virt-manager 1:1.0.1-0ubuntu2
ProcVersionSignature: Ubuntu 3.16.0-24.32-generic 3.16.4
Uname: Linux 3.16.0-24-generic x86_64
NonfreeKernelModules: fglrx
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: GNOME
Date: Tue Nov 11 23:21:49 2014
InstallationDate: Installed on 2013-01-08 (672 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
PackageArchitecture: all
SourcePackage: virt-manager
UpgradeStatus: Upgraded to utopic on 2014-10-23 (19 days ago)

Revision history for this message
Christian Kirbach (christian-kirbach-e) wrote :
Revision history for this message
Christian Kirbach (christian-kirbach-e) wrote :

This patch gets me past the error (but to some socket error)

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "virt-manager-urlfetcher.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
strowi (forums-hasnoname) wrote :

Hi,

i still get the same error in 14.10 when trying to install from network via HTTP-Url..

Revision history for this message
Seyeong Kim (seyeongkim) wrote :

 Hello

after revert attached patch ( fetcher -> self.fetcher )

it works

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in virt-manager (Ubuntu):
status: New → Confirmed
Revision history for this message
Sergiu Bivol (sergiu-bivol) wrote :

Same here, with profile „Microsoft Windows 7 (or later)”.
---------------------------------------
Unable to complete install: 'global name 'fetcher' is not defined'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1820, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 384, in start_install
    self._prepare_install(meter, dry)
  File "/usr/share/virt-manager/virtinst/guest.py", line 277, in _prepare_install
    util.make_scratchdir(self.conn, self.type))
  File "/usr/share/virt-manager/virtinst/installer.py", line 201, in prepare
    self._prepare(guest, meter, scratchdir)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 442, in _prepare
    dev = self._prepare_cdrom_url(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 341, in _prepare_cdrom_url
    store = urlfetcher.getDistroStore(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 338, in getDistroStore
    if store.isValidStore():
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 960, in isValidStore
    elif fetcher.hasFile("initrd.gz") and fetcher.hasFile("linux"):
NameError: global name 'fetcher' is not defined

description: updated
Changed in hundredpapercuts:
status: New → Confirmed
Changed in virt-manager (Ubuntu):
importance: Undecided → Medium
Changed in hundredpapercuts:
importance: Undecided → Medium
Revision history for this message
Hagen Kuehn (hag-k) wrote :

I think I got to the bottom of it.

Short version:
If the ".treeinfo" file is missing from the repository, the error "ERROR global name 'fetcher' is not defined" is encountered.

Long version:
I had used wget to download the Centos 7 packages from a website mirror to keep them on my local HTTP server. What it didn't copy were the hidden files.

When I encountered this error I found this bug report and could successfully work around/ solve this problem by applying the above "virt-manager-urlfetcher.patch" patch.

Later then I realized that the PXE installer reports a 404 error for the ".treeinfo" file. I then downloaded the ".treeinfo" from the repository and also reverted the "urlfetcher.py" to its original code line. Now the error was not encountered anymore.

In the light of this, I presume that there is the possiblity that the others encountered this error because of the the missing ".treeinfo" file.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for the information. That may weed out quite a few of the datapoints, although the 'global name fetcher not defined' error still looks related-but-different.

Revision history for this message
Christian Kirbach (christian-kirbach-e) wrote :

I upgraded to 15.04beta and face this issue again

virt-manager 1:1.0.1-4ubuntu2

It is just a problem with this single profile. Other profiles do work.

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 91, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1819, in do_install
    guest.start_install(meter=meter)
  File "/usr/share/virt-manager/virtinst/guest.py", line 403, in start_install
    noboot)
  File "/usr/share/virt-manager/virtinst/guest.py", line 467, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/dist-packages/libvirt.py", line 3422, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)
libvirtError: internal error: process exited while connecting to monitor: 2015-02-22T11:02:14.744134Z qemu-system-x86_64: -chardev socket,id=charchannel0,path=/var/lib/libvirt/qemu/channel/target/fedora20.org.qemu.guest_agent.0,server,nowait: Failed to bind socket: No such file or directory

The path /var/lib/libvirt/qemu/channel/target/ seems to be dynamically created, as it does not belong to any packages in vivid. Creating it with proper permissions does not make any difference.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Christian,

was that comment meant for another bug?

Revision history for this message
Christian Kirbach (christian-kirbach-e) wrote :

No, meant for this report.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ok - it seems like a very different bug, as there is no reference to 'fetcher' or urlfetcher.py in the error output.

Revision history for this message
Zach Villers (zachvatwork) wrote :

I am also getting this error with virt-install

When running the following in ubuntu 15.04;

 virt-install -n dummy -r 512 --vcpus=1 --os-type=linux
--os-variant=rhel7 -w bridge:virbr0 --disk
path=/var/lib/libvirt/images/dummy.qcow2,size=8 -l
http://pubmirrors.dal.corespace.com/centos/7/isos/x86_64/ --dry-run

I am given "ERROR global name 'fetcher' is not defined."

Enabling debug shows ( snipped output )

[Thu, 21 May 2015 14:20:07 virt-install 13914] ERROR (cli:235) global
name 'fetcher' is not defined
[Thu, 21 May 2015 14:20:07 virt-install 13914] DEBUG (cli:237)
Traceback (most recent call last):
  File "/usr/share/virt-manager/virt-install", line 875, in <module>
    sys.exit(main())
  File "/usr/share/virt-manager/virt-install", line 860, in main
    guest = build_guest_instance(conn, options, parsermap)
  File "/usr/share/virt-manager/virt-install", line 470, in
build_guest_instance
    get_install_media(guest, options.location, options.cdrom)
  File "/usr/share/virt-manager/virt-install", line 233, in
get_install_media
    validate_install_media(guest, location, cdpath, cdinstall)
  File "/usr/share/virt-manager/virt-install", line 243, in
validate_install_media
    guest.installer.check_location(guest)
  File "/usr/share/virt-manager/virtinst/distroinstaller.py", line 471,
in check_location
    urlfetcher.detectMediaDistro(guest, self.location)
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 360, in
detectMediaDistro
    store = getDistroStore(guest, fetcher)
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 338, in
getDistroStore
    if store.isValidStore():
  File "/usr/share/virt-manager/virtinst/urlfetcher.py", line 960, in
isValidStore
    elif fetcher.hasFile("initrd.gz") and fetcher.hasFile("linux"):
NameError: global name 'fetcher' is not defined

My python-fu is quite weak and I can't figure this out. I was able to
run
> python setup.py test_urls

Some URLs Errored, 1 failed, many passed.

The packages associated for ubuntu 15.04 are;

ii virt-manager 1:1.0.1-5ubuntu all desktop application for managing virtual mach
ii virtinst 1:1.0.1-5ubuntu all

For what it's worth. I install virt-manager 1.2 from source (required an additional library libosinfo-1.0-0:amd64 (0.2.11-1.1, automatic)) and found other errors trying to verify the source of the .iso, however, I did not get the python global name error that you get from running the ubuntu 15.04 version.

I contacted the owner of the package and was told "

I think this is an ubuntu specific bug, either a botched backport or some
broken custom patch they have, since I don't see code like that in v1.0.1
virt-manager. I'd suggest filing a bug with them"

Revision history for this message
Zach Villers (zachvatwork) wrote :

Sorry - also wanted to say that the patch listed above does not work for me.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

This is caused by the debian/patches/virtinst/9004_ubuntu_fix_tree_support.patch patch that is obviously broken.

Changed in virt-manager (Ubuntu Utopic):
status: New → Confirmed
Changed in virt-manager (Ubuntu Vivid):
status: New → Confirmed
Changed in virt-manager (Ubuntu Utopic):
status: Confirmed → Won't Fix
Changed in virt-manager (Ubuntu Wily):
status: Confirmed → Triaged
Changed in virt-manager (Ubuntu Vivid):
status: Confirmed → Triaged
Revision history for this message
Nathan Rennie-Waldock (nathan-renniewaldock) wrote :

Attached a fixed version of 9004_ubuntu_fix_tree_support for wily (change "fetcher" to "self.fetcher").
Rebuilding with this patch, I was able to install a Fedora 23 machine, as well as Ubuntu 15.10

Revision history for this message
Nathan Rennie-Waldock (nathan-renniewaldock) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers