qubes-issues
qubes-issues copied to clipboard
keyerror: sys-usb
Qubes OS release
4.1 latest
Brief summary
When shutting down or starting a VM that is the target of a persistent USB attachment (with qvm-usb attach --persistent), qubesd blurts a KeyError. Additionally, starting the VM after shutting it off is impossible. The only fix is to restart qubesd prior to starting the VM again.
I don't have a traceback with me at this point in time, sadly -- I am abroad.
Steps to reproduce
Persistently attach USB device to VM X.
Power off VM X.
Power on VM X.
See that VM X never starts.
Expected behavior
VM starts, device is "plugged" into it.
Actual behavior
VM never starts.
Sep 06 01:12:36 dom0 qubesd[2660757]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.Start' dest=b'assistant' arg=b'' len(untrusted_payload)=0
Sep 06 01:12:36 dom0 qubesd[2660757]: Traceback (most recent call last):
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubes/api/__init__.py", line 288, in respond
Sep 06 01:12:36 dom0 qubesd[2660757]: response = await self.mgmt.execute(
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubes/api/admin.py", line 883, in vm_start
Sep 06 01:12:36 dom0 qubesd[2660757]: await self.dest.start()
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubes/vm/qubesvm.py", line 1240, in start
Sep 06 01:12:36 dom0 qubesd[2660757]: await self.fire_event_async('domain-start',
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubes/events.py", line 233, in fire_event_async
Sep 06 01:12:36 dom0 qubesd[2660757]: effect = task.result()
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubesusbproxy/core3ext.py", line 397, in on_domain_start
Sep 06 01:12:36 dom0 qubesd[2660757]: yield from self.on_device_attach_usb(vm, '', device, options={})
Sep 06 01:12:36 dom0 qubesd[2660757]: File "/usr/lib/python3.8/site-packages/qubesusbproxy/core3ext.py", line 333, in on_device_attach_usb
Sep 06 01:12:36 dom0 qubesd[2660757]: self.devices_cache[device.backend_domain.name][device.ident] = vm
Sep 06 01:12:36 dom0 qubesd[2660757]: KeyError: 'sys-usb'
Sep 06 01:12:38 dom0 qubesd[2660757]: libvirt: Xen Light Driver error : Domain not found
So when is this getting fixed?
Continues to be an issue.
Dec 02 00:16:24 dom0 qubesd[2374]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.Start' dest=b'assistant' arg=b'' len(untrusted_payload)=0
Dec 02 00:16:24 dom0 qubesd[2374]: Traceback (most recent call last):
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubes/api/__init__.py", line 288, in respond
Dec 02 00:16:24 dom0 qubesd[2374]: response = await self.mgmt.execute(
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubes/api/admin.py", line 883, in vm_start
Dec 02 00:16:24 dom0 qubesd[2374]: await self.dest.start()
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubes/vm/qubesvm.py", line 1247, in start
Dec 02 00:16:24 dom0 qubesd[2374]: await self.fire_event_async('domain-start',
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubes/events.py", line 233, in fire_event_async
Dec 02 00:16:24 dom0 qubesd[2374]: effect = task.result()
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubesusbproxy/core3ext.py", line 393, in on_domain_start
Dec 02 00:16:24 dom0 qubesd[2374]: await self.on_device_attach_usb(vm, '', device, options={})
Dec 02 00:16:24 dom0 qubesd[2374]: File "/usr/lib/python3.8/site-packages/qubesusbproxy/core3ext.py", line 331, in on_device_attach_usb
Dec 02 00:16:24 dom0 qubesd[2374]: self.devices_cache[device.backend_domain.name][device.ident] = vm
Dec 02 00:16:24 dom0 qubesd[2374]: KeyError: 'sys-usb'
Dec 02 00:16:24 dom0 qvm-start[16375]: Got empty response from qubesd. See journalctl in dom0 for details.
Dec 02 00:16:24 dom0 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Dec 02 00:16:24 dom0 systemd[1]: [email protected]: Failed with result 'exit-code'.
Dec 02 00:16:24 dom0 systemd[1]: Failed to start Start Qubes VM assistant.
Dec 02 00:16:24 dom0 systemd[1]: Reached target Multi-User System.
Still present with the latest 4.1 updates.
https://github.com/QubesOS/qubes-app-linux-usb-proxy/blob/main/qubesusbproxy/core3ext.py#L331 is the location of the error.
This indicates that the devices_cache variable does not contain the backend host there. I am almost certain that the devices_cache should not be initialized as a dict, but rather should be initialized as a defaultdict(dict).
This bug makes the persistent attach feature useless.
Tests may not have caught this issue because a qubesd restart (which probably happens between tests) makes it go away (I guess it rebuilds the caches?).
@marmarek I've filed a fix PR!
Automated announcement from builder-github
The component app-linux-usb-proxy (including package qubes-usb-proxy-dom0-1.1.3-1.fc32) has been pushed to the r4.1 testing repository for dom0.
To test this update, please install it with the following command:
sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.1 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r4.1-current-testing
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bullseye-testing (or appropriate equivalent for your template version), then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
Automated announcement from builder-github
The package qubes-usb-proxy_1.1.3 has been pushed to the r4.1 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing buster-testing (or appropriate equivalent for your template version), then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.2 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r4.2-current-testing
Automated announcement from builder-github
The component app-linux-usb-proxy (including package app-linux-usb-proxy) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:
sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing
Automated announcement from builder-github
The component app-linux-usb-proxy (including package app-linux-usb-proxy) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:
sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing
Thank you, @marmarek !
Automated announcement from builder-github
The component app-linux-usb-proxy (including package qubes-usb-proxy-dom0-1.1.4-1.fc32) has been pushed to the r4.1 testing repository for dom0.
To test this update, please install it with the following command:
sudo qubes-dom0-update --enablerepo=qubes-dom0-current-testing
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.1 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r4.1-current-testing
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bullseye-testing (or appropriate equivalent for your template version), then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
Automated announcement from builder-github
The package qubes-usb-proxy_1.1.4 has been pushed to the r4.1 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing buster-testing (or appropriate equivalent for your template version), then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
Automated announcement from builder-github
The component app-linux-usb-proxy (including package app-linux-usb-proxy) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:
sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.2 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:
sudo yum update --enablerepo=qubes-vm-r4.2-current-testing
Automated announcement from builder-github
The component app-linux-usb-proxy (including package app-linux-usb-proxy) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:
sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing
Automated announcement from builder-github
The component app-linux-usb-proxy (including package qubes-usb-proxy-dom0-1.1.4-1.fc32) has been pushed to the r4.1 stable repository for dom0.
To install this update, please use the standard update command:
sudo qubes-dom0-update
Or update dom0 via Qubes Manager.
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.1 stable repository for the CentOS centos-stream8 template.
To install this update, please use the standard update command:
sudo yum update
Automated announcement from builder-github
The package qubes-usb-proxy_1.1.4+deb10u1 has been pushed to the r4.1 stable repository for the Debian template.
To install this update, please use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade
Automated announcement from builder-github
The package app-linux-usb-proxy has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:
sudo apt-get update && sudo apt-get dist-upgrade