Git Product home page Git Product logo

Comments (2)

gboudreau avatar gboudreau commented on August 17, 2024

This change was made 8 months ago, in 0.5.11
Unless you never updated Greyhole since then, the most likely culprit would be a TZ change on your server, either at the OS level, or in MySQL.

The above code is only executed if the timezone of the system, and of MySQL, differs.
It checks what time it is using time(), which returns the system's time (same you'd get issuing a date command in a shell), and checks what time MySQL thinks it is, using SELECT NOW(), and if the two ar more than 20 minutes apart, it will try to set the correct timezone in MySQL.
That's what is causing the error you noticed.

The easiest fix would be to change either the system TZ, or MySQL TZ (using mysql.conf) so that both match.

I'll change the code to at least NOT crash in this case, and log a warning.

from greyhole.

jpwise9 avatar jpwise9 commented on August 17, 2024

Hi, thanks for the response.
Looks like I'm running greyhole 0.15.18 - last updated 4-Aug-22 - no updates in apt repo when troubleshooting yesterday.

mysql is currently set to default timezone=SYSTEM
I identified the issue after trying to similarly set the timezone manually to -13:00 based on the greyhole error - and running into the same error greyhole was having.
As far as I can recall - the server has been set to NZDT timezone since it was set up, but I can't rule out that I've changed something along the way.

Below is the output since upgrading to mysql-server-8, although the timezone was also SYSTEM previously.

mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
1 row in set (0.00 sec)

mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2022-09-26 20:18:48 |
+---------------------+
1 row in set (0.00 sec)

timedatectl output is:

                   Local time: Mon 2022-09-26 20:19:12 NZDT
              Universal time: Mon 2022-09-26 07:19:12 UTC
                    RTC time: Mon 2022-09-26 07:19:12
                   Time zone: Pacific/Auckland (NZDT, +1300)
   System clock synchronized: yes

systemd-timesyncd.service active: yes
RTC in local TZ: no

Re-reading my original notes though - NZDT is actually "+13:00", not "-13:00" as I originally wrote (pre-coffee), so I'm also a not sure how it calculated to a negative timezone offset to issue the command either?
But after updating mysql to v8, timezone="-13:00" is a valid option, and as far as I can tell greyhole isn't repeatedly re-issuing the command, although I haven't turned on full sql logging to confirm fully.

Thx.

from greyhole.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.