QubesOS / qubes-issues

The Qubes OS Project issue tracker
https://www.qubes-os.org/doc/issue-tracking/
543 stars 48 forks source link

Using GUI-way of `qvm-open-in-dvm`, `qvm-open-in-vm` with target specified in RPC policy as well as `qvm-copy` often produces multiple calls #8808

Open UndeadDevel opened 11 months ago

UndeadDevel commented 11 months ago

Qubes OS release

4.2 (Also occurred on 4.1)

Brief summary

I've seen this also reported on the forum and I've been trying to find a way to reliably reproduce it without success so far, but I've been able to narrow it down: when opening files with qvm-open-in-dvm or qvm-open-in-vm via GUI means (context menu of nautilus or thunar or a custom .desktop file with that command bound to the relevant mime types) and a policy that specifies a target named DVM, e.g.

qubes.OpenInVM      *   @anyvm      @dispvm     ask default_target=offline
qubes.OpenInVM      *   @anyvm      @anyvm      ask default_target=offline

then in ~25% of cases on average (not literally every fourth time) there will be multiple additional (usually 1-4) open actions triggered, with the corresponding target qube dialogues opening after one another (after confirming on the first, which opens the file in the DVM, the second opens and so on). If confirming on all of them then the file will be opened that many times in the DVM. Once the issue started occurring it will occur more often until the target DVM is restarted.

This issue does not seem to occur when using qvm-open-in-dvm or qvm-open-in-vm directly from the terminal with the above policy or when using the standard RPC policy (new unnamed DVM spawned for every file or no pre-selected target qube in the dialog).

Steps to reproduce

  1. Set up 30-user policy file with:
    qubes.OpenInVM      *   @anyvm      @dispvm     ask default_target=offline
  2. Create named offline DVM
  3. Use either nautilus or thunar context menu actions "View/Edit in disposable qube" or create a .desktop file with qvm-open-in-dvm as Exec value and open a file in that DVM this way
  4. Repeat step 3 until issue occurs (shouldn't take long) (5. It's possible that it occurs more often when keyboard shortcuts are pressed while the target qube dialog is open, but that's anecdotal)

Expected behavior

One file opening GUI "request" triggers only one action.

Actual behavior

Sometimes triggers multiple actions.

UndeadDevel commented 11 months ago

Also happens sometimes when using GUI-way of qvm-copy via Thunar context menu.

UndeadDevel commented 10 months ago

I'm not sure this is related, but sometimes when using qvm-copy from the command line I get multiple lines of output and multiple new "terminal lines", like:

user@personal:~$ qvm-copy folder
sent 0/12342 KB

sent 12342/12342 KB
user@personal:~$ 
user@personal:~$ 
user@personal:~$

while other times it just gives one "sent ..." line and then the next line for the terminal (user@personal:~$), so maybe this is an indication that this issue doesn't just occur with the GUI methods and further evidence that it may be connected to #8847.