Bug 1048351 - creating a bridge 'str' object has no attribute 'XMLDesc'
Summary: creating a bridge 'str' object has no attribute 'XMLDesc'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: virt-manager
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-03 19:34 UTC by L.L.Robinson
Modified: 2014-03-04 06:46 UTC (History)
9 users (show)

Fixed In Version: virt-manager-1.0.0-3.fc20
Clone Of:
Environment:
Last Closed: 2014-03-04 06:46:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
'virt-manager --debug' output while creating the bridge (20.46 KB, text/plain)
2014-01-10 08:19 UTC, Frederic Grelot
no flags Details
Dialog GUI when creating a bridge (31.47 KB, image/png)
2014-02-12 22:41 UTC, Bob Doolittle
no flags Details
--debug output when there are no interfaces listed for attaching to the bridge (10.57 KB, text/plain)
2014-02-12 22:42 UTC, Bob Doolittle
no flags Details

Description L.L.Robinson 2014-01-03 19:34:45 UTC
Description of problem:
When trying to create a bridged interface on Fedora 20 I get the message "'str' object has no attribute 'XMLDesc'"


Version-Release number of selected component (if applicable):
[root@oiltanker ~]# dnf info virt-manager
Installed Packages
Name        : virt-manager
Arch        : noarch
Epoch       : 0
Version     : 0.10.0
Release     : 5.git1ffcc0cc.fc20
Size        : 3.5 M
Repo        : @System
From repo   : fedora


How reproducible: always


Steps to Reproduce:
1. install virt-manager (dn install -y virt-manager)
2. open virt-manager and choose details on the localhost connection
3. click Network Interfaces tab
4. click the blue plus button
5. choose interface type Brisge and then click Forward
6. select an interface in the list using the checkbox
7. click finish

Actual results:
Message Dialog shows " 'str' object has no attribute 'XMLDesc'"

Expected results:

Bridge should be created

Additional info

it may be related to bug https://bugzilla.redhat.com/show_bug.cgi?id=1028833
however my system-config-services package is the latest version

[root@oiltanker ~]# dnf info system-config-services
Available Packages
Name        : system-config-services
Arch        : noarch
Epoch       : 0
Version     : 0.111.1
Release     : 1.fc20
Size        : 209 k
Repo        : fedora

Comment 1 Cole Robinson 2014-01-06 17:18:30 UTC
Doesn't reproduce for me in my quick test, can you reproduce with virt-manager --debug and post the output here?

Comment 2 Frederic Grelot 2014-01-10 08:19:26 UTC
Created attachment 848091 [details]
'virt-manager --debug' output while creating the bridge

I get the exact same error. I remember having it with F19 as well.
One note about my configuration : I already have VMs configured with the missing bridge that I try to create. Maybe it's a cause of the problem.

See the attachment produced with virt-manager --debug

Comment 3 Frederic Grelot 2014-01-10 08:57:19 UTC
Some extra info :
I looked at the source line that crashed, and it made me think of something. The problem occured while my network configuration was not perfect : I tried adding bridges with the network manager applet, then deleted them (because they failed).
However, it appears that NetworkManager keeped track of those interfaces.
The applet showed nothing, while, in 2 subsequent tries, nmcli gave :
# nmcli con show conf
NAME                UUID                                  TYPE            TIMESTAMP-REAL                  
bridge-slave-p4p1   cf59a901-3efb-4cd2-94a6-c81d1db15be1  802-3-ethernet  never                           
Esclave br0 1       3d6369bf-a016-4362-abb6-ce553bcb74bb  802-3-ethernet  never                           
Wired connection 1  8b510c02-85ff-4c53-8909-5779db1dcdf9  802-3-ethernet  Fri 10 Jan 2014 09:29:50 AM CET 
Esclave bridge0 1   fce70967-fc56-4125-9a88-3911532a3b46  802-3-ethernet  never                           
bridge-slave-eth1   d76b3860-ccd0-497e-b6cc-588153396acc  802-3-ethernet  never 

And in another attempt :

# nmcli con show conf
NAME                UUID                                  TYPE            TIMESTAMP-REAL                  
Wired connection 1  8b510c02-85ff-4c53-8909-5779db1dcdf9  802-3-ethernet  Fri 10 Jan 2014 09:49:42 AM CET 
Esclave br0 1       0b8875b9-51c5-49fb-8c8d-9084d3af3a91  802-3-ethernet  never                           
bridge-slave-p4p1   44cea78d-b3f6-4657-a7e8-60ce0226a29e  802-3-ethernet  never                          


I manually deleted all those erroneous configurations (nmcli con delete ...), and then libvirt was OK creating the interfaces.

According to the "erroneous" python code, it tries to retreive the XML for the misconfigured interfaces : since they do not appear in libvirt (god knows why...), there is no valid XML...
I think, however bad the configuration is, the missing interfaces should be ignored. Maybe it would be wise to show a warning to the user, but let him configure the bridge.

I hope this will help fix the bug!

Comment 4 Frederic Grelot 2014-01-10 09:25:40 UTC
Sorry for adding the informations in several messages, but I try to commit before forgetting... :-)
apparrently, the problems is not related to any erroneous NetworkManager configuration.
The problem is on lines 502/508 of createinterface.py :
for phys in self.conn.get_nodedevs("net"): --> returns lo and p4p1
for name in self.conn.list_interface_names(): --> returns lo only

since in the first loop, row_dict gets initialized with this :
row_dict[phys.interface] = [phys.interface,
                                        False, False, phys.interface,
                                        "ethernet", False, True, None,
                                        phys.address]

phys.interface stays as the first value (corresponding to key 0=INTERFACE_ROW_KEY, which should be replaced with "key = iface.get_backend()" in the second loop).

As I understand it, I should first create the ethernet interface in libvirt.
However, when I try to do so, I get an error : "the name "p4p1" is already in use by another interface"

Comment 5 Frederic Grelot 2014-01-10 09:33:57 UTC
I tried another thing : I commented out lines 155/156 of /usr/share/virt-manager/virtinst/interface.py , in order to be able to create "p4p1" as ethernet interface.
I then created the bridge, almost successfuly :
-at first attempt, I got the following :
 DEBUG (asyncjob:194) Creating async job for function cb=<bound method vmmCreateInterface.do_install of <vmmCreateInterface object at 0x7f9ddc06b5f0 (virtManager+createinterface+vmmCreateInterface at 0x296aac0)>>
[ven., 10 janv. 2014 10:28:34 virt-manager 13104] DEBUG (interface:243) Creating interface 'br1' with xml:
<interface type="bridge" name="br1">
  <bridge stp="on" delay="0.0">
    <interface type="ethernet" name="p4p1">
      <mac address="14:da:e9:03:ee:af"/>
      <protocol family="ipv4">
        <ip address="192.168.1.128" prefix="24"/>
      </protocol>
      <protocol family="ipv6">
        <ip address="fe80::16da:e9ff:fe03:eeaf" prefix="64"/>
      </protocol>
    </interface>
  </bridge>
  <start mode="onboot"/>
  <protocol family="ipv4">
    <ip address="192.168.1.128"/>
    <route gateway="192.168.1.1"/>
  </protocol>
</interface>

[ven., 10 janv. 2014 10:28:37 virt-manager 13104] DEBUG (error:84) error dialog message:
summary=Erreur lors de la création de l'interface : « Could not create interface: internal error: failed to create (start) interface br1: unspecified error - interface br1 failed to become active - possible disconnected cable. »



I then checked, and, strangely, the bridge had still be created :
# brctl show
bridge name	bridge id		STP enabled	interfaces
br1		8000.14dae903eeaf	yes		p4p1

Thus, I tried to validate the page a second time, and this time it worked : the bridge was successfully created!

I will now see if it survives a reboot...

Comment 6 Giuseppe Scrivano 2014-01-10 12:04:51 UTC
I was able to reproduce the same problem here.  The reason seems to be the one described in comment #4, some net devices don't get updated by the second loop so their INTERFACE_ROW_KEY remains a string value.

Comment 7 Cole Robinson 2014-01-18 01:25:55 UTC
Fixed upstream now:

commit 077eac8c1d1359dbedb678346c84c0bc730ff021
Author: Cole Robinson <crobinso>
Date:   Fri Jan 17 20:25:08 2014 -0500

    createinterface: Fix creating bridge with unconfigured interface (bz 1048351

Comment 8 Frederic Grelot 2014-01-18 09:19:05 UTC
Any chance that this will arrive in virt-preview soon?

Thanks!

Frederic.

Comment 9 Cole Robinson 2014-01-18 15:43:07 UTC
I'll be doing a new build within the next few weeks.

Comment 10 Cole Robinson 2014-01-18 15:44:16 UTC
Also, I should have said, thank you Frederic for doing all that work to track down the bug, certainly made life easier for me :)

If you don't want to wait for a build, running virt-manager from git is quite easy:

git clone git://git.fedorahosted.org/virt-manager.git
cd virt-manager
./virt-manager

should be all that's needed

Comment 11 Frederic Grelot 2014-01-20 17:14:49 UTC
>Also, I should have said, thank you Frederic for doing all that work to track 
>down the bug, certainly made life easier for me :)

It's too much of a constrain for me to commit to a specific project on a long-term basis, so I'm trying to do "my part of the job" when I hit bugs :-)

>git clone git://git.fedorahosted.org/virt-manager.git
>cd virt-manager
>./virt-manager

I forgot the magic world of interpreted languages :-)
I've tested it, and it almost works : comment #5 is still valid (had to create the bridge twice)
Should I open a separate bug?

Frédéric.

Comment 12 Cole Robinson 2014-01-20 18:03:11 UTC
(In reply to Frederic Grelot from comment #11)

> I've tested it, and it almost works : comment #5 is still valid (had to
> create the bridge twice)
> Should I open a separate bug?
> 

Please file a separate bug: probably a libvirt or netcf issue, but just file it against virt-manager and we can go from there. And please provide the virt-manager --debug output when reproducing.

Comment 13 Frederic Grelot 2014-01-20 18:09:45 UTC
Well, actually I already filed a bug about a similar problem, and I think it's the same one :
https://bugzilla.redhat.com/show_bug.cgi?id=1051401
This one is about NetworkManager, but the problem is identical. Nobody reacted on it thought.

Frederic.

Comment 14 Shawn Starr 2014-01-27 04:39:06 UTC
I confirm this is broken in my setup as well.

Comment 15 Shawn Starr 2014-01-27 05:32:12 UTC
This is still broken in git:

Note: This only works until you reboot machine... then NM complains and nothing gets configured again:

Adding: 
NM_CONTROLLED=no

to the generated ifcfg files will work, I disabled NetworkManager for now.

Comment 16 Shawn Starr 2014-01-27 05:35:19 UTC
(since this falls back to /etc/init.d/network that systemd will launch)

Comment 17 Cole Robinson 2014-01-27 14:33:40 UTC
Shawn, the original report is still broken in git, or the bridge issue reported in Comment #13? NM_CONTROLLED=no should have no bearing on the initial bug report.

Comment 18 Shawn Starr 2014-01-28 01:13:04 UTC
We can say the parse issue is fixed. I will spin off another bug wrt to the other issue.

Comment 19 Bob Doolittle 2014-02-12 22:41:40 UTC
Created attachment 862563 [details]
Dialog GUI when creating a bridge

Comment 20 Bob Doolittle 2014-02-12 22:42:42 UTC
Created attachment 862564 [details]
--debug output when there are no interfaces listed for attaching to the bridge

Comment 21 Bob Doolittle 2014-02-12 22:43:21 UTC
I have the same problem. However, when I try the version from git://git.fedorahosted.org/virt-manager.git it does not work for me.

When I get to the point where I am adding the bridge and it is in "Step 2 of 2" it lists no interfaces for me to attach to the bridge. I have attached a PNG of the dialog screen and the debug output.

Comment 22 Cole Robinson 2014-02-13 15:18:19 UTC
Here;s the traceback:

