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

Time and timezone in mariaDB container affect some logs or action log time #37

Open
Wolvverine opened this issue Sep 18, 2019 · 3 comments
Assignees

Comments

@Wolvverine
Copy link

Wolvverine commented Sep 18, 2019

If mariadb container have another time/timezone then example here /front/crontask.php will be last run time from mariaDB.
https://glpi-install.readthedocs.io/en/develop/timezones.html

short workaround:

ocker exec -it mariadb /bin/sh -c "export TZ='Europe/Warsaw'"
docker exec -it mariadb /bin/sh -c "rm /etc/localtime"
docker exec -it mariadb /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone"

@ghost
Copy link

ghost commented Apr 23, 2020

I am in mysql and it gives me the same error but those commands do not work for me it runs two hours late compared to Europe / Madrid time

@Turgon37 Turgon37 self-assigned this May 9, 2020
@Turgon37
Copy link
Owner

Turgon37 commented May 9, 2020

Hello,
First of all, having different timezones inside the same "infrastructure" is a bad practice. If you have many datacenter across the world you can apply different timezone, but in my mind you must locate glpi and it's database in the same area to avoid this situation.
Then, as I read here https://glpi-install.readthedocs.io/en/develop/timezones.html the issue is more related to mysql missing configuration than glpi missing configuration.
Since docker image version 2.4.2, the timezone setting is supported in php.

I suggest you to apply the glpi recomendation on your mysql database.

@Wolvverine
Copy link
Author

You are right about the MariaDB container above. It is associated with setting the same time zone in it as in the others and in the docker.

It would be worth adding to the readme to set it up for container.

docker exec -it mariadb /bin/sh -c "export TZ='Europe/Warsaw'"
docker exec -it mariadb /bin/sh -c "rm /etc/localtime"
docker exec -it mariadb /bin/sh -c "ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants