Skip to content

Global config fails to start if there is auto-attach assignment but the device is not plugged in #10080

@marmarek

Description

@marmarek

Qubes OS release

Qubes OS 4.3

Brief summary

As title says

Steps to reproduce

  1. Create auto-attach assignment based on existing device
  2. Unplug the device
  3. Try to start global config tool

Expected behavior

Starts normally, possibly listing less details about the device if some are not available. But it should still be possible to:

  • remove the assignment
  • save without changes (should not break that assignment)

Actual behavior

Traceback (most recent call last):
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/global_config.py", line 300, in do_activate
    self.perform_setup()
    ~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/global_config.py", line 422, in perform_setup
    self.handlers["attachments"] = DevAttachmentHandler(self.qapp, self.builder)
                                   ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/device_attachments.py", line 987, in __init__
    self.auto_attach_handler = AttachmentHandler(
                               ~~~~~~~~~~~~~~~~~^
        builder=gtk_builder,
        ^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        edit_dialog_class=AutoDeviceDialog,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/device_attachments.py", line 921, in __init__
    super().__init__(
    ~~~~~~~~~~~~~~~~^
        prefix=prefix,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        edit_dialog_class=edit_dialog_class,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/device_widgets.py", line 260, in __init__
    self.load_current_state()
    ~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/device_attachments.py", line 963, in load_current_state
    aw = AssignmentWrapper.new_from_existing(assignment_list)
  File "/usr/lib/python3.13/site-packages/qubes_config/global_config/device_attachments.py", line 671, in new_from_existing
    device = assignments[0].device
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/qubesadmin/device_protocol.py", line 1370, in device
    raise ProtocolError("No devices matches to assignment")
qubesadmin.device_protocol.ProtocolError: No devices matches to assignment

Additional information

No response

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions