do-release-upgrade from Trusty to Xenial breaks cloud-init init-local on reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Fix Released
|
Undecided
|
Unassigned | ||
Hirsute |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
The 'Paths' class has a 'run_dir' attribute that was introduced since the release of Trusty. Because of this, performing a `do-release-
The change here should fix that failure.
[Test Plan]
- Launch a Trusty instance
- Perform a `do-release-
- Reboot
On un-patched versions, `cloud-init status` will show error, and there will be a traceback in /var/log/
[Where problems could occur]
Any problem here would mean we're continuing to unpickle data incorrectly, thus we'd see similar behavior to the bug we're fixing.
[Other Info]
Pull request: https:/
Commit: https:/
== End SRU Template ==
== Original Description ==
After performing a do-release-upgrade from stock trusty to xenial and rebooting cloud-init traces in it's attempt to preserve instance data:
Probably obj.pkl issues across upgrade and a need to refresh Paths object after the dist upgrade.
2020-10-10 18:01:02,377 - util.py[DEBUG]: Read 298 bytes from /etc/os-release
2020-10-10 18:01:02,378 - util.py[WARNING]: failed stage init-local
2020-10-10 18:01:02,379 - util.py[DEBUG]: failed stage init-local
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
_maybe_
File "/usr/lib/
init.
File "/usr/lib/
json_
AttributeError: 'Paths' object has no attribute 'run_dir'
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: cloud-init 20.3-2-
ProcVersionSign
Uname: Linux 5.4.0-48-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.25
Architecture: amd64
CloudName: LXD
Date: Sat Oct 10 21:22:46 2020
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: cloud-init
UpgradeStatus: Upgraded to xenial on 2020-10-10 (0 days ago)
cloud-init-
2020-10-10 18:01:02,378 - util.py[WARNING]: failed stage init-local
AttributeError: 'Paths' object has no attribute 'run_dir'
2020-10-10 18:01:02,979 - util.py[WARNING]: failed stage init
AttributeError: 'Paths' object has no attribute 'run_dir'
I just noticed this affects torkoal (cloud-init 20.4.1- 0ubuntu1~ 18.04.1) . On reboot we have:
[ 36.428237] cloud-init[4810]: failed run of stage modules-config ------- ------- ------- ------- ------- ------- ------- ---- python3/ dist-packages/ cloudinit/ cmd/main. py", line 653, in status_wrapper python3/ dist-packages/ cloudinit/ cmd/main. py", line 494, in main_modules persist_ instance_ data(init) python3/ dist-packages/ cloudinit/ cmd/main. py", line 695, in _maybe_ persist_ instance_ data .persist_ instance_ data() python3/ dist-packages/ cloudinit/ sources/ __init_ _.py", line 333, in persist_ instance_ data join(self. paths.run_ dir, ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ---- python3/ dist-packages/ cloudinit/ cmd/main. py", line 653, in status_wrapper python3/ dist-packages/ cloudinit/ cmd/main. py", line 494, in main_modules persist_ instance_ data(init) python3/ dist-packages/ cloudinit/ cmd/main. py", line 695, in _maybe_ persist_ instance_ data .persist_ instance_ data() python3/ dist-packages/ cloudinit/ sources/ __init_ _.py", line 333, in persist_ instance_ data join(self. paths.run_ dir, ------- ------- ------- ------- ------- ------- ------- ----
[ 36.428373] cloud-init[4810]: -------
[ 36.428434] cloud-init[4810]: Traceback (most recent call last):
[ 36.428509] cloud-init[4810]: File "/usr/lib/
[ 36.428590] cloud-init[4810]: ret = functor(name, args)
[ 36.428666] cloud-init[4810]: File "/usr/lib/
[ 36.428740] cloud-init[4810]: _maybe_
[ 36.428809] cloud-init[4810]: File "/usr/lib/
[ 36.428873] cloud-init[4810]: init.datasource
[ 36.428938] cloud-init[4810]: File "/usr/lib/
[ 36.429003] cloud-init[4810]: json_sensitive_file = os.path.
[ 36.429067] cloud-init[4810]: AttributeError: 'Paths' object has no attribute 'run_dir'
[ 36.429140] cloud-init[4810]: -------
[ 38.552480] cloud-init[4899]: failed run of stage modules-final
[ 38.552630] cloud-init[4899]: -------
[ 38.552695] cloud-init[4899]: Traceback (most recent call last):
[ 38.552746] cloud-init[4899]: File "/usr/lib/
[ 38.552819] cloud-init[4899]: ret = functor(name, args)
[ 38.552866] cloud-init[4899]: File "/usr/lib/
[ 38.552922] cloud-init[4899]: _maybe_
[ 38.553001] cloud-init[4899]: File "/usr/lib/
[ 38.553057] cloud-init[4899]: init.datasource
[ 38.553132] cloud-init[4899]: File "/usr/lib/
[ 38.553204] cloud-init[4899]: json_sensitive_file = os.path.
[ 38.553267] cloud-init[4899]: AttributeError: 'Paths' object has no attribute 'run_dir'
[ 38.553337] cloud-init[4899]: -------