[Wed, 12 Feb 2014 14:34:51 virt-manager 7742] DEBUG (createinterface:123) Showing new interface wizard
[Wed, 12 Feb 2014 14:34:52 virt-manager 7742] DEBUG (cli:182) Uncaught exception:
Traceback (most recent call last):
  File "/home/rad/virt-manager/virtManager/createinterface.py", line 880, in page_changed
    self.populate_details_page()
  File "/home/rad/virt-manager/virtManager/createinterface.py", line 403, in populate_details_page
    self.populate_interface_list(itype)
  File "/home/rad/virt-manager/virtManager/createinterface.py", line 551, in populate_interface_list
    key.name = name
  File "/home/rad/virt-manager/virtinst/xmlbuilder.py", line 617, in setter
    self._validate_cb(xmlbuilder, val)
  File "/home/rad/virt-manager/virtinst/interface.py", line 156, in _validate_name
    name)
ValueError: Name 'wlp2s0' already in use by another interface.

Indeed that looks like an upstream issue, I'll take a look

Comment 23 Cole Robinson 2014-02-13 16:41:45 UTC
Bob, can you file a new virt-manager bug for upstream: Community->Virtualization Tools->virt-manager

At the new bug report, please add your virt-manager.log from above, and additionally provide:

sudo virsh iface-list --all
sudo virsh iface-dumpxml $iface   (for ever interface name listed with list --all)

Comment 24 Bob Doolittle 2014-02-13 17:46:18 UTC
Cole, What should I list as the version?

Comment 25 Cole Robinson 2014-02-13 17:47:01 UTC
Doesn't matter, I don't pay attention to that field.

Comment 26 Fedora Update System 2014-02-15 00:56:20 UTC
virt-manager-1.0.0-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/virt-manager-1.0.0-1.fc20

Comment 27 Fedora Update System 2014-02-18 23:03:06 UTC
virt-manager-1.0.0-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/virt-manager-1.0.0-2.fc20

Comment 28 Fedora Update System 2014-02-22 00:38:13 UTC
Package virt-manager-1.0.0-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing virt-manager-1.0.0-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-2789/virt-manager-1.0.0-2.fc20
then log in and leave karma (feedback).

Comment 29 Mustafa Muhammad 2014-02-27 11:57:12 UTC
(In reply to Fedora Update System from comment #28)
> Package virt-manager-1.0.0-2.fc20:
> * should fix your issue,
> * was pushed to the Fedora 20 testing repository,
> * should be available at your local mirror within two days.
> Update it with:
> # su -c 'yum update --enablerepo=updates-testing virt-manager-1.0.0-2.fc20'
> as soon as you are able to.
> Please go to the following url:
> https://admin.fedoraproject.org/updates/FEDORA-2014-2789/virt-manager-1.0.0-
> 2.fc20
> then log in and leave karma (feedback).

Installed the update, now it only shows lo interface.

Comment 30 Cole Robinson 2014-02-27 14:09:40 UTC
(In reply to Mustafa from comment #29)
> (In reply to Fedora Update System from comment #28)
> > Package virt-manager-1.0.0-2.fc20:
> > * should fix your issue,
> > * was pushed to the Fedora 20 testing repository,
> > * should be available at your local mirror within two days.
> > Update it with:
> > # su -c 'yum update --enablerepo=updates-testing virt-manager-1.0.0-2.fc20'
> > as soon as you are able to.
> > Please go to the following url:
> > https://admin.fedoraproject.org/updates/FEDORA-2014-2789/virt-manager-1.0.0-
> > 2.fc20
> > then log in and leave karma (feedback).
> 
> Installed the update, now it only shows lo interface.

Yes, this change is currently working around a netcf bug which you are seeing:

https://bugzilla.redhat.com/show_bug.cgi?id=1065396

Comment 31 Bob Doolittle 2014-02-27 20:12:33 UTC
WRT Comment 21 https://bugzilla.redhat.com/show_bug.cgi?id=1048351#c21 I no longer see the issue even with what's currently in the standard Updates repository (i.e. virt-manager-0.10.0-5.git1ffcc0cc.fc20.noarch). I'm not clear on when exactly the issue cleared up. So I can't comment on what's in updates-testing, sorry.

Comment 32 Fedora Update System 2014-02-28 18:24:35 UTC
virt-manager-1.0.0-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/virt-manager-1.0.0-3.fc20

Comment 33 Fedora Update System 2014-03-04 06:46:08 UTC
virt-manager-1.0.0-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


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