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

ZEN V12 - Reporting Solution TimeZone Mismatches #7342

Open
RHDHV-simon-sutcliffe opened this issue Nov 4, 2022 · 6 comments · May be fixed by #7479
Open

ZEN V12 - Reporting Solution TimeZone Mismatches #7342

RHDHV-simon-sutcliffe opened this issue Nov 4, 2022 · 6 comments · May be fixed by #7479

Comments

@RHDHV-simon-sutcliffe
Copy link

RHDHV-simon-sutcliffe commented Nov 4, 2022

Describe the bug
When the packetfence server and the engineer viewing reporting are in different timezones the reported information is incorrect.

To Reproduce
Steps to reproduce the behaviour:

  1. Setup Packetfence in CET Time Zone
  2. Have some data entered into the DB by for example accounting
  3. Go to Reports | Accounting | Bandwidth
  4. With the Engineer Browser \ system in GMT (CET-1)
  5. Press clock to see data in last 1 hour
  6. See error as no data is displayed.

Screenshots
If applicable, add screenshots to help explain your problem.
Engineer in GMT
image

Database \ PF Server in CET
image

Expected behavior
Data entering the PF server is unified to a single timezone for any sources (For example UTC)

Reporting queries are unified to the same timezone meaning data is displayed for the query entered.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Edge
  • Version 107

Additional context
We are unsure what happens when various timezone reporting values are pushed into Packetfence from many different timezones.

@julsemaan
Copy link
Collaborator

From what I recall, I thought we did use the TZ of the server as the reference for datetime in reports and all other views.

Perhaps this has regressed at some point but the datetime fields in the admin should always use the TZ of the server

@satkunas, can you take a look at this?

@satkunas
Copy link
Contributor

satkunas commented Nov 4, 2022

The date/time shown in the UI is indifferent to the client timezone. Only the servers timezone is used.

Furthermore, the timezone changes are not propagated until the database is restarted:

# date +"%Z %z"
UTC +0000

# mysql -e "SELECT @@system_time_zone";
+--------------------+
| @@system_time_zone |
+--------------------+
| UTC                |
+--------------------+
# date +"%Z %z"
EDT -0400

# mysql -e "SELECT @@system_time_zone";
+--------------------+
| @@system_time_zone |
+--------------------+
| UTC                |
+--------------------+

# /usr/local/pf/bin/pfcmd generatemariadbconfig
# systemctl restart packetfence-mariadb
# mysql -e "SELECT @@system_time_zone";
+--------------------+
| @@system_time_zone |
+--------------------+
| EDT                |
+--------------------+

@RHDHV-simon-sutcliffe
Copy link
Author

@satkunas and @julsemaan

I needed some time to understand your answer and how this reflects to what I am trying to explain. But I am there now, based on that I do think we have a GUI bug.

Let's start with where my browser thinks it is (GMT)

image

Goto in PF | Reports | Accounting | Node

You will see that the Initial populated times are as you stated in the server TZ. In our case GMT+1

image

If I now press the Clock and Select an offered quick pick time range for example 30mins

image

You will see that the GUI stops using the server TZ but sets up the data range based on my local TZ GMT

image

Based on what I understood from the explanation above the GUI should have created the quick pick selection using the PF servers TZ (GMT+1)

I hope that helps to understand if this is a bug or a by design

Simon

@satkunas
Copy link
Contributor

Preloaded dates in the date/time fields are set using the server's TZ.

Manually chosen dates are set using the users' TZ.

When PacketFence OS's timezone and the UI user OS's timezone differ there is a discrepancy for the user. This discrepancy causes confusion, especially when tailing reports. Currently the user must think in terms of the servers' TZ, rather than using their local TZ.

This is not a bug.

As a feature we could either:
a) Display all date/time fields in the local user's TZ, and include TZ w/ date/time formatting.
b) add TZ selection in search criteria, with default choice set to servers' TZ.

@julsemaan
Copy link
Collaborator

This is not a bug.

I'll have to disagree with this since in prior versions of PacketFence, the admin interface was consistent for the TZ and consistently used the TZ of the server for reports and views. So that means it's a regression from a previous release, not a new ask

@julsemaan
Copy link
Collaborator

@satkunas will assess how large the fix will be

@satkunas satkunas linked a pull request Jan 27, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants