I'm trying to use Oracle's tzupdater tool for updating timezone data. I saw a stack overflow answer (Error updating tzdata 2018f (Released 2018-10-18) with tzupdater-2.2.0) saying the problem was fixed in a 2018 version of the timezone data, but it's now trying to install a 2019 version and is still failing.
# java -jar tzupdater.jar -v -l
Using https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz as source for tzdata bundle.
java.home: /usr/java/jre1.8.0_102
java.vendor: Oracle Corporation
java.version: 1.8.0_102
tzupdater version 2.2.0-b01
JRE tzdata version: tzdata2016d
Downloaded file to /tmp/tz.tmp_3/tzdata.tar.gz
tzupdater tool would update with tzdata version: tzdata2019b
Compiling TZDB version 2019b
Parsing file: /tmp/tz.tmp_3/africa
Parsing file: /tmp/tz.tmp_3/antarctica
Parsing file: /tmp/tz.tmp_3/asia
Failed: java.lang.Exception: Failed while parsing file '/tmp/tz.tmp_3/asia' on line 1865 'Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S'
java.lang.Exception: Failed while parsing file '/tmp/tz.tmp_3/asia' on line 1865 'Rule Japan 1948 1951 - Sep Sat>=825:00 0 S'
at tools.tzdb.TzdbZoneRulesCompiler.parseFile(TzdbZoneRulesCompiler.java:377)
at tools.tzdb.TzdbZoneRulesCompiler.compile(TzdbZoneRulesCompiler.java:191)
at tools.tzdb.TzdbZoneRulesCompiler.<init>(TzdbZoneRulesCompiler.java:307)
at com.sun.tools.tzupdater.ExternalModule.compileToJSRBinary(ExternalModule.java:153)
at com.sun.tools.tzupdater.TimezoneUpdater.run(TimezoneUpdater.java:230)
at com.sun.tools.tzupdater.TimezoneUpdater.main(TimezoneUpdater.java:634)
Caused by: tools.tzdb.DateTimeException: Invalid value for SecondOfDay value: 90000
at tools.tzdb.ChronoField.checkValidValue(ChronoField.java:173)
at tools.tzdb.LocalTime.ofSecondOfDay(LocalTime.java:210)
at tools.tzdb.TzdbZoneRulesCompiler.parseMonthDayTime(TzdbZoneRulesCompiler.java:475)
at tools.tzdb.TzdbZoneRulesCompiler.parseRuleLine(TzdbZoneRulesCompiler.java:399)
at tools.tzdb.TzdbZoneRulesCompiler.parseFile(TzdbZoneRulesCompiler.java:354)
... 5 more
Was this problem actually fixed? Or is there another workaround? Thanks.
Currently, the TZUpdater tool is only compatible with the "rearguard" data format, which no longer has pre-built binaries. IANA has never published them, but Paul Eggert (the TZ maintainer) was previously publishing them on his own personal site. He has decided not to do that any more. (There's a long thread in the TZDB mailing list about this.)
Fortunately, you can build them yourself through the following procedure:
tzdb-2019b.tar.lz
from IANA.sudo apt install lzip
(if you don't have it already)lzip -d tzdb-2019b.tar.lz
tar xvf tzdb-2019b.tar
cd tzdb-2019b
make rearguard_tarballs
The resulting
tzdata2019b-rearguard.tar.gz
file is compatible with TZUpdater:Hopefully this will eventually get resolved with an updated version of TZUpdater that understands the release format without requiring rearguard data.
I'd like to comment that Matt's solution also works using Cygwin on Windows, just make sure to install packages
lzip
andmake
as they are not selected by default.Only this I did not get working on Windows is using a local file.
java -jar tzupdater.jar -v -l tzdata2019b-rearguard.tar.gz
andjava -jar tzupdater.jar -v -l file://tzdata2019b-rearguard.tar.gz
don't work for me, so I copied to an internal server and then was able to update usingjava -jar tzupdater.jar -v -l http://some-iis-server/tzdata2019b-rearguard.tar.gz