Univention Bugzilla – Bug 50580
uvmm/query: IndexError: tuple index out of range if virshDomainState is VIR_DOMAIN_PMSUSPENDED
Last modified: 2020-01-22 14:47:55 CET
Created attachment 10242 [details] Screenshot I somehow got into a state where I get a pop up (see attachment) which is always poping up in a loop every 5 seconds: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/univention/uvmm/unix.py", line 148, in handle_command res = cmd(self, command) File "/usr/lib/python2.7/dist-packages/univention/uvmm/commands.py", line 366, in DOMAIN_LIST domains = node.domain_list(request.uri, request.pattern) File "/usr/lib/python2.7/dist-packages/univention/uvmm/node.py", line 1928, in domain_list domains[node.pd.uri] = node.domain_list(pattern) File "/usr/lib/python2.7/dist-packages/univention/uvmm/node.py", line 1258, in domain_list 'state': STATES[pd.state], IndexError: tuple index out of range curl 'https://laiva.knut.univention.de/univention/command/uvmm/query' -H 'Pragma: no-cache' -H 'Cookie: UMCSessionId=XXX' -H 'Origin: https://laiva.knut.univention.de' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: de-DE' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' -H 'Cache-Control: no-cache' -H 'X-Requested-With: XMLHttpRequest' -H 'X-XSRF-Protection: XXX' -H 'Connection: keep-alive' -H 'Referer: https://laiva.knut.univention.de/univention/management/' --data-binary '{"options":{"type":"domain","domainPattern":"","nodePattern":""}}' --compressed --insecure
pd.state is 7
The state "VIR_DOMAIN_PMSUSPENDED" is missing: https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainState
We should add the 2 missing domain states: https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainState VIR_DOMAIN_PMSUSPENDED = 7 (0x7) the domain is suspended by guest power management VIR_DOMAIN_LAST = 8 (0x8) NB: this enum value will increase over time as new events are added to the libvirt API. It reflects the last state supported by this version of the libvirt API.
(In reply to Florian Best from comment #4) > We should add the 2 missing domain states: > https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainState > > VIR_DOMAIN_PMSUSPENDED = 7 (0x7) > the domain is suspended by guest power management > VIR_DOMAIN_LAST = 8 (0x8) Do NOT add *_LAST!
(In reply to Philipp Hahn from comment #5) > Do NOT add *_LAST! Ok, why not?
(In reply to Florian Best from comment #6) > (In reply to Philipp Hahn from comment #5) > > Do NOT add *_LAST! > Ok, why not? Probably as it is only a marker for the last possible value.
I used "Win10_1909_English_x64.iso" and installed the WindowsGuestDrivers: https://www.linux-kvm.org/page/WindowsGuestDrivers Drive and network are set to use virtio, graphics are set to qxl and cpu capabilities are set to be passed through. VMs can be found with: "virsh list --all | grep pmsuspended" and woken up with "virsh dompmwakeup $VM" or just destroyed.
*** This bug has been marked as a duplicate of bug 46853 ***
*** Bug 46853 has been marked as a duplicate of this bug. ***
(In reply to Florian Best from comment #10) > *** Bug 46853 has been marked as a duplicate of this bug. *** (In reply to Jannik Ahlers from comment #0) > Created attachment 9508 [details] > uvmm > > after using the suspend function of a ubuntu 16.04 vm all query requests of > uvmm fail. This results in the error message in the screenshot. As the > request gets sent every few seconds, this bug makes uvmm pretty much > unusable. Restarting uvmm daemon or umc server doesn't help either, but > rebooting fixes it.
This bug (or a clone of it) should also fix that those exceptions are passed as str(exc) to the frontend instead of displaying a traceback-feedback dialogue.
[4.4-3] b457de00d7 Bug #50580 UVMM: Add STATE VIR_DOMAIN_PMSUSPENDED .../univention-virtual-machine-manager-daemon/debian/changelog | 6 ++++++ .../src/univention/uvmm/node.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) [4.4-3] 8fec82f85e Bug #50580 UVMM: Add state VIR_DOMAIN_PMSUSPENDED to UMC .../src/univention/uvmm/node.py | 3 +++ .../univention-virtual-machine-manager-daemon/umc/js/uvmm.js | 2 +- .../univention-virtual-machine-manager-daemon/umc/js/uvmm/types.js | 3 ++- .../umc/python/uvmm/domains.py | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) Package: univention-virtual-machine-manager-daemon Version: 8.0.1-15A~4.4.0.202001151425 Branch: ucs_4.4-0 Scope: errata4.4-3 [4.4-3] c01ec716f6 Bug #50580: univention-virtual-machine-manager-daemon 8.0.1-15A~4.4.0.202001151334 .../staging/univention-virtual-machine-manager-daemon.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) [4.4-3] 77edc25414 Bug #50580: univention-virtual-machine-manager-daemon 8.0.1-15A~4.4.0.202001151425 doc/errata/staging/univention-virtual-machine-manager-daemon.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) QA: 1. Install UCS-4 VM 2. Install Qemu guest agent <https://hutten.knut.univention.de/mediawiki/index.php/Philipp_memo/Virtualisierung#Guest_agent> 2.1 virsh edit $VM <domain...> <devices> ... <channel type='unix'> <source mode='bind'/> <target type='virtio' name='org.qemu.guest_agent.0'/> </channel> ... </devices> </domain> 2.2 apt install qemu-guest-agent 2.3 shutdown and restart VM 3. Suspend VM: virsh dompmsuspend --domain $VM --target mem 4. Verify state: 4.1 virsh list --all # State=pmsuspended 4.2 UVMM -> `tuple index out of range` 5. Upgrade UVMM: apt -t apt install univention-virtual-machine-manager-daemon python-univention-virtual-machine-manager 6. Repeat verify: - UVMM no longer crashes - uvmm domains "qemu://$(hostname f)/system" # 'state': 'PMSUSPENDED'
I could replicate the problem by following the steps described above, after updating the problem didn't occur anymore. Code review: OK Yaml: OK Verified
<http://errata.software-univention.de/ucs/4.4/427.html>