free space need for /usr could be negative which is wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-release-upgrader (Ubuntu) |
Fix Released
|
High
|
Brian Murray | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
The checkFreeSpace function doesn't ensure that the space needed is a positive number thereby causing a situation where a partition, like /usr, doesn't have enough free space which then results in a failure during upgrade.
[Test Case]
It's not clear to me how to recreate this scenario, however I believe this falls into the "obviously safe" patch category. The specific change to checkFreeSpace, which is described as "this checks if we have enough free space", from DistUpgradeCache.py follows:
1200 # we are ensuring we have more than enough free space not less
1201 if size < 0:
1202 continue
This stops the needed space from being a negative number.
[Regression Potential]
Other than a typo in the change there won't be any.
[Original Description]
In my case I ran out of diskspace in /usr which required a temporary 4 GB of more data during upgrade. Things just start to fail, and I can tell you - then you are screwed. I find this unacceptable for a wide-spread official LTS upgrader.
ProblemType: BugDistroRelease: Ubuntu 18.04
Package: ubuntu-
ProcVersionSign
Uname: Linux 4.15.0-30-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.2
Architecture: amd64
CrashDB: ubuntu
CurrentDesktop: KDE
Date: Fri Aug 10 15:14:33 2018
InstallationDate: Installed on 2016-01-11 (941 days ago)
InstallationMedia: Kubuntu 14.04.3 LTS "Trusty Tahr" - Beta amd64 (20150805)
PackageArchitec
Symptom: release-upgrade
UpgradeStatus: Upgraded to bionic on 2018-08-09 (0 days ago)
mtime.conffile.
Related branches
tags: | added: xenial2bionic |
tags: | added: third-party-packages |
Changed in ubuntu-release-upgrader (Ubuntu): | |
status: | New → Incomplete |
description: | updated |
The free space checks for /usr seem a bit strange:
2018-08-09 19:17:15,431 DEBUG Free space on /: 1110441984 apt/archives mounted on /var DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd30>, '/usr': <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd68>, '/var/cache/ apt/archives' : <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6beb8>, '/boot': <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6be10>, '/var': <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6beb8>, '/home': <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bef0>, '/tmp': <DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bcf8>}' 4.15.0- 30-generic (new-install) added with 20705456 to boot space apt/archives' needs '3474732250' of '<DistUpgrade. DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6beb8>' (3585171456.000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd68>' (2819907584.000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd68>' (5922166784.000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6be10>' (301889536.000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bcf8>' (10716753920. 000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd30>' (1110441984.000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bcf8>' (10711511040. 000000) DistUpgradeCach e.MyCache. checkFreeSpace. <locals> .FreeSpace object at 0x7f9460e6bd68>' (5869737984.000000)
2018-08-09 19:17:15,431 DEBUG Free space on /usr: 2819907584
2018-08-09 19:17:15,432 DEBUG Free space on /var: 3585171456
2018-08-09 19:17:15,432 DEBUG Free space on /boot: 301889536
2018-08-09 19:17:15,432 DEBUG Dir /var/cache/
2018-08-09 19:17:15,432 DEBUG Free space on /tmp: 10716753920
2018-08-09 19:17:15,432 DEBUG Free space on /home: 2221584384
2018-08-09 19:17:15,432 DEBUG Dir /tmp mounted on /tmp
2018-08-09 19:17:15,432 DEBUG fs_free contains: '{'/': <DistUpgrade.
2018-08-09 19:17:16,690 DEBUG linux-image-
2018-08-09 19:17:19,295 DEBUG dir '/var/cache/
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '-3102259200' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '52428800' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/boot' needs '121070520.8' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/tmp' needs '5242880' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/' needs '10485760' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/tmp' needs '0.0' of '<DistUpgrade.
2018-08-09 19:17:19,296 DEBUG dir '/usr' needs '0.0' of '<DistUpgrade.
Could you provide some information regarding how your disk and partitions are setup? Thanks in advance!