Skip to content
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

Ubuntu images have broken /etc/timezone file #161

Open
satwell opened this issue Aug 12, 2024 · 2 comments
Open

Ubuntu images have broken /etc/timezone file #161

satwell opened this issue Aug 12, 2024 · 2 comments

Comments

@satwell
Copy link

satwell commented Aug 12, 2024

All of the buildpack-deps ubuntu images have broken content in /etc/timezone:

% docker run --rm buildpack-deps:24.04-curl cat /etc/timezone
/UTC

The /etc/timezone file is supposed to be the name of a timezone, in the same format as the TZ environment variable. /UTC is invalid (note the slash at the beginning). The Debian-based buildpack-deps images have Etc/UTC in this file, which is correct.

The problem happens during installation of the tzdata package in the -curl images. tzdata has some friendly prompts to configure the timezone, and they're failing when stdin isn't available during the docker build. See the relevant portion of the build log:

Setting up tzdata (2024a-3ubuntu1.1) ...
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (Can't locate Term/ReadLine.pm in @INC (you may need to install the Term::ReadLine module) (@INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.38.2 /usr/local/share/perl/5.38.2 /usr/lib/x86_64-linux-gnu/perl5/5.38 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.38 /usr/share/perl/5.38 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 8.)
debconf: falling back to frontend: Teletype
Configuring tzdata
------------------

Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.

  1. Africa   3. Antarctica  5. Asia      7. Australia  9. Indian    11. Etc
  2. America  4. Arctic      6. Atlantic  8. Europe     10. Pacific
Geographic area: 
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 112.

Current default time zone: '/UTC'
Local time is now:      Sun Aug 11 00:16:25 UTC 2024.
Universal Time is now:  Sun Aug 11 00:16:25 UTC 2024.
Run 'dpkg-reconfigure tzdata' if you wish to change it.

Use of uninitialized value $val in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 4.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/perl5/Debconf/Format/822.pm line 85, <GEN6> line 4.

Debian isn't affected by this bug because the debian images already have the tzdata package installed correctly.

The root cause here seems to be a bug in tzdata--it shouldn't fail in a way that writes an invalid configuration.

But it's easy to work around in buildpack-deps. Setting DEBIAN_FRONTEND=noninteractive when running apt-get install will prevent packages from trying to prompt for configuration.

@tianon
Copy link
Member

tianon commented Aug 12, 2024

The root cause here seems to be a bug in tzdata--it shouldn't fail in a way that writes an invalid configuration.

Is this filed in an upstream bug tracker somewhere? 👀

@satwell
Copy link
Author

satwell commented Aug 13, 2024

I've filed a bug against Debian tzdata at https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1078604.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants