-
Notifications
You must be signed in to change notification settings - Fork 818
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
cc_timezone fails on Ubuntu Bionic and Xenial minimal #3761
Comments
Launchpad user Ryan Harper(raharper) wrote on 2020-07-20T21:12:31.641696+00:00 What happens on Focal? |
Launchpad user Ryan Harper(raharper) wrote on 2020-07-20T21:14:18.174212+00:00 Has tzdata ... This looks like a cloudimg issue, not cloud-init. |
Launchpad user Ryan Harper(raharper) wrote on 2020-07-20T21:16:26.653398+00:00 Let's get a comment w.r.t whether minimal images are required to support setting TIMEZONE; It appears like they should since focal has tzdata; so I'd lean on not doing anything in cloud-init; it seems like a valid failure (you wanted to set a timezone, but we cannot without tzdata). |
Launchpad user Joshua Powers(powersj) wrote on 2020-07-24T16:43:45.297339+00:00 Based on discussions with foundations, it is unintentional that it's been pulled in on focal. The reason it is in focal is due to libicu is pulling it in. |
Launchpad user Dan Watkins(oddbloke) wrote on 2020-07-28T17:31:33.713529+00:00 OK, so this is not an issue with cloud-init or the minimal cloud images in their default configuration. The issue we're running into here is that multipass will include There is a broader question about cloud-init's behaviour: what should it do if it can't find the specified timezone definition? It seems to me there are two options: (a) treat this as a configuration error and fail, or (b) attempt to ensure that zone files are installed (by installing tzdata in the Ubuntu case) and retry timezone configuration. I would lean towards (a) for a couple of reasons. Firstly, the only case we know of missing tzdata is on intentionally minimal images; if a user is choosing to use the stripped-down images then they probably want to be involved in the decisions about what software is installed on the system, and may be surprised by cloud-init silently installing a package. In a sense, we should let them be explicit in their decision on the trade-off between "setting a timezone" and "having as few packages as possible". Secondly, we cannot easily determine from within the image why the specified timezone is unavailable: is "no file found at /usr/share/zoneinfo/America/Chcagio" because we don't have timezone definitions installed, or because there is no such timezone? Any thoughts from other folks? |
Launchpad user Dan Watkins(oddbloke) wrote on 2020-07-28T17:40:08.945331+00:00 (canonical/multipass#1665 is the multipass issue.) |
Launchpad user Paride Legovini(paride) wrote on 2020-07-31T09:10:10.797268+00:00 I'd also prefer (a) for the reasons stated by Dan and for one more: we already have a way to declare dependencies/relationships between packages, and that's dpkg and the d/control file. If cloud-init depends on tzdata, then I think it should declare the dependency, and not try to "manually" install the package, a process that can go wrong or get stuck for a number of reasons (broken sources.list, missing media, stuck apt lock, ...). |
Launchpad user Dan Watkins(oddbloke) wrote on 2020-08-04T20:49:43.657802+00:00 Marking this Incomplete so it'll age out if no-one makes a case against (a). |
For some reason the bug never auto-closed in LP even though it was marked Incomplete. Closing here |
This bug was originally filed in Launchpad as LP: #1888298
Launchpad details
Launchpad user Joshua Powers(powersj) wrote on 2020-07-20T18:33:03.381252+00:00
Summary
On Ubuntu Bionic and Xenial minimal images, there is no tzdata package. As a result, when cloud-init tries to set the timezone it will fail and produce a stack trace.
Expected Result
No trace and no failure of the cloud-config.service :)
Actual result
2020-07-20 18:13:22,515 - util.py[DEBUG]: Running module timezone (<module 'cloudinit.config.cc_timezone' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_timezone.py'>) failed
File "/usr/lib/python3/dist-packages/cloudinit/config/cc_timezone.py", line 47, in handle
cloud.distro.set_timezone(timezone)
File "/usr/lib/python3/dist-packages/cloudinit/distros/debian.py", line 165, in set_timezone
distros.set_etc_timezone(tz=tz, tz_file=self._find_tz_file(tz))
OSError: Invalid timezone America/Vancouver, no file found at /usr/share/zoneinfo/America/Vancouver
Steps to reproduce
$ wget https://cloud-images.ubuntu.com/daily/server/minimal/releases/bionic/release/ubuntu-18.04-minimal-cloudimg-amd64.img
$ multipass launch file:///$(pwd)/ubuntu-18.04-minimal-cloudimg-amd64.img --name=bionic-minimal
$ multipass exec bionic-minimal -- sudo systemctl list-units --failed --no-legend
note that cloud-config.service fails
$ multipass exec bionic-minimal -- sudo cat /var/log/cloud-init.log | grep timezone
The text was updated successfully, but these errors were encountered: