Can't find "Montreal" when setting Time Zone

Bug #1887107 reported by Adrien L.
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-control-center (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I can't find Montreal in the timezone search box, even though it is present in the /usr/share/zoneinfo database.

What I did:
Settings > Time & Date > Time Zone > Click in the search box and start typing Mont...
What I expected:
Autocompletion.
What happened:
No completion found.

$ lsb_release -rd
Description: Ubuntu 20.04 LTS
Release: 20.04

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: gnome-control-center 1:3.36.1-1ubuntu5
ProcVersionSignature: Ubuntu 5.4.0-26.30-generic 5.4.30
Uname: Linux 5.4.0-26-generic x86_64
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Thu Jul 9 23:59:01 2020
ExecutablePath: /usr/bin/gnome-control-center
ProcEnviron:
 LANGUAGE=en_CA:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-control-center
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Adrien L. (adrienlll) wrote :
Revision history for this message
Adrien L. (adrienlll) wrote :

I did a little bit more digging. Perhaps this comment would help explain why there is a problem: https://github.com/eggert/tz/commit/45dcf69b45087cff50282d4da64b86a7d705ddf3#commitcomment-4602830

In release v2013e "America/Montreal" was removed from the zone.tab file, and incorrect programs may assume that zone.tab is the only authoritative list of valid TZs.

Quoting the aformentioned linked comment:
> The TZ setting 'America/Montreal' should work as it did before, for all time stamps after 1970.
> My guess is that PHP, or some other program that you're using, is looking at zone.tab directly, under the incorrect assumption that only the strings listed in zone.tab are valid TZ settings. You'd have a similar problem with 'Asia/Istanbul', 'Europe/Nicosia', 'Asia/Saigon', etc.; these are all valid TZ settings that are not in zone.tab. You need to track down which program is making this invalid assumption, and fixing it to either (1) not insist that the TZ setting be in zone.tab, or (2) not insist on using TZ settings like America/Montreal and Asia/Istanbul that work but are not in zone.tab."

I noticed that `timedatectl list-timezones` also fails to list a valid Montreal timezone, and it seems that this is a systemd util, pulling its data from I don't know where... So maybe the bug is upstream.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug 1884307, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

Changed in gnome-control-center (Ubuntu):
importance: Undecided → Low
Revision history for this message
Adrien L. (adrienlll) wrote :

I don't think this is correct to mark this as a duplicate of bug #1884307. #1884307 is a bug at the installation of Ubuntu Mate, and for all we know, this might pull from a different database than the bug I am currently reporting.

In fact, I already reported another similar bug on the ubiquity package, where the problem is that Montreal exists but is misspelled. The ubiquity package seems to have its own database, separate from tzdata, which is the bug is different.

Revision history for this message
Adrien L. (adrienlll) wrote :

After some quick investigation, I found that gnome-control-center pulls its data directly from the zone.tab file, just like Paul Eggert warned against doing in the comment I quoted above.

in tz.h (https://github.com/GNOME/gnome-control-center/blob/5532301ce76d2719c1105c61f576abe7fae2dc16/panels/datetime/tz.h)

# define TZ_DATA_FILE "/usr/share/zoneinfo/zone.tab"

in tz.c (https://github.com/GNOME/gnome-control-center/blob/5532301ce76d2719c1105c61f576abe7fae2dc16/panels/datetime/tz.c)

static gchar *
tz_data_file_get (void)
{
 gchar *file;

 file = g_strdup (TZ_DATA_FILE);

 return file;
}

[...]

TzDB *
tz_load_db (void)
{
 g_autofree gchar *tz_data_file = NULL;
 TzDB *tz_db;
 FILE *tzfile;
 char buf[4096];

 tz_data_file = tz_data_file_get ();
 if (!tz_data_file) {
  g_warning ("Could not get the TimeZone data file name");
  return NULL;
 }
 tzfile = fopen (tz_data_file, "r");
 if (!tzfile) {
  g_warning ("Could not open *%s*\n", tz_data_file);
  return NULL;
 }

 tz_db = g_new0 (TzDB, 1);
 tz_db->locations = g_ptr_array_new ();

 while (fgets (buf, sizeof(buf), tzfile))
 {
  [PARSING CODE].
 }

 fclose (tzfile);

 /* now sort by country */
 sort_locations_by_country (tz_db->locations);

 /* Load up the hashtable of backward links */
 load_backward_tz (tz_db);

 return tz_db;
}

Revision history for this message
Sebastien Bacher (seb128) wrote :

The issue sounds like an upstream one then, could you report it on https://gitlab.gnome.org/GNOME/gnome-control-center/issues ?

Revision history for this message
Adrien L. (adrienlll) wrote :

I will.

Changed in gnome-control-center (Ubuntu):
status: New → Triaged
summary: - Missing entry for timezone database when setting timezone via the text
- search
+ Can't find "Montreal" when setting Time Zone
Changed in gnome-control-center (Ubuntu):
importance: Low → Medium
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.