Bug 1132483

Summary: publican-4.1.3-2.fc22 FTBFS: Cannot determine local time zone
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: publicanAssignee: Ruediger Landmann <rlandman>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: jfearn, me, rlandman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://koji.fedoraproject.org/koji/taskinfo?taskID=7434942
Whiteboard:
Fixed In Version: perl-DateTime-TimeZone-1.74-2.fc22 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-03 06:35:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1135981    
Bug Blocks:    

Description Petr Pisar 2014-08-21 12:30:59 UTC
publican-4.1.3-2.fc22 fails to build in F22 because some tests fail like:

#   Failed test 'Update POT  files'
#   at t/410.Translate.t line 29.
# Cannot determine local time zone
# Looks like you failed 1 test of 3.
t/410.Translate.t ............. 
Dubious, test returned 1 (wstat 256, 0x100)
Failed

These tests fail:

Test Summary Report
-------------------
t/410.Translate.t           (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  3
  Non-zero exit status: 1
t/900.publican.t            (Wstat: 256 Tests: 19 Failed: 1)
  Failed test:  8
  Non-zero exit status: 1
t/910.publican.Users_Guide.t (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1

The difference between last working build root and this one is:

Removed packages:
	ca-certificates-2013.1.97
	chkconfig-1.3.61
	crypto-policies-20140708
	glib2-2.41.2
	kernel-headers-3.16.0
	krb5-libs-1.12.1
	libidn-1.28
	nspr-4.10.6
	perl-ExtUtils-Manifest-1.64
	perl-Socket-2.014
	perl-Sub-Name-0.08
	perl-Test-Harness-3.32
	rpm-4.11.90
	rpm-build-4.11.90
	rpm-build-libs-4.11.90
	rpm-libs-4.11.90
	rpm-plugin-selinux-4.11.90
	tzdata-2014e
	tzdata-java-2014e
Added packages:
	ca-certificates-2014.2.1
	chkconfig-1.3.62
	crypto-policies-20140812
	glib2-2.41.3
	kernel-headers-3.17.0
	krb5-libs-1.12.2
	libidn-1.29
	nspr-4.10.7
	perl-ExtUtils-Manifest-1.65
	perl-Socket-2.015
	perl-Sub-Name-0.09
	perl-Test-Harness-3.33
	rpm-4.12.0
	rpm-build-4.12.0
	rpm-build-libs-4.12.0
	rpm-libs-4.12.0
	rpm-plugin-selinux-4.12.0
	tzdata-2014f
	tzdata-java-2014f

The probable reason is updating tzdata from 2014e to 2014f.

Comment 1 Jeff Fearn 🐞 2014-08-21 22:52:36 UTC
Looks like the tz update broke perl-DateTime-TimeZone?

I'm betting this generates the same error if run in the build root:

perl -MDateTime -e 'print DateTime->now( time_zone => "local" )->strftime("%Y-%m-%d %H:%M%z")'

Comment 2 Petr Pisar 2014-08-22 05:46:00 UTC
perl-DateTime-TimeZone does not use system tzdata at all.

Comment 3 Petr Pisar 2014-08-22 06:04:39 UTC
Actually it uses it as a one method to determine the localtime zone. However this looks like the default mock build root does not have set localtime. Or the DateTime::TimeZone::Local::Unix class does not return "UTC" time zone as the default value if no local time zone is

Comment 4 Ruediger Landmann 2014-08-28 05:36:57 UTC
(In reply to Jeff Fearn from comment #1)
> Looks like the tz update broke perl-DateTime-TimeZone?
> 
> I'm betting this generates the same error if run in the build root:
> 
> perl -MDateTime -e 'print DateTime->now( time_zone => "local"
> )->strftime("%Y-%m-%d %H:%M%z")'

On my local system I had:

$ perl -MDateTime -e 'print DateTime->now( time_zone => "local" )->strftime("%Y-%m-%d %H:%M%z")'
Cannot determine local time zone

$ timedatectl
      Local time: Thu 2014-08-28 15:31:25 EST
  Universal time: Thu 2014-08-28 05:31:25 UTC
        Timezone: n/a (EST, +1000)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

Which seemed odd, so I updated the system Time and Date settings and ran it again. This time, I got:

$ timedatectl
      Local time: Thu 2014-08-28 15:33:47 AEST
  Universal time: Thu 2014-08-28 05:33:47 UTC
        Timezone: n/a (AEST, +1000)
     NTP enabled: no
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

and:

$ perl -MDateTime -e 'print DateTime->now( time_zone => "local" )->strftime("%Y-%m-%d %H:%M%z")'
2014-08-28 15:33+1000

I can build Publican fine now! :)

t/920.WebSite.t ............... ok     
All tests successful.
Files=10, Tests=69, 142 wallclock secs ( 0.22 usr  0.05 sys + 125.53 cusr  4.12 csys = 129.92 CPU)
Result: PASS

Comment 5 Petr Pisar 2014-08-28 07:34:28 UTC
Australia has changed time zone abbreviation identifiers <http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html>. I don't know how timedatectl works, maybe the /etc/localtime symlink was dangling after updating tzdata, so you had to reconfigure it to reflect the change.

Comment 6 Petr Pisar 2014-09-01 11:46:23 UTC
There is shorter reproducer:

# perl -MDateTime::TimeZone::Locae::TimeZone::Local->TimeZone'
Cannot determine local time zone

It happens when /etc/localtime file does has its copy under /usr/share/zoneinfo.

I think the issue with koji is that the file is copied from mock's hosts and then newer tzdata package installed into the mock environment, so the copy copy does not match anymore. The DateTime::TimeZone::Local::Unix reads:

Some systems just copy the relevant file to F</etc/localtime> instead
of making a symlink.  In this case, we look in F</usr/share/zoneinfo>
for a file that has the same size and content as F</etc/localtime> to
determine the local time zone.

Comment 7 Petr Pisar 2014-09-03 06:35:28 UTC
This should be fixed by perl-DateTime-TimeZone-1.74-2.fc22.