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

Improve support for Half-Hour time zones #5648

Closed
bernisys opened this issue Jan 17, 2024 · 7 comments
Closed

Improve support for Half-Hour time zones #5648

bernisys opened this issue Jan 17, 2024 · 7 comments
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Milestone

Comments

@bernisys
Copy link
Contributor

bernisys commented Jan 17, 2024

Describe the bug

We see a lot of errors like this in the apache error logs:

Invalid date.timezone value 'Etc/GMT-5.5', we selected the timezone 'UTC' for now. in .../cacti/lib/functions.php on line 1053

To Reproduce

Steps to reproduce the behavior:

Not sure how to reproduce this properly, but we seem to have some machines which come with a time zone of "Etc/GMT-5.5" to cacti. ON processing the request, we see tons of apache error logs, because php seems not to be aware that a -5.5h time offset is indeed valid.

Expected behavior

fractions in time offsets should work, because there are half-hour offsets in the world.

Additional context

I "fixed" this for us by simply adding a "round()" around the time-offset calculation in "global.php" around line 555. I just changed it to "round(abs($hours))" instead of jsut the "abs()" part, then it doesn't throw the error any more. This is not a really clean approach though, as we cut off the half hour offset, but at least there are a lot less logs cluttering the disks.

Not sure about what the correct format here, i just wanted to stab this very quick & very dirty. But i think this gives you a good enough clue where to look into.

Cheers & keep up the good work!

@bernisys bernisys added bug Undesired behaviour unverified Some days we don't have a clue labels Jan 17, 2024
@bernisys
Copy link
Contributor Author

There is a similar issue listed for the Owncloud project, they seem to have solved it by mapping the fractional Etc/GMT zones to ones that actually exist in the list, with Country/City notation instead of just the offset in hours.

See: owncloud/core#14429

@TheWitness
Copy link
Member

What Cacti version @bernisys ?

@TheWitness
Copy link
Member

Looks like it's not supported in any version of PHP. So, if it's not detected, I guess round is the only way to go.

@TheWitness TheWitness added this to the 1.2.27 milestone Jan 28, 2024
TheWitness added a commit that referenced this issue Jan 28, 2024
Fractional time offsets can cause huge webserver error-logs
TheWitness added a commit that referenced this issue Jan 28, 2024
Fractional time offsets can cause huge webserver error-logs
@TheWitness TheWitness added resolved A fixed issue confirmed Bug is confirm by dev team and removed unverified Some days we don't have a clue labels Jan 28, 2024
@bernisys
Copy link
Contributor Author

bernisys commented Feb 5, 2024 via email

@TheWitness
Copy link
Member

Okay, I'm going to leave this hack in place for the moment and log something to the PHP people.

@TheWitness
Copy link
Member

Logged here: php/php-src#13428

@TheWitness
Copy link
Member

@bernisys, this should be fixed in 1.2.26. I went to the PHP team and they told me that I should use a lookup table for these odd ball timezones, which I had already done post 1.2.17. Bad memory.

@netniV netniV changed the title Fractional time offsets can cause huge webserver error-logs Improve support for Half-Hour time zones Apr 28, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour confirmed Bug is confirm by dev team resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

2 participants