FirebirdSQL / firebird

Firebird server, client and tools
https://www.firebirdsql.org/
1.19k stars 205 forks source link

Qyzylorda Standard Time issue #8029

Closed ErmacTheSoul closed 2 months ago

ErmacTheSoul commented 3 months ago

hello, our customer is having troubles when using Qyzylorda Standard Time our application is on Java and its working with Firebird 4.0 database

when the Timezone in Windows 10 is set to Qyzylorda Standard Time and the app is trying to connect to database an error is occured:

2024-03-01 12:54:50 [1] Error when connecting to OFFICE DB. Server: localhost Path: c:/Office/Db/FDB/OFFICE.FDB Error: Invalid time zone region: GMT+05:00 [SQLState:22009, ISC error]

but if we switch to the different GMT +05:00 (Ekaterinburg for example) error is not appearing anymore and all works correctly

is this a Java or Firebird issue? maybe tzdata must be updated to work with Qyzylorda Standard Timezone

Java version is 1.8.0_301

hvlad commented 3 months ago

There is 'Asia/Qyzylorda' time zone, is it what you need ?

asfernandes commented 3 months ago

Please check if there is any message in firebird.log.

ErmacTheSoul commented 3 months ago

There is 'Asia/Qyzylorda' time zone, is it what you need ?

Yes

Please check if there is any message in firebird.log.

in the firebird.log I can see only 10054 (Socket error) errors, but I believe they are not related to this issue

asfernandes commented 3 months ago

What version of Firebird 4? First ensure the error is happening with the latest version. Or at least with latest tzdata files (you can get it in https://github.com/FirebirdSQL/firebird/raw/master/extern/icu/tzdata/le.zip)

ErmacTheSoul commented 3 months ago

Firebird 4.0.2.2816

i tried to update tzdata from be.zip, no effect now tried with le.zip - same error

mrotteveel commented 3 months ago

Which Jaybird version are you using? As far as I'm aware, this can happen if your OS reports GMT+05:00 to Java as its time zone (which BTW, means it doesn't tell Java it's in Asia/Qyzylorda!). I created a workaround in Jaybird 4.0.9 and Jaybird 5 for this, so this probably means you're using Jaybird 4.0.8 or older (the latest 4.0.x is 4.0.10, the latest 5.0.x is 5.0.3)

mrotteveel commented 3 months ago

Specifically, this sounds like https://github.com/FirebirdSQL/jaybird/issues/720

mrotteveel commented 3 months ago

As an unrelated aside, you're quite a few Java versions behind (12 releases). You may want to consider updating to Java 8 update 401.

hvlad commented 3 months ago

I can confirm that fb4.0.2 works wrongly o Win10 with 'Qyzylorda Standard Time'.

SQL> select current_timestamp from rdb$database;

                                        CURRENT_TIMESTAMP
=========================================================
2024-03-01 16:52:04.9270 +05:00

and firebird.log contains message Invalid time zone (Qyzylorda Standard Time). Falling back to displacement.

It was fixed by extracting content of https://github.com/FirebirdSQL/firebird/raw/master/extern/icu/tzdata/le.zip

into tzdata folder of Firebird instance and restarting the Firebird

mrotteveel commented 3 months ago

An alternative workaround is to explicitly set the sessionTimeZone connection property to Asia/Qyzylorda.

ErmacTheSoul commented 3 months ago

Which Jaybird version are you using? As far as I'm aware, this can happen if your OS reports GMT+05:00 to Java as its time zone (which BTW, means it doesn't tell Java it's in Asia/Qyzylorda!). I created a workaround in Jaybird 4.0.9 and Jaybird 5 for this, so this probably means you're using Jaybird 4.0.8 or older (the latest 4.0.x is 4.0.10, the latest 5.0.x is 5.0.3)

we are using Jaybird 4.0.6, will try to update to 4.0.9

hvlad commented 3 months ago

Note, the timezone database supplied with FB4.0.2 is old and reports displacement of +360 min for 'Asia/Qyzylorda', while it was changed in 2018 to be +300. I.e. it is necessary to update tzdata. But, better, is to upgrade whole Firebird installation to the most recent 4.0.4

mrotteveel commented 3 months ago

we are using Jaybird 4.0.6, will try to update to 4.0.9

Update to Jaybird 4.0.10, or 5.0.3. There is no point in updating to a release that has since been superseded by a newer version.

ErmacTheSoul commented 3 months ago

we are using Jaybird 4.0.6, will try to update to 4.0.9

Update to Jaybird 4.0.10, or 5.0.3. There is no point in updating to a release that has since been superseded by a newer version.

Got it, thank you very much, will try to update Jaybird and Firebird and if the problem still appear - i'll reopen the issue.

ErmacTheSoul commented 2 months ago

after updating to Jaybird 4.0.10 and Firebird 4.0.4 we are getting spammed with warnings in log files:

8:28:54 PM org.firebirdsql.logging.JulLogger warn WARNING: TimeZone fallback to GMT from +05:00; possible cause: value of sessionTimeZone unknown in Java. Time and Timestamp values may yield unexpected values. Consider setting a different value for sessionTimeZone.

how to prevent these warnings from appearing?

mrotteveel commented 2 months ago

For issues in Jaybird, please create an issue in https://github.com/FirebirdSQL/jaybird/issues. The firebird repository is only about Firebird server.

And as I said earlier, to prevent this you can set the sessionTimeZone connection property to Asia/Qyzylorda. Alternatively, find out why your OS is reporting GMT+05:00 instead of Asia/Qyzylorda to Java, and fix that.

mrotteveel commented 2 months ago

The reported warning was indeed a bug in Jaybird for this case. It is fixed in Jaybird 5.0.4, which was just released.