Skip to content
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

Invalid time zone (+08). Falling back to displacement [CORE6520] #6749

Closed
firebird-automations opened this issue Mar 22, 2021 · 30 comments
Closed

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Basil A. Sidorov (basid)

CentOS Linux release 7.9.2009 (Core)
LI-V4.0.0.2390 Firebird 4.0 Release Candidate 1
--
ls -lhF /opt/firebird/tzdata/
total 244K
-r--r--r--. 1 root root 41K Mar 22 09:32 metaZones.res
-r--r--r--. 1 root root 20K Mar 22 09:32 timezoneTypes.res
-r--r--r--. 1 root root 23K Mar 22 09:32 windowsZones.res
-r--r--r--. 1 root root 153K Mar 22 09:32 zoneinfo64.res
--
timedatectl status
Local time: Mon 2021-03-22 17:04:57 +08
Universal time: Mon 2021-03-22 09:04:57 UTC
RTC time: Mon 2021-03-22 09:04:57
Time zone: Asia/Irkutsk (+08, +0800)
NTP enabled: n/a
NTP synchronized: no
RTC in local TZ: no
DST active: n/a

firebird.log:
--
vm-centos-7.local Mon Mar 22 17:05:23 2021
/opt/firebird/bin/fbguard: guardian starting /opt/firebird/bin/firebird

vm-centos-7.local Mon Mar 22 17:05:23 2021
Invalid time zone (+08). Falling back to displacement.
--

Commits: 73a26f6

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

CentOS 7 is fully updated (yum update and reboot before install FB).
Currently installed:
libicu.x86_64 50.2-4.el7_7 @base

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

