-
Notifications
You must be signed in to change notification settings - Fork 25
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
"Cannot determine time zone" on FreeBSD #13
Comments
From [email protected] (@schwern) on 2010-02-26 19:59:45: A further tidbit of information, /etc/localtime is not a symlink and it One possibility is that /etc/localtime was updated as part of an update One possible work around is to use zdump and scrape the output. |
From [email protected] (@autarch) on 2010-02-27 16:48:40: On Fri, 26 Feb 2010, Michael G Schwern via RT wrote:
This could, in theory, be fixed by just using the binary Olson file But in this case, it seems like your system has a problem. If there's no You suggested using zdump, which I suppose could work, assuming that the -dave /============================================================ |
From [email protected] on 2010-02-27 21:53:13: [email protected] via RT wrote:
So far this has shown up on two independent machines, neither are mine. A I've contacted szrezic and apeiron to see if they can shed any light.
|
From [email protected] (@schwern) on 2010-02-27 22:47:03: Here's what I've figured out from talking with apeiron. Its likely The problem occurs like so:
Failure to re-run tzsetup is the fault of the operating system A simple fallback mechanism would be to use POSIX::strftime() to get the $ perl -wle 'use POSIX; print strftime("%Z %z", localtime)' This is enough to identify the time zone. If there's a way to get all Or DT simply reads and trusts /etc/localtime which would seem to be the |
From [email protected] (@eserte) on 2010-02-28 10:11:09: On Sat Feb 27 17:47:03 2010, MSCHWERN wrote:
Excellent analysis, and this is what happened on my system, too: I Though there's one problem in the proposed workaround with POSIX: $ perl -wle 'use POSIX; print strftime("%Z %z", localtime)' However, I think that the result of DateTime::TimeZone's heuristics was Regards, |
From [email protected] (@schwern) on 2010-02-28 10:46:49: On Sun Feb 28 05:11:09 2010, SREZIC wrote:
Yes, and the result from the heuristic would not be "CET" but would be a Personally I'd just trust /etc/localtime like everything else does. Dave? |
From [email protected] (@eserte) on 2010-02-28 16:11:06: On Sun Feb 28 05:11:09 2010, SREZIC wrote:
Another observation: a list of all possible timezone names as returned for tz in This results in 137 timezone names on a FreeBSD machine, and 138 on a Regards, |
From [email protected] (@autarch) on 2010-02-28 20:51:50: On Sun, 28 Feb 2010, Slaven_Rezic via RT wrote:
Those are short names, which are generated based on a long name (like The DT::TZ catalog is generated based on the Olson database source data. The short names are primarily useful for output only. If you look in the -dave /============================================================ |
From [email protected] (@autarch) on 2010-03-02 18:50:49: On Sun, 28 Feb 2010, Michael G Schwern via RT wrote:
I'd rather not include Tzfile. That doesn't really fix the problem, since If someone wants to implement a lookup based on POSIX output, I'd probably -dave /============================================================ |
From [email protected] on 2010-03-02 20:43:00: [email protected] via RT wrote:
We know using POSIX::strtime() is going to give us an ambiguous time zone For example, Arizona doesn't observe DST but it'll still match MST. Here's On the one hand, using POSIX::strftime output we know is never going to be I'm not sure how one would efficiently map the short form time zone to a long On the other hand, /etc/localtime might be out of date, but it might not be. One can reverse the whole argument. Because DateTime maintains its own zone DateTime getting it wrong isn't any better than /etc/localtime getting it DateTime can't solve the real problem, it is out of its control and scope.
|
From [email protected] on 2014-09-02 16:02:15: Dne Ne 28.úno.2010 05:46:49, MSCHWERN napsal(a):
I have the same feeling. The only problem with this approach is you cannot obtain the time zone name. I asked tzdata Fedora package maintainer to augment tzfile format to deliver the zone name, and he said that upstream had already refused any change in the format.
I hit this "bug" in Fedora build system, unfortunately nobody can come with a fix on other side (tzdata package, build tools etc). You can read https://bugzilla.redhat.com/show_bug.cgi?id=1135981 and bugs referenced from there via See Also and Blocks or Depends, if you are interested in this topic. -- Petr |
I would like to add a data point to this discussion. As part of a project to track "blead-breaks-CPAN" instances through the upcoming 5.29 development cycle, a colleague and I from ny.pm, in cooperation with New York City BSD Users Group (NYCBUG), are in the process of installing a FreeBSD-11.1 virtual machine on a FreeBSD-11.1 host provided by NYCBUG. The VM in question is Vagrant box "generic/freebsd11" (https://app.vagrantup.com/generic/boxes/freebsd11/versions/1.5.0) and the provider is virtualbox. Last week I installed FreeBSD ports via There was one very significant difference in the results when running in this FreeBSD box, however: Dist-Zilla had test failures and failed to install. This in turn prevented the hundreds of CPAN distros in the top 3000 of the CPAN river which depend on Dist-Zilla to be skipped by I spent most of the past four days trying to diagnose this problem and develop workarounds. This problem was not related to perl-5.27.11; I could not install Dist-Zilla against the default
So the problem was not in Dist-Zilla but in the interaction between DateTime (in this case, its dependency DateTime::TimeZone) and the operating system.
I will submit a documentation patch which might improve matters. Thank you very much. |
This is in fact an issue with dzil. Users of DT::TZ should not write test code using the The easy fix is to add something like |
On 05/22/2018 01:09 PM, Dave Rolsky wrote:
This is in fact an issue with dzil. Users of DT::TZ should not write
test code using the |local| time zone without some extra thought first.
See rjbs/Dist-Zilla#586 <rjbs/Dist-Zilla#586>
for discussion.
The easy fix is to add something like |local $ENV{TZ} =
'America/Chicago'| to any test code that will try to determine the local
tz. AFAIK every platform's local tz module checks that var first.
RJBS actually mitigated one DZ test failure with that approach several
years ago. And, following his lead, I (a) submitted
rjbs/Dist-Zilla#622 to fix 3 test failures I
found in Dist-Zilla with the same approach; (b) began to submit
patches/p.r.s to three other top-3000 distros that were also failing in
this VM with the same exception.
The problem I ran into was that some CPAN authors may be reluctant to
take this approach, deeming it -- not without reason -- as a kludge.
(I'd name names, but not on list.) So that's when I began looking
deeper, for a root cause. rjbs/Dist-Zilla#586
documents the existence of a problem, and my p.r. works around it, but I
don't think the discussion there actually pinpoints where in DZ the
problem occurs (though I think I've narrowed it down to one particular
module).
In any case, while I have enough to enable me to proceed on
test-against-dev, I still think some mention of this somewhere in
DT-TZ's docs would be helpful -- regardless of whether DZ gets fixed or not.
Thank you very much.
Jim Keenan
|
On 05/22/2018 01:09 PM, Dave Rolsky wrote:
[snip]
Users of DT::TZ should not write
test code using the |local| time zone without some extra thought first.
Perhaps *that* should go into the DT-TZ docs as well.
|
Yes, agreed. |
I think you mean |
On 05/22/2018 04:43 PM, Slaven Rezić wrote:
After further study of the discussion in this ticket, I realized
that the box completely lacked an /etc/password file. I then ran the
FreeBSD tzsetup utility to establish US Eastern Time as our default
time zone.
I think you mean |/etc/localtime|, not |/etc/password|.
Yes, my error.
Yes.
|
Migrated from rt.cpan.org #55029 (status was 'open')
Requestors:
Attachments:
From [email protected] (@schwern) on 2010-02-26 19:39:44:
$ perl -wle 'use DateTime; DateTime->now( time_zone => "local" )'
Cannot determine local time zone
$ uname -a
FreeBSD eschaton.local 7.2-STABLE FreeBSD 7.2-STABLE #0: Sat Nov 14
22:23:32 EST 2009 [email protected]:/usr/obj/usr/src/sys/ESCHATON
amd64
I'm also seeing it on FreeBSD 8.
http://www.cpantesters.org/cpan/report/6868995
Digging into the problem, the only DateTime::TimeZone::Local::Unix
method which is having any luck is /etc/localtime, the rest of the files
checked do not exist, but there are no files of the same size in
/usr/share/zoneinfo.
Attached is a copy of /etc/localtime from that system.
This is with 5.10.1 and DateTime::TimeZone 1.10.
The text was updated successfully, but these errors were encountered: