[GH-ISSUE #436] [bug] Incompatibility with virtual interfaces #328

Closed
opened 2026-02-27 16:38:53 +03:00 by kerem · 10 comments
Owner

Originally created by @generalmanager on GitHub (Sep 19, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/436

WebVirtMgr seems to be incompatible with virtual network interfaces. After adding virtual interfaces to my /etc/network/interfaces, I got a 500 server error when accessing the interfaces page.

After turning debugging on, I get this:

NoReverseMatch at /interfaces/1/

Reverse for 'interface' with arguments '(u'1', 'eth0:0')' and keyword arguments '{}' not found.

Request Method: GET
Request URL: http://localhost:8000/interfaces/1/
Django Version: 1.5.5
Exception Type: NoReverseMatch
Exception Value:

Reverse for 'interface' with arguments '(u'1', 'eth0:0')' and keyword arguments '{}' not found.

Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 426
Python Executable: /usr/bin/python
Python Version: 2.7.6

If you need any more info to fix this, I'm happy to help.

Originally created by @generalmanager on GitHub (Sep 19, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/436 WebVirtMgr seems to be incompatible with virtual network interfaces. After adding virtual interfaces to my /etc/network/interfaces, I got a 500 server error when accessing the interfaces page. After turning debugging on, I get this: > NoReverseMatch at /interfaces/1/ > > Reverse for 'interface' with arguments '(u'1', 'eth0:0')' and keyword arguments '{}' not found. > > Request Method: GET > Request URL: http://localhost:8000/interfaces/1/ > Django Version: 1.5.5 > Exception Type: NoReverseMatch > Exception Value: > > Reverse for 'interface' with arguments '(u'1', 'eth0:0')' and keyword arguments '{}' not found. > > Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 426 > Python Executable: /usr/bin/python > Python Version: 2.7.6 If you need any more info to fix this, I'm happy to help.
kerem closed this issue 2026-02-27 16:38:53 +03:00
Author
Owner

@aprt5pr commented on GitHub (Sep 21, 2014):

This is actually a libvirt limitation. The interface names cannot contain any special characters. Otherwise, libvirt cannot parse the configuration file for that interface. You can test this with the following:

# virsh iface-list

It will only return device names that do not contain special characters.

You could always just edit the XML file directly for a domain if you really want to use exotic interface names.

hth

<!-- gh-comment-id:56287221 --> @aprt5pr commented on GitHub (Sep 21, 2014): This is actually a libvirt limitation. The interface names cannot contain any special characters. Otherwise, libvirt cannot parse the configuration file for that interface. You can test this with the following: ``` # virsh iface-list ``` It will only return device names that do not contain special characters. You could always just edit the XML file directly for a domain if you really want to use exotic interface names. hth
Author
Owner

@retspen commented on GitHub (Oct 15, 2014):

If libvirt can't support this, WebVirtMgr can't support as well.

<!-- gh-comment-id:59200438 --> @retspen commented on GitHub (Oct 15, 2014): If libvirt can't support this, WebVirtMgr can't support as well.
Author
Owner

@ozalexo commented on GitHub (Mar 16, 2015):

Hmm. Looks like libvirt 1.2.2 supports virtual interfaces, but webvirtmgr still returns the error described above.

$ sudo virsh iface-list
 Name                 State      MAC Address
---------------------------------------------------
 eth0                 active     de:ad:de:ad:be:ef
 eth0:1               active     
 lo                   active     00:00:00:00:00:00

$ virsh --version
1.2.2

OS: Ubuntu 14.04.2 LTS x86_64

<!-- gh-comment-id:81558304 --> @ozalexo commented on GitHub (Mar 16, 2015): Hmm. Looks like libvirt 1.2.2 supports virtual interfaces, but webvirtmgr still returns the error described above. ``` $ sudo virsh iface-list Name State MAC Address --------------------------------------------------- eth0 active de:ad:de:ad:be:ef eth0:1 active lo active 00:00:00:00:00:00 $ virsh --version 1.2.2 ``` OS: Ubuntu 14.04.2 LTS x86_64
Author
Owner

@retspen commented on GitHub (Mar 16, 2015):

Debug message????

<!-- gh-comment-id:81601928 --> @retspen commented on GitHub (Mar 16, 2015): Debug message????
Author
Owner

@ozalexo commented on GitHub (Mar 16, 2015):

Exactly the same, as I understood:

ERROR:django.request:Internal Server Error: /interfaces/1/
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/var/www/webvirtmgr/interfaces/views.py", line 54, in interfaces
    return render_to_response('interfaces.html', locals(), context_instance=RequestContext(request))
  File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py", line 29, in render_to_response
    return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 177, in render_to_string
    return t.render(context_instance)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render
    return self._render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
    bit = self.render_node(node, context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node
    return node.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 124, in render
    return compiled_parent._render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render
    return self.nodelist.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
    bit = self.render_node(node, context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node
    return node.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 63, in render
    result = block.nodelist.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
    bit = self.render_node(node, context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node
    return node.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 285, in render
    return nodelist.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render
    bit = self.render_node(node, context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node
    return node.render(context)
  File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 196, in render
    nodelist.append(node.render(context))
  File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 426, in render
    raise e
NoReverseMatch: Reverse for 'interface' with arguments '(u'1', 'eth0:1')' and keyword arguments '{}' not found.

Just in case, here is my /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet dhcp
  hostname zooweb
  hwaddress ether de:ad:de:ad:be:ef
<!-- gh-comment-id:81606864 --> @ozalexo commented on GitHub (Mar 16, 2015): Exactly the same, as I understood: ``` ERROR:django.request:Internal Server Error: /interfaces/1/ Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/var/www/webvirtmgr/interfaces/views.py", line 54, in interfaces return render_to_response('interfaces.html', locals(), context_instance=RequestContext(request)) File "/usr/local/lib/python2.7/dist-packages/django/shortcuts/__init__.py", line 29, in render_to_response return HttpResponse(loader.render_to_string(*args, **kwargs), **httpresponse_kwargs) File "/usr/local/lib/python2.7/dist-packages/django/template/loader.py", line 177, in render_to_string return t.render(context_instance) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140, in render return self._render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render return self.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 124, in render return compiled_parent._render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134, in _render return self.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py", line 63, in render result = block.nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 285, in render return nodelist.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 830, in render bit = self.render_node(node, context) File "/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 844, in render_node return node.render(context) File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 196, in render nodelist.append(node.render(context)) File "/usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py", line 426, in render raise e NoReverseMatch: Reverse for 'interface' with arguments '(u'1', 'eth0:1')' and keyword arguments '{}' not found. ``` Just in case, here is my `/etc/network/interfaces`: ``` auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth0:1 iface eth0:1 inet dhcp hostname zooweb hwaddress ether de:ad:de:ad:be:ef ```
Author
Owner

@ozalexo commented on GitHub (Mar 16, 2015):

It does not work.
Update steps:

  1. git pull at my copy
  2. Steps from Upgrade instruction.
$ sudo ./manage.py collectstatic
WARNING:root:No local_settings file found.

You have requested to collect static files at the destination
location as specified in your settings.

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes

0 static files copied, 75 unmodified.
  1. Reboot PC.

Log exactly the same. What can be the reason?

Fix definitely was applied:

-rw-r--r-- 1 www-data www-data 1870 Mar 16 16:00 ./webvirtmgr/urls.py
-rw-r--r-- 1 www-data www-data 2235 Mar 16 16:02 ./webvirtmgr/urls.pyc
<!-- gh-comment-id:81675830 --> @ozalexo commented on GitHub (Mar 16, 2015): It does not work. Update steps: 1. `git pull` at my copy 2. [Steps from Upgrade instruction](https://github.com/retspen/webvirtmgr/wiki/Install-WebVirtMgr#read-readmemd-check-settings-maybe-something-has-changed-and-then-2). ``` $ sudo ./manage.py collectstatic WARNING:root:No local_settings file found. You have requested to collect static files at the destination location as specified in your settings. This will overwrite existing files! Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: yes 0 static files copied, 75 unmodified. ``` 1. Reboot PC. Log exactly the same. What can be the reason? Fix definitely was applied: ``` -rw-r--r-- 1 www-data www-data 1870 Mar 16 16:00 ./webvirtmgr/urls.py -rw-r--r-- 1 www-data www-data 2235 Mar 16 16:02 ./webvirtmgr/urls.pyc ```
Author
Owner

@retspen commented on GitHub (Mar 16, 2015):

Can you show your ./webvirtmgr/urls.py?

<!-- gh-comment-id:81677729 --> @retspen commented on GitHub (Mar 16, 2015): Can you show your <code>./webvirtmgr/urls.py</code>?
Author
Owner

@ozalexo commented on GitHub (Mar 16, 2015):

user@host:/var/www/webvirtmgr$ cat ./webvirtmgr/urls.py
from django.conf.urls import patterns, url
from django.conf import settings

urlpatterns = patterns('',
    url(r'^$', 'servers.views.index', name='index'),
    url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'),
    url(r'^servers/$', 'servers.views.servers_list', name='servers_list'),
    url(r'^infrastructure/$', 'servers.views.infrastructure', name='infrastructure'),
    url(r'^host/(\d+)/$', 'hostdetail.views.overview', name='overview'),
    url(r'^create/(\d+)/$', 'create.views.create', name='create'),
    url(r'^storages/(\d+)/$', 'storages.views.storages', name='storages'),
    url(r'^storage/(\d+)/([\w\-\.]+)/$', 'storages.views.storage', name='storage'),
    url(r'^networks/(\d+)/$', 'networks.views.networks', name='networks'),
    url(r'^network/(\d+)/([\w\-\.]+)/$', 'networks.views.network', name='network'),
    url(r'^interfaces/(\d+)/$', 'interfaces.views.interfaces', name='interfaces'),
    url(r'^interface/(\d+)/([\w\.]+)$', 'interfaces.views.interface', name='interface'),
    url(r'^instance/(\d+)/([\w\-\.\:]+)/$', 'instance.views.instance', name='instance'),
    url(r'^instances/(\d+)/$', 'instance.views.instances', name='instances'),
    url(r'^secrets/(\d+)/$', 'secrets.views.secrets', name='secrets'),
    url(r'^console/$', 'console.views.console', name='console'),
    url(r'^info/hostusage/(\d+)/$', 'hostdetail.views.hostusage', name='hostusage'),
    url(r'^info/insts_status/(\d+)/$', 'instance.views.insts_status', name='insts_status'),
    url(r'^info/instusage/(\d+)/([\w\-\.]+)/$', 'instance.views.instusage', name='instusage'),
)

urlpatterns += patterns('',
    (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
)
user@host:/var/www/webvirtmgr$ git log -2
commit 206a4fee0aa7fdae1a7164e95caa36f10d51389f
Merge: 36276ac 525c9df
Author: Anatoliy Guskov <anatoliy.guskov@gmail.com>
Date:   Mon Mar 16 14:53:24 2015 +0200

    Merge pull request #523 from tuvistavie/master

    Fix LVM device validation

commit 36276acebc49877db93fbbb70a1682a3d70cbecf
Author: Retspen <anatoliy.guskov@gmail.com>
Date:   Mon Mar 16 14:52:04 2015 +0200

    Fix #436
<!-- gh-comment-id:81678883 --> @ozalexo commented on GitHub (Mar 16, 2015): ``` user@host:/var/www/webvirtmgr$ cat ./webvirtmgr/urls.py ``` ``` python from django.conf.urls import patterns, url from django.conf import settings urlpatterns = patterns('', url(r'^$', 'servers.views.index', name='index'), url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'), url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'), url(r'^servers/$', 'servers.views.servers_list', name='servers_list'), url(r'^infrastructure/$', 'servers.views.infrastructure', name='infrastructure'), url(r'^host/(\d+)/$', 'hostdetail.views.overview', name='overview'), url(r'^create/(\d+)/$', 'create.views.create', name='create'), url(r'^storages/(\d+)/$', 'storages.views.storages', name='storages'), url(r'^storage/(\d+)/([\w\-\.]+)/$', 'storages.views.storage', name='storage'), url(r'^networks/(\d+)/$', 'networks.views.networks', name='networks'), url(r'^network/(\d+)/([\w\-\.]+)/$', 'networks.views.network', name='network'), url(r'^interfaces/(\d+)/$', 'interfaces.views.interfaces', name='interfaces'), url(r'^interface/(\d+)/([\w\.]+)$', 'interfaces.views.interface', name='interface'), url(r'^instance/(\d+)/([\w\-\.\:]+)/$', 'instance.views.instance', name='instance'), url(r'^instances/(\d+)/$', 'instance.views.instances', name='instances'), url(r'^secrets/(\d+)/$', 'secrets.views.secrets', name='secrets'), url(r'^console/$', 'console.views.console', name='console'), url(r'^info/hostusage/(\d+)/$', 'hostdetail.views.hostusage', name='hostusage'), url(r'^info/insts_status/(\d+)/$', 'instance.views.insts_status', name='insts_status'), url(r'^info/instusage/(\d+)/([\w\-\.]+)/$', 'instance.views.instusage', name='instusage'), ) urlpatterns += patterns('', (r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), ) ``` ``` user@host:/var/www/webvirtmgr$ git log -2 commit 206a4fee0aa7fdae1a7164e95caa36f10d51389f Merge: 36276ac 525c9df Author: Anatoliy Guskov <anatoliy.guskov@gmail.com> Date: Mon Mar 16 14:53:24 2015 +0200 Merge pull request #523 from tuvistavie/master Fix LVM device validation commit 36276acebc49877db93fbbb70a1682a3d70cbecf Author: Retspen <anatoliy.guskov@gmail.com> Date: Mon Mar 16 14:52:04 2015 +0200 Fix #436 ```
Author
Owner

@retspen commented on GitHub (Mar 16, 2015):

As can you see file on github and your file is different:

https://github.com/retspen/webvirtmgr/blob/master/webvirtmgr/urls.py#L18

<!-- gh-comment-id:81683115 --> @retspen commented on GitHub (Mar 16, 2015): As can you see file on github and your file is different: https://github.com/retspen/webvirtmgr/blob/master/webvirtmgr/urls.py#L18
Author
Owner

@ozalexo commented on GitHub (Mar 16, 2015):

Lines are equal.
Could you please check this pull request?
https://github.com/retspen/webvirtmgr/pull/524

<!-- gh-comment-id:81712699 --> @ozalexo commented on GitHub (Mar 16, 2015): Lines are equal. Could you please check this pull request? https://github.com/retspen/webvirtmgr/pull/524
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/webvirtmgr#328
No description provided.