** Description changed: + === Begin SRU Template === + [Impact] + In PR #777, we added 'vendordata2' and 'vendordata2_raw' attributes to the DataSource class, but didn't use the upgrade framework to deal with an unpickle after upgrade. Because of this, anybody upgrading their cloud-init from an older version to 21.1 who hasn't also run `cloud-init clean` will have cloud-init fail with a traceback. + + The change here should fix that failure. + + [Test Plan] + Launch an instance or install a cloud-init package using version earlier than 21.1-19-gbad84ad4-0ubuntu1 (if downgrading also run `cloud-init clean`). + + Upgrade to 21.1-19-gbad84ad4-0ubuntu1 or later, then reboot (without + running `cloud-init clean`). + + On un-patched versions, `cloud-init status` will show error, and there + will be a traceback in /var/log/cloud-init.log. Patched versions should + show no error or traceback. + + [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://github.com/canonical/cloud-init/pull/869 + A test has also been added upstream and to our CI to prevent these types of errors from happening in the future: https://github.com/canonical/cloud-init/blob/master/tests/integration_tests/test_upgrade.py#L107 + + == End SRU Template == + + == Original Description == + On a test LXD VM instance, I see: 2021-04-06 14:05:11,296 - util.py[WARNING]: failed stage init 2021-04-06 14:05:11,302 - util.py[DEBUG]: failed stage init Traceback (most recent call last): - File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 652, in status_wrapper - ret = functor(name, args) - File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 376, in main_init - init.update() - File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 371, in update - self._store_raw_vendordata(self.datasource.get_vendordata2_raw(), - File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 506, in get_vendordata2_raw - return self.vendordata2_raw + File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 652, in status_wrapper + ret = functor(name, args) + File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 376, in main_init + init.update() + File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 371, in update + self._store_raw_vendordata(self.datasource.get_vendordata2_raw(), + File "/usr/lib/python3/dist-packages/cloudinit/sources/__init__.py", line 506, in get_vendordata2_raw + return self.vendordata2_raw AttributeError: 'DataSourceNoCloud' object has no attribute 'vendordata2_raw'
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1922739 Title: AttributeError: 'DataSourceNoCloud' object has no attribute 'vendordata2_raw' To manage notifications about this bug go to: https://bugs.launchpad.net/cloud-init/+bug/1922739/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs