-
Notifications
You must be signed in to change notification settings - Fork 908
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
cloud-init doesn't prefer new APT config format when old and new are provided #2711
Comments
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-25T09:50:21.882627+00:00 Since not all Ubuntu releases and not all users will have the latest, the new configuration format should be preferred instead of the old configuration format if both are provided, rather than failing. |
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-25T15:00:59.885033+00:00 |
Launchpad user Scott Moser(smoser) wrote on 2016-08-25T15:16:16.311859+00:00 Here is a simple recreate
apt_proxy: http://192.168.122.1:8000/ system_info:
$ lxc launch ubuntu-daily:yakkety "--config=user.user-data=$(cat /tmp/my.user-data)" |
Launchpad user Christian Ehrhardt (paelzer) wrote on 2016-08-26T12:01:14.253740+00:00 Merge request with fix and tests at https://code.launchpad.net/~paelzer/cloud-init/+git/cloud-init/+merge/304064 |
Launchpad user Launchpad Janitor(janitor) wrote on 2016-08-26T20:55:40.887754+00:00 This bug was fixed in the package cloud-init - 0.7.7-22-g763f403-0ubuntu1 cloud-init (0.7.7-22-g763f403-0ubuntu1) yakkety; urgency=medium
-- Scott Moser smoser@ubuntu.com Fri, 26 Aug 2016 15:22:13 -0400 |
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-30T14:11:51.465407+00:00 I'm reopening this bug and this has not really been fixed: ubuntu@node01:~$ dpkg -l | grep cloud-init Config MAAS sends cloud-init: http://pastebin.ubuntu.com/23111940/ /etc/apt/sources.list: http://pastebin.ubuntu.com/23111941/ cloud-init.log: http://paste.ubuntu.com/23111945/ Note that curtin rev 418 works just fine, while cloud-init doesn't. Note that in the cloud-init config we send "preserve_sources_list: True" while in curtin config it is False. |
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-30T14:18:48.316348+00:00 http://pastebin.ubuntu.com/23111966/ -> with preserve_source_list: false, then sources.list gets updated accordingly. |
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-30T14:25:53.118222+00:00 Seeting back to fix-released, as now we need to send preserve_sources_list: false |
Launchpad user Scott Moser(smoser) wrote on 2016-09-12T20:50:27.874440+00:00 fixed in 0.7.8. |
Launchpad user Chris J Arges(arges) wrote on 2016-09-13T20:18:26.798125+00:00 Hello Andres, or anyone else affected, Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.7-31-g65ace7b-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance! |
Launchpad user Martin Pitt(pitti) wrote on 2016-09-15T14:30:50.198236+00:00 Hello Andres, or anyone else affected, Accepted cloud-init into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/cloud-init/0.7.8-1-g3705bb5-0ubuntu1~16.04.1 in a few hours, and then in the -proposed repository. Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users. If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision. Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance! |
Launchpad user Scott Moser(smoser) wrote on 2016-09-21T17:56:23.394972+00:00 verified as per sru template description. |
Launchpad user Launchpad Janitor(janitor) wrote on 2016-09-22T17:34:08.065412+00:00 This bug was fixed in the package cloud-init - 0.7.8-1-g3705bb5-0ubuntu1~16.04.1 cloud-init (0.7.8-1-g3705bb5-0ubuntu1~16.04.1) xenial-proposed; urgency=medium
cloud-init (0.7.7-31-g65ace7b-0ubuntu1~16.04.2) xenial-proposed; urgency=medium
cloud-init (0.7.7-31-g65ace7b-0ubuntu1~16.04.1) xenial-proposed; urgency=medium
-- Scott Moser smoser@ubuntu.com Thu, 15 Sep 2016 09:57:27 -0400 |
Launchpad user Chris J Arges(arges) wrote on 2016-09-22T17:35:39.342746+00:00 The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions. |
This bug was originally filed in Launchpad as LP: #1616831
Launchpad details
Launchpad user Andres Rodriguez(andreserl) wrote on 2016-08-25T09:42:42.082471+00:00
==== Begin SRU Template ====
[Impact]
New apt configuration was enabled, but if the user provided both new
configuration format and old configuration format, then then cloud-init
would error.
The fixed behavior is to allow new and old and warn if they differ.
This allows a user to provide the same data for older releases and newer release.
[Test Case]
Recreate failure (this would recreate on intermediate versions of
cloud-init that were in trusty, but will not on xenial version.
testing the working path is still valid though to ensure it functions.
you will need to adjust both proxy settings to a local proxy.
$ cat >user-data <<EOF
#cloud-config
apt:
preserve_sources_list: false
primary:
uri: http://us.archive.ubuntu.com/ubuntu
proxy: http://192.168.122.1:8000/
security:
uri: http://us.archive.ubuntu.com/ubuntu
sources:
launchpad_3: {source: 'deb http://ppa.launchpad.net/maas/next/ubuntu main'}
apt_proxy: http://192.168.122.1:8000/
EOF
$ release=xenial$name "--config=user.user-data=$ (cat user-data)"
$ name=x1
$ lxc launch ubuntu-daily:$release
$ while ! lxc exec "$name" -- [ -f /run/cloud-init/result.json ]; do sleep 1; done
$ lxc exec $name -- grep WARN /var/log/cloud-init.log
Now update container, clean and reboot to show first boot
$ lxc exec $name -- sh -c '
p=/etc/apt/sources.list.d/proposed.list
echo deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc)-proposed main > "$p" &&
apt-get update -q && apt-get -qy install cloud-init'
$ lxc exec $name -- sh -c '
cd /var/lib/cloud && for d in ; do [ "$d" = "seed" ] || rm -Rf "$d"; done
rm -Rf /var/log/cloud-init'
$ lxc exec $name reboot
$ lxc exec $name -- grep WARN /var/log/cloud-init.log || echo no warn
this should show us archive used.
$ lxc exec $name -- grep us.archive /etc/apt/sources.list | grep deb | tail -n 3
$ lxc exec $name -- cat /etc/apt/apt.conf.d/95cloud-init-proxy
[Regression Potential]
The apt feature itself (added under bug 1574113) could have regressions, as seen in bug 1621180.
This fix specifically relaxed cloud-init's behavior, making it more backwards compatible. It should not be too prone to regression itself.
==== End SRU Template ====
Trying to use the new configuration format of APT configuration while still providing the OLD format, causes cloud-init fails to configure APT.
cloud-init should be ignoring the old format if the new format is provided to ensure backwards compat.
This is a problem for MAAS provided that we cannot safely differentiate / determine what cloud-init version we are using for a specific release we are deploying, and as such, we still need to send the old config while still providing the new one because:
And this is a problem because:
Aug 25 09:44:17 node02 [CLOUDINIT] cc_apt_configure.py[ERROR]: Error in apt configuration: old and new format of apt features are mutually exclusive ('apt':'{'primary': [{'arches': ['default'], 'uri': 'http://us.archive.ubuntu.com/ubuntu'}], 'preserve_sources_list': True, 'security': [{'arches': ['default'], 'uri': 'http://us.archive.ubuntu.com/ubuntu'}], 'sources': {'launchpad_3': {'source': 'deb http://ppa.launchpad.net/maas/next/ubuntu yakkety main'}}}' vs 'apt_proxy' key)
Aug 25 09:51:58 node02 [CLOUDINIT] util.py[DEBUG]: Running module apt-configure (<module 'cloudinit.config.cc_apt_configure' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py'>) failed#012Traceback (most recent call last):#12 File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 785, in _run_modules#012 freq=freq)#12 File "/usr/lib/python3/dist-packages/cloudinit/cloud.py", line 70, in run#012 return self._runners.run(name, functor, args, freq, clear_on_fail)#12 File "/usr/lib/python3/dist-packages/cloudinit/helpers.py", line 199, in run#012 results = functor(*args)#12 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py", line 77, in handle#012 ocfg = convert_to_v3_apt_format(ocfg)#12 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py", line 527, in convert_to_v3_apt_format#012 cfg = convert_v2_to_v3_apt_format(cfg)#12 File "/usr/lib/python3/dist-packages/cloudinit/config/cc_apt_configure.py", line 489, in convert_v2_to_v3_apt_format#012 raise ValueError(msg)#012ValueError: Error in apt configuration: old and new format of apt features are mutually exclusive ('apt':'{'preserve_sources_list': True, 'primary': [{'uri': 'http://us.archive.ubuntu.com/ubuntu', 'arches': ['default']}], 'security': [{'uri': 'http://us.archive.ubuntu.com/ubuntu', 'arches': ['default']}], 'sources': {'launchpad_3': {'source': 'deb http://ppa.launchpad.net/maas/next/ubuntu yakkety main'}}}' vs 'apt_proxy, apt_preserve_sources_list' key)
The text was updated successfully, but these errors were encountered: