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

qubes-dom0-update doesn't handle low disk space conditions well #5052

Closed
strugee opened this issue May 28, 2019 · 8 comments
Closed

qubes-dom0-update doesn't handle low disk space conditions well #5052

strugee opened this issue May 28, 2019 · 8 comments
Labels
C: core eol-4.0 Closed since Qubes 4.0 has been EOL for over one year 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

@strugee
Copy link
Contributor

strugee commented May 28, 2019

Qubes OS version

R4.0

Affected component(s) or functionality

qubes-dom0-update

Brief summary

When the system has very low disk space, qubes-dom0-update fails with an error message that just says "failed with exit code 1" instead of something more helpful (like "No space left on device").

To Reproduce

  1. Make sure your disk utilization is above the percentage reserved by ext4. You may change this value on your filesystem using sudo tune2fs -m <percentage> /dev/mapper/qubes_dom0-root, where <percentage> is the % of your filesystem that will be reserved for the superuser only; df -h / should report 0 in the "available" column
  2. Run qubes-dom0-update with updates pending

Expected behavior

Either the update succeeds or the update fails and tells me that I'm out of disk space.

Actual behavior

The update fails with this output:

[alex@dom0 ~]$ sudo qubes-dom0-update
Using sys-firewall-disp as UpdateVM to download updates for Dom0; this may take some time...
--> Running transaction check
---> Package kernel-latest.x86_64 1000:5.1.2-1.pvops.qubes will be installed
---> Package qubes-gpg-split-dom0.x86_64 0:2.0.38-1.fc25 will be installed
---> Package qubes-manager.noarch 0:4.0.34-1.fc25 will be installed
---> Package qubes-mgmt-salt-dom0-qvm.noarch 0:4.0.8-1.fc25 will be installed
---> Package qubes-usb-proxy-dom0.noarch 0:1.0.21-1.fc25 will be installed
--> Finished Dependency Resolution
/var/lib/qubes/dom0-updates/packages/kernel-latest-5.1.2-1.pvops.qubes.x86_64.rpm already exists and appears to be complete
/var/lib/qubes/dom0-updates/packages/qubes-gpg-split-dom0-2.0.38-1.fc25.x86_64.rpm already exists and appears to be complete
/var/lib/qubes/dom0-updates/packages/qubes-manager-4.0.34-1.fc25.noarch.rpm already exists and appears to be complete
/var/lib/qubes/dom0-updates/packages/qubes-mgmt-salt-dom0-qvm-4.0.8-1.fc25.noarch.rpm already exists and appears to be complete
/var/lib/qubes/dom0-updates/packages/qubes-usb-proxy-dom0-1.0.21-1.fc25.noarch.rpm already exists and appears to be complete
find: '/var/lib/qubes/dom0-updates/var/cache': No such file or directory
EOF
'/usr/lib/qubes/qrexec-client-vm dom0 qubes.ReceiveUpdates /usr/lib/qubes/qfile-agent /var/lib/qubes/dom0-updates/packages/*.rpm' failed with exit code 1!

Additional context

ext4 reserves a certain percentage of disk space for the superuser; see this Stack Exchange question for an explanation of why. This can come out to tens of gigabytes on large partitions. For example, in my case my Qubes partition is 590GB which comes out to ~29.5 GB of disk space reserved for the superuser only.

The reason I said the expected behavior might include the update succeeding is because in this case, there actually is plenty of free space, but it seems that some process invoked by qubes-dom0-update is running as a non-superuser. If it ran as the superuser, it would have permission to write to the reserved space in the filesystem. I do think it's probably a better idea to signal an ENOSPC error, though; that route seems like it's playing with fire.

Relevant documentation you've consulted

None

Related, non-duplicate issues

https://github.com/QubesOS/qubes-issues/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+qubes-dom0-update+free+space

@strugee strugee 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 28, 2019
@andrewdavidwong andrewdavidwong added this to the Release 4.0 updates milestone May 28, 2019
@andrewdavidwong
Copy link
Member

Somewhat related: #3299

@strugee

This comment has been minimized.

@andrewdavidwong

This comment has been minimized.

@strugee

This comment has been minimized.

@andrewdavidwong

This comment has been minimized.

@strugee

This comment has been minimized.

@andrewdavidwong

This comment has been minimized.

strugee added a commit to strugee/qubes-core-agent-linux that referenced this issue Apr 8, 2020
This feels ugly because it doesn't fix the underlying bug, but
it's incredibly hard to trace down the root cause in this
situation and it causes updates to fail which is pretty
critical. So this is probably better than nothing.

Ref QubesOS/qubes-issues#5052
@andrewdavidwong andrewdavidwong added the eol-4.0 Closed since Qubes 4.0 has been EOL for over one year 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: core eol-4.0 Closed since Qubes 4.0 has been EOL for over one year 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