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

Tag error during backup restore, possibly related to earlier paranoid mode restore #9256

Open
UndeadDevel opened this issue May 24, 2024 · 0 comments
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: core 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. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@UndeadDevel
Copy link

Qubes OS release

4.2.1

Brief summary

I caught this when using wyng-util-qubes (reported there), but during the investigation have found that this occurs with the standard Qubes backup tool, too. Below in "Actual behavior" you see a dom0 journalctl log fragment during backup restore of a single qube (gpg-vault) using the Qube Manager. AFAICT there is no negative side effect from this error and I wouldn't have found it if it didn't make the wyng code crash. Some time ago I may have used paranoid mode to restore this qube, which is perhaps where it got the created-by-disp-backup-restore tag, but I'm not sure; I definitely didn't give it that tag manually or with own tools; after this latest restore using the qubes tool, its tags are:

audiovm-dom0
created-by-disp-backup-restore
created-by-dom0
guivm-dom0
restored-from-backup-at-2023-09-03

So the putatively problematic tag was indeed restored together with other tags; the restored-from-backup-at-2023-09-03 tag is odd, as I've restored this qube several times since then.

Removing the created-by-disp-backup-restore tag, backing up the qube, deleting it and restoring it from the new backup again gets rid of the error.

Steps to reproduce

(Presumably) 1. Restore qube from backup using paranoid mode (or perhaps give it the created-by-disp-backup-restore manually)
2. backup that qube
3. delete it and restore from that new backup

Expected behavior

No errors

Actual behavior

13:13:34 dom0 qubesd[2790]: unhandled exception while calling src=b'dom0' meth=b'admin.vm.tag.Set' dest=b'gpg-vault' arg=b'created-by-disp-backup-restore' len(untrusted_payload)=0
13:13:34 dom0 qubesd[2790]: Traceback (most recent call last):
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/api/__init__.py", line 297, in respond
13:13:34 dom0 qubesd[2790]:     response = await self.mgmt.execute(
13:13:34 dom0 qubesd[2790]:                ^^^^^^^^^^^^^^^^^^^^^^^^
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/api/admin.py", line 561, in vm_tag_set
13:13:34 dom0 qubesd[2790]:     self.dest.tags.add(self.arg)
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/vm/__init__.py", line 158, in add
13:13:34 dom0 qubesd[2790]:     self.vm.fire_event('domain-tag-add:' + elem, tag=elem)
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 195, in fire_event
13:13:34 dom0 qubesd[2790]:     sync_effects, async_effects = self._fire_event(event, kwargs,
13:13:34 dom0 qubesd[2790]:                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/events.py", line 164, in _fire_event
13:13:34 dom0 qubesd[2790]:     effect = func(self, event, **kwargs)
13:13:34 dom0 qubesd[2790]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/ext/gui.py", line 149, in set_guivm_on_created_by
13:13:34 dom0 qubesd[2790]:     created_by = vm.app.domains[tag.partition('created-by-')[2]]
13:13:34 dom0 qubesd[2790]:                  ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13:13:34 dom0 qubesd[2790]:   File "/usr/lib/python3.11/site-packages/qubes/app.py", line 512, in __getitem__
13:13:34 dom0 qubesd[2790]:     raise KeyError(key)
13:13:34 dom0 qubesd[2790]: KeyError: 'disp-backup-restore'
13:13:34 dom0 runuser[46039]: pam_unix(runuser:session): session closed for user my_dom0_user_name
13:13:34 dom0 kernel: kauditd_printk_skb: 2 callbacks suppressed
@UndeadDevel UndeadDevel added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. labels May 24, 2024
@andrewdavidwong andrewdavidwong added C: core 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 May 24, 2024
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: core 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. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests

2 participants