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

Attaching device through devices widget does nothing, while qvm-usb works #4999

Closed
marmarek opened this issue Apr 25, 2019 · 9 comments
Closed
Assignees
Labels
C: manager/widget eol-4.0 Closed because Qubes 4.0 has reached end-of-life (EOL) P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.

Comments

@marmarek
Copy link
Member

I'm experiencing a strange issue during testing, at times attaching a device (yubikey) does nothing at all. The device does not get attached. Although the device does show in the list it simply does not get attached to the vm. The only solution is to kill qui-devices which then restarts itself and then its possible to attach again, or to attach the device via command line (qvm-usb)

Originally posted by @yubiguel in #4849 (comment)

@marmarek
Copy link
Member Author

I've seen similar thing few days ago too.
Strangely, I didn't seen any message in logs (journalctl, .xsession-errors) - simply nothing have happened.

@marmarek marmarek added this to the Release 4.0 updates milestone Apr 25, 2019
@andrewdavidwong andrewdavidwong added the P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. label Apr 26, 2019
@marmarta
Copy link
Member

marmarta commented May 3, 2019

what do you mean by "does show in the list it simply does not get attached to the vm"? does it:

  • appear in the list as not attached (what happens if you try to attach it?)
  • appear in the list as attached (what happens if you try to detach it?)

@noonker
Copy link

noonker commented May 6, 2019

I have the same issue. It appears that qui-devices isn't updating the state of the dropdown.

  1. From the qui-devices tray icon attach a device to a domain
  2. A notification will let you know that the device has been attached (and a lsusb will confirm that it has)
  3. The qui-devices dropdown will not update it's state (still shows as not attached)
  4. Run killall qui-devices and it will restart showing the correct state of a usb devices.

Starting qui-devices from a terminal in dom0 and repeating the above steps yields this error:
(qui-devices:10849): GLib-GIO-CRITICAL **: g_application_send_notification: assertion '!g_application_get_is_remote (application)' failed

@yubiguel
Copy link

yubiguel commented May 9, 2019

what do you mean by "does show in the list it simply does not get attached to the vm"? does it:

  • appear in the list as not attached (what happens if you try to attach it?)
  • appear in the list as attached (what happens if you try to detach it?)

Sorry for the late reply. What I mean is that when you click on the tray icon you will see the usb device listed there as not attached (appears in the list) but when you try to attach the device to a vm it does not get attached. (nothing happens). By killing qui-devices in dom0 you can now re-attach. This is happening to me constantly.

@holiman
Copy link

holiman commented Jun 11, 2019

What I mean is that when you click on the tray icon you will see the usb device listed there as not attached (appears in the list) but when you try to attach the device to a vm it does not get attached. (nothing happens)

I can confirm the exact same thing happening. I recently upgraded all templates to Fedora-29. After killall qui-devices I can attach and something actually happens (I get a notification that it was attached)

@marmarek
Copy link
Member Author

Found it! The exception and some debug prints:

Jun 21 19:09:50 dom0 widget-wrapper[14518]: toggle dev <qui.tray.devices.Device object at 0x77abdb340c50> vm disp1323 attached False
Jun 21 19:09:50 dom0 widget-wrapper[14518]: attach_item called for <qui.tray.devices.VM object at 0x77abdb329cf8>
Jun 21 19:09:50 dom0 widget-wrapper[14518]: detach_item called
Jun 21 19:09:50 dom0 widget-wrapper[14518]: detach_item success
Jun 21 19:09:50 dom0 widget-wrapper[14518]: detach_successful = True
Jun 21 19:09:50 dom0 widget-wrapper[14518]: attach_item exception: TypeError('A logger name must be a string',)
Jun 21 19:09:50 dom0 widget-wrapper[14518]: Traceback (most recent call last):
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib/python3.5/site-packages/qui/tray/devices.py", line 77, in attach_item
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     vm_to_attach = self.qapp.domains[menu_item.vm]
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib/python3.5/site-packages/qubesadmin/app.py", line 90, in __getitem__
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     return self.get_blind(item)
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib/python3.5/site-packages/qubesadmin/app.py", line 105, in get_blind
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     self._vm_objects[item] = cls(self.app, item, klass=klass)
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib/python3.5/site-packages/qubesadmin/vm/__init__.py", line 59, in __init__
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     self.log = logging.getLogger(name)
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib64/python3.5/logging/__init__.py", line 1787, in getLogger
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     return Logger.manager.getLogger(name)
Jun 21 19:09:50 dom0 widget-wrapper[14518]:   File "/usr/lib64/python3.5/logging/__init__.py", line 1151, in getLogger
Jun 21 19:09:50 dom0 widget-wrapper[14518]:     raise TypeError('A logger name must be a string')
Jun 21 19:09:50 dom0 widget-wrapper[14518]: TypeError: A logger name must be a string

The key thing: self.qapp.domains[menu_item.vm], with menu_item.vm being qui.tray.devices.VM object instead of string (VM name).

@marmarta
Copy link
Member

marmarta commented Aug 8, 2019

Looks like this is fixed in testing (judging from comments here and there) - I'm closing this issue, if it reemerges please reopen.

@4NobleTruths
Copy link

This is definitely not fixed with SD cards. I'm not sure I could even list all the possible permutations of failed in this.
Some of them are:

  • Showing the device unattached to a VM, but then giving a black popup error that it's already attached, when the VM clearly shows it's not.
  • Showing the same SD card being attached to two different VMs at the same time, when it's attached to none in reality.
  • Showing the SD card in one VM as being attached to another VM, when sys-usb has attached it to none in reality.

And killing qui-devices doesn't fix it either. Neither does restarting one or more VMs involved and sys-usb, plugging and replugging... It just works sometimes, almost as if something eventually times out.

This is with sys-usb based on Fedora 32 XFCE and Debian 10.

@andrewdavidwong andrewdavidwong added the needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. label Oct 11, 2020
@andrewdavidwong andrewdavidwong added the eol-4.0 Closed because Qubes 4.0 has reached end-of-life (EOL) label Aug 5, 2023
@github-actions
Copy link

github-actions bot commented Aug 5, 2023

This issue is being closed because:

If anyone believes that this issue should be reopened and reassigned to an active milestone, please leave a brief comment.
(For example, if a bug still affects Qubes OS 4.1, then the comment "Affects 4.1" will suffice.)

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 5, 2023
@andrewdavidwong andrewdavidwong removed the needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. label Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: manager/widget eol-4.0 Closed because Qubes 4.0 has reached end-of-life (EOL) P: default Priority: default. Default priority for new issues, to be replaced given sufficient information.
Projects
None yet
Development

No branches or pull requests

7 participants