assignee: Adriano dos Santos Fernandes [ asfernandes ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Does firebird.conf have any custom DefaultTimeZone config?

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

Firebird only installed without any configuration, but ...

System info: tzdata.noarch 2021a-1.el7 @updates

Firebird info:
DATABASE_VERSION 2018e
RDB$TIME_ZONE_ID 65260
RDB$TIME_ZONE_NAME Asia/Irkutsk
RDB$START_TIMESTAMP 2014-10-25 17:00:00.0000 GMT
RDB$END_TIMESTAMP 9999-12-31 23:59:59.9999 GMT
RDB$ZONE_OFFSET 480
RDB$DST_OFFSET 0
RDB$EFFECTIVE_OFFSET 480

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Tzdata version from RC1 should be 2021a.

Why your is 2018e?

Did you queries with select rdb$time_zone_util.database_version() from rdb$database ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

Yes, "Firebird info" - is result of select from firebird system table.
No, I don't know why "system info" (yum -C list tzdata) is different from "Firebird info".

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Do you have ICU_TIMEZONE_FILES_DIR environment variable set?

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

Yes:
strings /proc/`pgrep firebird`/environ
LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HOME=/opt/firebird
LOGNAME=firebird
USER=firebird
SHELL=/sbin/nologin
ICU_TIMEZONE_FILES_DIR=/opt/firebird/tzdata

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please show exactly file sizes in bytes of files present in /opt/firebird/tzdata/

Also, what is the result if you remove that env. var. (and reboot)?

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

ls -l /opt/firebird/tzdata/
total 244
-r--r--r--. 1 root root 41824 Mar 22 09:32 metaZones.res
-r--r--r--. 1 root root 20112 Mar 22 09:32 timezoneTypes.res
-r--r--r--. 1 root root 22592 Mar 22 09:32 windowsZones.res
-r--r--r--. 1 root root 155808 Mar 22 09:32 zoneinfo64.res

ICU_TIMEZONE_FILES_DIR is automatically set by firebird, not in unit:
--
sudo systemctl cat firebird
#⁠ /usr/lib/systemd/system/firebird.service
[Unit]
Description=Firebird Database Server
After=syslog.target network.target

[Service]
User=firebird
Group=firebird
Type=forking
ExecStart=/opt/firebird/bin/fbguard -daemon -forever
StandardError=syslog

[Install]
WantedBy=multi-user.target
--
and not set for fbguard:
sudo strings /proc/`pgrep fbguard`/environ
LANG=en_US.UTF-8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HOME=/opt/firebird
LOGNAME=firebird
USER=firebird
SHELL=/sbin/nologin

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Does the problem happens both with localhost protocol and embedded?

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

Local protocol - not applicable: process firebird started already and message already written.

Embedded - yes, but only on very first open of any database.
-- tzchk.sql
set list;
set echo off;
shell top -u firebird -bn1; -- show process list
shell cat /dev/null > firebird.log; -- log truncate
shell date; -- just timestamp
shell printenv|grep ICU; -- check ICU_TIMEZONE_FILES_DIR envvar
shell tail firebird.log; -- should be no output

connect 'employee' user sysdba; commit;
shell tail firebird.log; -- should be "Invalid time zone (+08). Falling back to displacement."

select rdb$time_zone_util.database_version() from rdb$database;
select * from RDB$TIME_ZONES where RDB$TIME_ZONE_NAME = 'Asia/Irkutsk';
select * from rdb$time_zone_util.transitions('Asia/Irkutsk', timestamp '2020-01-01', timestamp '2021-01-01');
commit;
exit;

-- output on my system (some empty line insterted and removed for better formatting)
-- sudo su -s /bin/sh - firebird -c "bin/isql -q -z -b -i tzchk.sql"
ISQL Version: LI-V4.0.0.2390 Firebird 4.0 Release Candidate 1

top - 17:30:13 up 36 min, 1 user, load average: 0.05, 0.03, 0.05
Tasks: 102 total, 1 running, 101 sleeping, 0 stopped, 0 zombie
%Cpu(s): 7.1 us, 7.1 sy, 0.0 ni, 85.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 2047036 total, 1771284 free, 147332 used, 128420 buff/cache
KiB Swap: 2559996 total, 2559996 free, 0 used. 1755684 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1289 firebird 20 0 161972 2036 1452 R 16.7 0.1 0:00.19 top
1274 firebird 20 0 133892 2316 1876 S 0.0 0.1 0:00.19 isql

Thu Mar 25 17:30:13 +08 2021

ICU_TIMEZONE_FILES_DIR=/opt/firebird/tzdata

Server version:
LI-V4.0.0.2390 Firebird 4.0 Release Candidate 1

vm-centos-7.local Thu Mar 25 17:30:13 2021
Invalid time zone (+08). Falling back to displacement.

DATABASE_VERSION 2018e

RDB$TIME_ZONE_ID 65260
RDB$TIME_ZONE_NAME Asia/Irkutsk

RDB$START_TIMESTAMP 2014-10-25 17:00:00.0000 GMT
RDB$END_TIMESTAMP 9999-12-31 23:59:59.9999 GMT
RDB$ZONE_OFFSET 480
RDB$DST_OFFSET 0
RDB$EFFECTIVE_OFFSET 480

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

If change time zone on Europe/Moscow - message "Invalid timezone ..." are disappear, but Firebird tzdb version not changed (2018e).

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

How did you install libncurses.6 in CentOS 7?

I'm trying to test with docker, but was not able to install it.

With docker and CentOS 8 I had no problem.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Looks like ICU 50 is too old and cannot open tzdata present in firebird.

You should probably update it if possible.

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

FB4-RC1 build 2353 not installed on "older" linuxes (CentOS 7, Ubuntu 18 and so on) without modification http://install.sh and manual creating symlink libncurses.so.6 on libncurses.so.5 (fixed in CORE6516 and nightly build).
I can't update libicu on CentOS 7 - this is system library, but FB4 can make private build libicu as for libtomcrypt.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

I tried a lot to debug the problem but this system is full of old tools.

Compilers present on its repositories does not build Firebird and ICU.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Your tzdata package has nothing to do with ICU tzdata.

Generally, OS repositories seems to not update ICU tzdata.

It's why we deploy updated tzdata.

But looks like the ICU version you had does not understand ICU_TIMEZONE_FILES_DIR and also does not have internal API u_setTimeZoneFilesDirectory so it does not read Firebird tzdata.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

Adriano,

Your comments and the details of this ticket raise concerns about the 'stability' of the feature. It seems very 'brittle', dependent external functionality which will make support/debugging of same very difficult.

It suggest that It seems that the engine install should incorporate a minimal ICU footprint as a plug-in/library or Firebird sub-folder, to isolate the engine from the overall system environment and engine the best user experience.

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

Sean, I disagree with your suggestion.

If we want to provide support to old OSes use of docker appears much better approach than adding everything to firebird package.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Do you see something bad in treating +08 equal to +08:00 in TimeZoneUtil::parse(), as a workaround?

@firebird-automations
Copy link
Collaborator Author

Commented by: @AlexPeshkoff

At the first glance it's OK, the only hazard - compatibility with a lot of previous datetime formats should be checked.

@firebird-automations
Copy link
Collaborator Author

Commented by: Basil A. Sidorov (basid)

"Docker as solution" - bad idea.
Docker (any containers) are very big change of IT-infrastructure, but many users prolongs simple system upgrade. "Docker? Mission impossile"
If old tzdata is not critical, then "100% nothing is solution" (c) "The Fondation"

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> Do you see something bad in treating +08 equal to +08:00 in TimeZoneUtil::parse(), as a workaround?

It looks ok.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Yes, docker, flatpak, snap, all of them may work.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

> > Do you see something bad in treating +08 equal to +08:00 in TimeZoneUtil::parse(), as a workaround?
>
> It looks ok.

I mean, only for detect default time zone.

Not to allow user time zones in this way, as that we were allowing and now disallowing.

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Sure, this is what i meant.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 4.0.0 [ 10931 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Resolved [ 5 ]

QA Status: No test => Cannot be tested

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants