-
Notifications
You must be signed in to change notification settings - Fork 202
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
Timestamp discrepancy between system and user #1332
Comments
This is a bigger problem than I though initially. Most of timestamps in director as based on local timezone, but not that of the server, but that from the user perspective, so every change, import, sync has timestamps based on the Timezone of the user doing it. Activity Log in addition seems to do some kind of timezone calculation. This is something we should address soon, I guess the best way is to use all database timestamps as UTC, and translate them only in UI/CLI @Thomas-Gelf thoughts? |
That's issue #58, so a very early one. Column will be a SIGNED BIGINT with unix timestamp as milliseconds. Easy to implement, but migration queries will be expensive for legacy systems. Not a big problem, but irritating for people triggering migrations from the GUI with proxies or FPM cutting your connection after some default timeout. So, my initial idea was to defer this unless we have the possibility to run background jobs for the Icinga Web 2 frontend. In case you want to speed this up we could add an "expensive" flag as a comment in our migration files, the GUI could then forbid running them and point you to the cli. |
My problem is not precision, it is actually the wrong time... A migration could be done, but most important is how we generate, store and display time. |
Precision never hurts :D The fix will be the fact that it will be a unix timestamp, so no doubt about timezone. |
+1
… On 8. Mar 2018, at 18:34, Thomas Gelf ***@***.***> wrote:
Precision never hurts :D The fix will be the fact that it will be a unix timestamp, so no doubt about timezone.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Unfortunately this does not completely fix the issue. I have no idea where it is set, but the date() function uses the Timezone of the User/Browser instead of the server timezone. Thus the times in activitylog and deployment log are not consistent across multiple time zones. for example:
Server configuration:
Debugging the mentioned line:
Tested with:
|
Are you sure, do you see wrong data? You're right, date() uses the timezone configured for the current web request, defaulting to your browsers time zone, eventually overridden in your personal settings. On connection setup we're telling the database this CLIENT time zone, and the database should translate timezone-aware columns correctly. Could you please show an example we could use to reproduce erroneous data? |
Table director_activity_log:
Also the activity and deployment log in the web ui are mixed up. For example the stuff for user_berlin is on top although there are newer changes from user_utc. |
@XnS: and all those changes have been made AFTER upgrading Director? I assume you're running MySQL? |
2x yes |
Aaaargh... I got it. The DB column is @XnS: thanks for your help with this! Now, the problem is that a migration for this often very huge table is expensive, and with the current implementation most users run them in the UI. I do not want to risk such migrations to interrupt unexpectedly, that's why we will move that and similar tasks to a background daemon. That one however will be merged into master after v1.5.0, so I'm sorry to say that we're forced to postpone this. It will however be followed with high priority. |
all right, thanks for the clarification :-) |
I saw that a fix for this was put into 1.5.0, released today. I installed this release and still seeing the issue. Do I manually need to run the migration within the database? I already applied the default schema changes via the UI once upgraded to 1.5.0. |
Hi there! any news on this? |
There seems to be a timezone problem in timestamps within the out log.
Wrong:
Correct:
Container / Server environment is:
UTC
,date.timezone = UTC
Browser Timezone:
Europe/Berlin
Your Environment
ref/NC/561505
The text was updated successfully, but these errors were encountered: