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

Disk space widget crashes / fails to start, if it can't get information about one of the pools #8187

Closed
marmarek opened this issue May 8, 2023 · 12 comments · Fixed by QubesOS/qubes-desktop-linux-manager#154
Assignees
Labels
affects-4.2 This issue affects Qubes OS 4.2. C: manager/widget C: storage diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-host-stable r4.2-vm-bookworm-stable r4.2-vm-bullseye-stable r4.2-vm-centos-stream8-stable r4.2-vm-fc36-stable r4.2-vm-fc37-stable r4.2-vm-fc38-stable
Milestone

Comments

@marmarek
Copy link
Member

marmarek commented May 8, 2023

How to file a helpful issue

Qubes OS release

R4.2 (could affect R4.1 too)

Brief summary

Disk space widget crashes / fails to start, if it can't get information about one of the pools

Steps to reproduce

  1. Have a storage pool on removable disk (or, in a loop-mounted file like it was in my case)
  2. Disconnect that disk
  3. Try starting gui-disk-space

In this case, if there was any qube in that pool it won't start of course. But for the widget to crash, there don't need to be any qube in that storage pool at all, it can be an empty pool.

Expected behavior

It starts successfully, but either list the pool with "unknown" free space, or not list it at all.

Actual behavior

May 07 22:03:13 dom0 widget-wrapper[142232]: Traceback (most recent call last):
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/bin/qui-disk-space", line 33, in <module>
May 07 22:03:13 dom0 widget-wrapper[142232]:     sys.exit(load_entry_point('qui==0.1', 'gui_scripts', 'qui-disk-space')())
May 07 22:03:13 dom0 widget-wrapper[142232]:              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qui/tray/disk_space.py", line 472, in main
May 07 22:03:13 dom0 widget-wrapper[142232]:     app = DiskSpace()
May 07 22:03:13 dom0 widget-wrapper[142232]:           ^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qui/tray/disk_space.py", line 321, in __init__
May 07 22:03:13 dom0 widget-wrapper[142232]:     self.refresh_icon()
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qui/tray/disk_space.py", line 328, in refresh_icon
May 07 22:03:13 dom0 widget-wrapper[142232]:     pool_data = PoolUsageData(self.qubes_app)
May 07 22:03:13 dom0 widget-wrapper[142232]:                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qui/tray/disk_space.py", line 155, in __init__
May 07 22:03:13 dom0 widget-wrapper[142232]:     self.__populate_pools()
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qui/tray/disk_space.py", line 164, in __populate_pools
May 07 22:03:13 dom0 widget-wrapper[142232]:     if not getattr(pool, 'size', None) or \
May 07 22:03:13 dom0 widget-wrapper[142232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qubesadmin/storage.py", line 375, in size
May 07 22:03:13 dom0 widget-wrapper[142232]:     return int(self.usage_details['data_size'])
May 07 22:03:13 dom0 widget-wrapper[142232]:                ^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qubesadmin/storage.py", line 341, in usage_details
May 07 22:03:13 dom0 widget-wrapper[142232]:     pool_usage_data = self.app.qubesd_call(
May 07 22:03:13 dom0 widget-wrapper[142232]:                       ^^^^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qubesadmin/app.py", line 765, in qubesd_call
May 07 22:03:13 dom0 widget-wrapper[142232]:     return self._parse_qubesd_response(return_data)
May 07 22:03:13 dom0 widget-wrapper[142232]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 07 22:03:13 dom0 widget-wrapper[142232]:   File "/usr/lib/python3.11/site-packages/qubesadmin/base.py", line 111, in _parse_qubesd_response
May 07 22:03:13 dom0 widget-wrapper[142232]:     raise exc_class(format_string, *args)
May 07 22:03:13 dom0 widget-wrapper[142232]: qubesadmin.exc.StoragePoolException: cannot open 'testpool': no such pool
@marmarek marmarek added T: bug C: manager/widget P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. labels May 8, 2023
@marmarek marmarek added this to the Release 4.2 milestone May 8, 2023
@andrewdavidwong andrewdavidwong added needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. C: storage labels May 8, 2023
rustybird added a commit to rustybird/qubes-core-admin that referenced this issue May 8, 2023
Make only one statvfs() call to get consistent information for size and
usage.

Also handle an absent pool correctly by returning an empty dict for
usage_details() and None for usage() and size(), instead of raising
FileNotFoundError.

QubesOS/qubes-issues#8187
QubesOS/qubes-issues#8188
rustybird added a commit to rustybird/qubes-core-admin that referenced this issue May 8, 2023
Make only one statvfs() call to get consistent size and usage
information.

Also handle an absent pool correctly by returning an empty dict for
usage_details() and None for size() and usage() instead of raising
FileNotFoundError.

QubesOS/qubes-issues#8187
QubesOS/qubes-issues#8188
marmarta added a commit to marmarta/qubes-desktop-linux-manager that referenced this issue May 12, 2023
Wrap pool access in intermediary object to catch all
possible exceptions. Cleanup for more readability.

fixes QubesOS/qubes-issues#8187
marmarta added a commit to marmarta/qubes-desktop-linux-manager that referenced this issue May 23, 2023
Wrap pool access in intermediary object to catch all
possible exceptions. Cleanup for more readability.

fixes QubesOS/qubes-issues#8187
marmarta added a commit to marmarta/qubes-desktop-linux-manager that referenced this issue May 25, 2023
Wrap pool access in intermediary object to catch all
possible exceptions. Cleanup for more readability.

fixes QubesOS/qubes-issues#8187
marmarta added a commit to marmarta/qubes-desktop-linux-manager that referenced this issue May 26, 2023
Wrap pool access in intermediary object to catch all
possible exceptions. Cleanup for more readability.

fixes QubesOS/qubes-issues#8187
@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bullseye-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 testing repository for the Debian template.
To test this update, first enable the testing repository in /etc/apt/sources.list.d/qubes-*.list by uncommenting the line containing bookworm-testing (or appropriate equivalent for your template version), then use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 testing repository for the CentOS centos-stream8 template.
To test this update, please install it with the following command:

sudo yum update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). pr submitted A pull request has been submitted for this issue. and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels May 29, 2023
@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 testing repository for the Fedora template.
To test this update, please install it with the following command:

sudo dnf update --enablerepo=qubes-vm-r4.2-current-testing

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 stable repository for the CentOS centos-stream8 template.
To install this update, please use the standard update command:

sudo yum update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The package desktop-linux-manager has been pushed to the r4.2 stable repository for the Debian template.
To install this update, please use the standard update command:

sudo apt-get update && sudo apt-get dist-upgrade

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

@qubesos-bot
Copy link

Automated announcement from builder-github

The component desktop-linux-manager (including package desktop-linux-manager) has been pushed to the r4.2 stable repository for the Fedora template.
To install this update, please use the standard update command:

sudo dnf update

Changes included in this update

marmarek pushed a commit to QubesOS/qubes-core-admin that referenced this issue Jul 4, 2023
Make only one statvfs() call to get consistent size and usage
information.

Also handle an absent pool correctly by returning an empty dict for
usage_details() and None for size() and usage() instead of raising
FileNotFoundError.

QubesOS/qubes-issues#8187
QubesOS/qubes-issues#8188

(cherry picked from commit 2deb827)
@andrewdavidwong andrewdavidwong added the affects-4.2 This issue affects Qubes OS 4.2. label Aug 8, 2023
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 C: storage diagnosed Technical diagnosis has been performed (see issue comments). P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. pr submitted A pull request has been submitted for this issue. r4.2-host-stable r4.2-vm-bookworm-stable r4.2-vm-bullseye-stable r4.2-vm-centos-stream8-stable r4.2-vm-fc36-stable r4.2-vm-fc37-stable r4.2-vm-fc38-stable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants