tzdata sets /etc/timezone to `/UTC`, not `Etc/UTC`

Bug #1899343 reported by Michael Overmeyer
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
debconf (Debian)
New
Unknown
debconf (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

When installed within the `ubuntu` Docker container, `tzdata` sets `etc/timezone` to `/UTC`, not `Etc/UTC`, which breaks applications that are reading `etc/timezone` and expecting a valid timezone name.

I'm guess that this wasn't noticed, since technically `/usr/share/zoneinfo//UTC` (double slash) still works.

Here is a Dockerfile that reproduces the issue:

```dockerfile
FROM ubuntu

RUN apt-get update && \
    apt-get install -y tzdata
```

Here is the output of `docker build`:

```
test (master)$ docker build --no-cache -t tztest .
Sending build context to Docker daemon 2.56kB
Step 1/3 : FROM ubuntu
 ---> 9140108b62dc
Step 2/3 : RUN apt-get update && apt install -y tzdata
 ---> Running in 03da406f73cb
Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB]
Get:4 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [75.9 kB]
Get:5 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
Get:6 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [1169 B]
Get:7 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [626 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
Get:9 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
Get:10 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [406 kB]
Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
Get:13 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [745 kB]
Get:14 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [832 kB]
Get:15 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [88.7 kB]
Get:16 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [21.6 kB]
Get:17 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4277 B]
Fetched 16.2 MB in 4s (3919 kB/s)
Reading package lists...

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  tzdata
0 upgraded, 1 newly installed, 0 to remove and 4 not upgraded.
Need to get 293 kB of archives.
After this operation, 4026 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 tzdata all 2020a-0ubuntu0.20.04 [293 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 293 kB in 1s (262 kB/s)
Selecting previously unselected package tzdata.
(Reading database ... 4121 files and directories currently installed.)
Preparing to unpack .../tzdata_2020a-0ubuntu0.20.04_all.deb ...
Unpacking tzdata (2020a-0ubuntu0.20.04) ...
Setting up tzdata (2020a-0ubuntu0.20.04) ...
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 contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
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 4. Australia 7. Atlantic 10. Pacific 13. Etc
  2. America 5. Arctic 8. Europe 11. SystemV
  3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 111.

Current default time zone: '/UTC'
Local time is now: Sun Oct 11 11:35:33 UTC 2020.
Universal Time is now: Sun Oct 11 11:35:33 UTC 2020.
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 83, <GEN6> line 4.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/perl5/Debconf/Format/822.pm line 84, <GEN6> line 4.
Removing intermediate container 03da406f73cb
 ---> 1351f8569438
Step 3/3 : RUN dpkg-reconfigure tzdata
 ---> Running in f78304bec7fa
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 contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Readline.pm line 7.)
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 4. Australia 7. Atlantic 10. Pacific 13. Etc
  2. America 5. Arctic 8. Europe 11. SystemV
  3. Antarctica 6. Asia 9. Indian 12. US
Geographic area:
Use of uninitialized value $_[1] in join or string at /usr/share/perl5/Debconf/DbDriver/Stack.pm line 111.

Current default time zone: '/UTC'
Local time is now: Sun Oct 11 11:35:35 UTC 2020.
Universal Time is now: Sun Oct 11 11:35:35 UTC 2020.

Use of uninitialized value $val in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 83.
Use of uninitialized value $val in concatenation (.) or string at /usr/share/perl5/Debconf/Format/822.pm line 84.
Removing intermediate container f78304bec7fa
 ---> 5852cb5533c8
Successfully built 5852cb5533c8
Successfully tagged tztest:latest
```

no longer affects: zoneinfo
summary: - tzdata sets /etc/timezone to `/UTC`, not `UTC`
+ tzdata sets /etc/timezone to `/UTC`, not `Etc/UTC`
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tzdata (Ubuntu):
status: New → Confirmed
Revision history for this message
Benjamin Drung (bdrung) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I can reproduce it with the provided dockerfile and command. The ubuntu Docker image currently points at jammy.

Benjamin Drung (bdrung)
Changed in tzdata (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Benjamin Drung (bdrung) wrote :

This can be reproduced by running "dpkg-reconfigure --frontend teletype tzdata" and then pressing Ctrl+D.

Changed in debconf (Debian):
status: Unknown → New
Benjamin Drung (bdrung)
Changed in tzdata (Ubuntu):
importance: Undecided → Medium
Benjamin Drung (bdrung)
affects: tzdata (Ubuntu) → debconf (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package debconf - 1.5.86ubuntu1

---------------
debconf (1.5.86ubuntu1) noble; urgency=medium

  * Fix uninitialized value on "EOF" (^D) (Closes: #723843, LP: #1899343)

 -- Benjamin Drung <email address hidden> Fri, 12 Apr 2024 14:40:53 +0200

Changed in debconf (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.