[GH-ISSUE #300] Crashes with a specific VM configuration #235

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

Originally created by @romu70 on GitHub (May 6, 2014).
Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/300

Don't really know where I did something wrong, but I did. I created and removed few times the same VM and now, there is no way to display the instances list of my server.

The "Infrastructure" link works and this specific VM is visible. But if I click on the server link (so to go to {server}:8000/instances/1, I get a 500 ERROR.

I restarted the supervisor service, same problem. If I remove this VM, no trouble anymore. But I really need it. Think something remains recorded on the HDD even if I delete it. All works fine with virt-manager.

Any help to debug and remove the issue? Thanks.

Originally created by @romu70 on GitHub (May 6, 2014). Original GitHub issue: https://github.com/retspen/webvirtmgr/issues/300 Don't really know where I did something wrong, but I did. I created and removed few times the same VM and now, there is no way to display the instances list of my server. The "Infrastructure" link works and this specific VM is visible. But if I click on the server link (so to go to {server}:8000/instances/1, I get a 500 ERROR. I restarted the supervisor service, same problem. If I remove this VM, no trouble anymore. But I really need it. Think something remains recorded on the HDD even if I delete it. All works fine with virt-manager. Any help to debug and remove the issue? Thanks.
kerem closed this issue 2026-02-27 16:38:32 +03:00
Author
Owner

@romu70 commented on GitHub (May 6, 2014):

I checked the problem is really on this specific VM as the URL {server}:8000/instances/1/{vm name} works well for all VMs except this one.

<!-- gh-comment-id:42303849 --> @romu70 commented on GitHub (May 6, 2014): I checked the problem is really on this specific VM as the URL {server}:8000/instances/1/{vm name} works well for all VMs except this one.
Author
Owner

@retspen commented on GitHub (May 6, 2014):

$ virsh dumpxml your_vm_name

<!-- gh-comment-id:42349992 --> @retspen commented on GitHub (May 6, 2014): $ virsh dumpxml your_vm_name
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

Do you want me to post the xml here? Because this command doesn't fix the problem.

<!-- gh-comment-id:42396552 --> @romu70 commented on GitHub (May 7, 2014): Do you want me to post the xml here? Because this command doesn't fix the problem.
Author
Owner

@retspen commented on GitHub (May 7, 2014):

Yes, I do. Post the xml there.

<!-- gh-comment-id:42396851 --> @retspen commented on GitHub (May 7, 2014): Yes, I do. Post the xml there.
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

Here it is:

<domain type='kvm'>
  <name>rtc5-dev</name>
  <uuid>9dac6e76-a5f1-d391-f3c4-7f7080e5388b</uuid>
  <memory unit='KiB'>4194304</memory>
  <currentMemory unit='KiB'>4194304</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='localtime'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm-spice</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/vms/rtc5-dev.img'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:eb:b2:ea'/>
      <source bridge='br0'/>
      <model type='rtl8139'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <input type='tablet' bus='usb'/>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <sound model='ich6'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='vga' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </memballoon>
  </devices>
</domain>

There is something weird aside the crash. If I run this VM through virt-manager, the img file owner is set to root. This doesn't happen with other VMs.

<!-- gh-comment-id:42397183 --> @romu70 commented on GitHub (May 7, 2014): Here it is: ``` xml <domain type='kvm'> <name>rtc5-dev</name> <uuid>9dac6e76-a5f1-d391-f3c4-7f7080e5388b</uuid> <memory unit='KiB'>4194304</memory> <currentMemory unit='KiB'>4194304</currentMemory> <vcpu placement='static'>1</vcpu> <os> <type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type> <boot dev='hd'/> </os> <features> <acpi/> <apic/> <pae/> </features> <clock offset='localtime'/> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>restart</on_crash> <devices> <emulator>/usr/bin/kvm-spice</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/vms/rtc5-dev.img'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='usb' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/> </controller> <controller type='pci' index='0' model='pci-root'/> <controller type='ide' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/> </controller> <interface type='bridge'> <mac address='52:54:00:eb:b2:ea'/> <source bridge='br0'/> <model type='rtl8139'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> <serial type='pty'> <target port='0'/> </serial> <console type='pty'> <target type='serial' port='0'/> </console> <input type='tablet' bus='usb'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <graphics type='vnc' port='-1' autoport='yes'/> <sound model='ich6'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </sound> <video> <model type='vga' vram='9216' heads='1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/> </video> <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> </domain> ``` There is something weird aside the crash. If I run this VM through virt-manager, the img file owner is set to root. This doesn't happen with other VMs.
Author
Owner

@retspen commented on GitHub (May 7, 2014):

Change in file settings.py:
DEBUG=False to DEBUG=True

and show your error message.

<!-- gh-comment-id:42397685 --> @retspen commented on GitHub (May 7, 2014): Change in file settings.py: DEBUG=False to DEBUG=True and show your error message.
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

Here it is, could be explained by my several attemps of creating this VM?

This VM appears only one time in /etc/libvirt/qemu.

MultipleObjectsReturned at /instance/1/rtc5-dev/

get() returned more than one Instance -- it returned 3!

Request Method:     GET
Request URL:    http://sublime:8000/instance/1/rtc5-dev/
Django Version:     1.5.5
Exception Type:     MultipleObjectsReturned
Exception Value:    

get() returned more than one Instance -- it returned 3!

Exception Location:     /usr/local/lib/python2.7/dist-packages/django/db/models/query.py in get, line 407
Python Executable:  /usr/bin/python
Python Version:     2.7.6
Python Path:    

['/var/www/webvirtmgr',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages/PILcompat',
 '/usr/lib/python2.7/dist-packages/gtk-2.0']

Server time:    Wed, 7 May 2014 10:41:07 +0300
<!-- gh-comment-id:42398108 --> @romu70 commented on GitHub (May 7, 2014): Here it is, could be explained by my several attemps of creating this VM? This VM appears only one time in /etc/libvirt/qemu. ``` MultipleObjectsReturned at /instance/1/rtc5-dev/ get() returned more than one Instance -- it returned 3! Request Method: GET Request URL: http://sublime:8000/instance/1/rtc5-dev/ Django Version: 1.5.5 Exception Type: MultipleObjectsReturned Exception Value: get() returned more than one Instance -- it returned 3! Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/models/query.py in get, line 407 Python Executable: /usr/bin/python Python Version: 2.7.6 Python Path: ['/var/www/webvirtmgr', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gtk-2.0'] Server time: Wed, 7 May 2014 10:41:07 +0300 ```
Author
Owner

@retspen commented on GitHub (May 7, 2014):

Return settings.py

$ sqllite3 webvirtmgr.sqlite
sqlite> delete from instance_instance where name="rtc5-dev";
sqlite> select * from instance_instance;

<!-- gh-comment-id:42398581 --> @retspen commented on GitHub (May 7, 2014): Return settings.py $ sqllite3 webvirtmgr.sqlite sqlite> delete from instance_instance where name="rtc5-dev"; sqlite> select \* from instance_instance;
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

"delete from instance_instance where name="rtc5-dev";"
-> Error: no such table: instance_instance

<!-- gh-comment-id:42399023 --> @romu70 commented on GitHub (May 7, 2014): "delete from instance_instance where name="rtc5-dev";" -> Error: no such table: instance_instance
Author
Owner

@retspen commented on GitHub (May 7, 2014):

sqlite> .tables

<!-- gh-comment-id:42399892 --> @retspen commented on GitHub (May 7, 2014): sqlite> .tables
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

returns nothing

<!-- gh-comment-id:42400266 --> @romu70 commented on GitHub (May 7, 2014): returns nothing
Author
Owner

@retspen commented on GitHub (May 7, 2014):

$ sqllite3 /var/www/webvirtmgr/webvirtmgr.sqlite
sqilte> .databases

<!-- gh-comment-id:42401197 --> @retspen commented on GitHub (May 7, 2014): $ sqllite3 /var/www/webvirtmgr/webvirtmgr.sqlite sqilte> .databases
Author
Owner

@romu70 commented on GitHub (May 7, 2014):

Indeed the DB file is not webvirtmgr.sqlite but webvirtmgr.sqlite3. So was the issue. Fixed, thanks a lot ! Can be closed.

<!-- gh-comment-id:42401436 --> @romu70 commented on GitHub (May 7, 2014): Indeed the DB file is not webvirtmgr.sqlite but webvirtmgr.sqlite3. So was the issue. Fixed, thanks a lot ! Can be closed.
Author
Owner

@retspen commented on GitHub (May 7, 2014):

Oh, sorry!

<!-- gh-comment-id:42401680 --> @retspen commented on GitHub (May 7, 2014): Oh, sorry!
Author
Owner

@df-cryptostorm commented on GitHub (Jul 8, 2015):

Just an FYI, I also noticed this bug when I removed a VM instance from the web interface then tried recreating it with the same name.
Tried removing the VM image file, virsh destroying it, etc. but the sqlite3 fix above worked.

<!-- gh-comment-id:119498828 --> @df-cryptostorm commented on GitHub (Jul 8, 2015): Just an FYI, I also noticed this bug when I removed a VM instance from the web interface then tried recreating it with the same name. Tried removing the VM image file, `virsh destroy`ing it, etc. but the sqlite3 fix above worked.
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#235
No description provided.