Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qubes-qube-manager crashes due to python TypeError when changing netvm property #9725

Open
Justasic opened this issue Jan 22, 2025 · 0 comments
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: manager/widget needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.

Comments

@Justasic
Copy link

Qubes OS release

Qubes OS 4.2

Brief summary

Hello!

I recently performed an update and tried to set the netvm of an already running disposable qube and the qube manager would crash with the following message:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/qubesadmin/base.py", line 376, in __setattr__
    self.qubesd_call(
  File "/usr/lib/python3.11/site-packages/qubesadmin/base.py", line 76, in qubesd_call
    return self.app.qubesd_call(dest, method, arg, payload,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qubesadmin/app.py", line 789, in qubesd_call
    return self._parse_qubesd_response(return_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qubesadmin/base.py", line 89, in _parse_qubesd_response
    raise qubesadmin.exc.QubesDaemonAccessError(
qubesadmin.exc.QubesDaemonAccessError: Got empty response from qubesd. See journalctl in dom0 for details.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/qubesmanager/qube_manager.py", line 929, in change_network
    info.vm.netvm = netvm_name
    ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/qubesadmin/base.py", line 383, in __setattr__
    raise qubesadmin.exc.QubesPropertyAccessError(key)
qubesadmin.exc.QubesPropertyAccessError: Failed to access 'netvm' property
Aborted (core dumped)

Reading the journalctl output of qubesd, I get the following exception:

Jan 21 17:04:44 dom0 qubesd[12640]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.property.Set' dest=b'disp6189' arg=b'netvm' len(untrusted_payload)=16
Jan 21 17:04:44 dom0 qubesd[12640]: Traceback (most recent call last):
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/api/__init__.py", line 297, in respond
Jan 21 17:04:44 dom0 qubesd[12640]:     response = await self.mgmt.execute(
Jan 21 17:04:44 dom0 qubesd[12640]:                ^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/api/admin.py", line 267, in vm_property_set
Jan 21 17:04:44 dom0 qubesd[12640]:     return self._property_set(self.dest,
Jan 21 17:04:44 dom0 qubesd[12640]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/api/admin.py", line 287, in _property_set
Jan 21 17:04:44 dom0 qubesd[12640]:     setattr(dest, self.arg, newvalue)
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/vm/__init__.py", line 502, in __set__
Jan 21 17:04:44 dom0 qubesd[12640]:     super().__set__(instance, vm)
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/__init__.py", line 273, in __set__
Jan 21 17:04:44 dom0 qubesd[12640]:     instance.fire_event('property-set:' + self.__name__,
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 195, in fire_event
Jan 21 17:04:44 dom0 qubesd[12640]:     sync_effects, async_effects = self._fire_event(event, kwargs,
Jan 21 17:04:44 dom0 qubesd[12640]:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 164, in _fire_event
Jan 21 17:04:44 dom0 qubesd[12640]:     effect = func(self, event, **kwargs)
Jan 21 17:04:44 dom0 qubesd[12640]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/vm/mix/net.py", line 489, in on_property_set_netvm
Jan 21 17:04:44 dom0 qubesd[12640]:     newvalue.fire_event('net-domain-connect', vm=self)
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 195, in fire_event
Jan 21 17:04:44 dom0 qubesd[12640]:     sync_effects, async_effects = self._fire_event(event, kwargs,
Jan 21 17:04:44 dom0 qubesd[12640]:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 164, in _fire_event
Jan 21 17:04:44 dom0 qubesd[12640]:     effect = func(self, event, **kwargs)
Jan 21 17:04:44 dom0 qubesd[12640]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jan 21 17:04:44 dom0 qubesd[12640]: TypeError: QubesNetworkServerExtension.on_net_domain_connect() got multiple values for argument 'vm'

When running qvm-prefs <disposable vm> netvm <desired netvm>, I get the following output:

qvm-prefs: error: Failed to access 'netvm' property

Steps to reproduce

  1. Open Qube Manager
  2. Right click vm -> Network -> select desired net qube
  3. Click "Yes" to confirmation prompt.

Alternatively:

  1. Open dom0 terminal
  2. Run qvm-prefs <disposable vm> netvm sys-net

Expected behavior

Netvm changes without the qube manager crashing or the qvm-prefs giving a failure message.

Actual behavior

Qube Manager crashes, qvm-prefs displays a failure message, netvm does not change.

Additional information

I included the details of qube-manager crashing as I'm not sure it giving a coredump is expected behavior (as opposed to displaying an error to the user). I would debug this problem further as I am familiar with python but this appears related to an event within the code for qubesd and I wasn't able to follow it's execution path as I am unfamiliar with the codebase.

@Justasic Justasic added the P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. label Jan 22, 2025
@andrewdavidwong andrewdavidwong added C: manager/widget needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. affects-4.2 This issue affects Qubes OS 4.2. labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: manager/widget needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.
Projects
None yet
Development

No branches or pull requests

2 participants