docker-glpi icon indicating copy to clipboard operation
docker-glpi copied to clipboard

Timezones wont enable

Open NorsemanLicensing opened this issue 1 year ago • 4 comments

Just installed the latest docker image and cannot seem to get the time zones function to enable. found the mariadb did not have time zone tables at all so i created the tables and populated them, and I have the time zone set in the environment variables, but glpi still says time zones are not enabled run the php command "php bin/console database:enable_timezones" to enable. however i cannot find how to run this in docker.

any suggestions?

NorsemanLicensing avatar Sep 27 '24 15:09 NorsemanLicensing

Hello,

To run the command in your GLPI docker container, you can use the following:

docker exec <YOUR GLPI CONTAINER> 'php bin/console database:enable_timezones'

DiouxX avatar Oct 08 '24 18:10 DiouxX

I'm new to glpi and docker. Have everything up and running using portainer to create compose. Tried above command but getting error that file does not exist. im guessing it's not in standard volume. Any tips or suggestions on how to find right place to run command?

graanto avatar Feb 19 '25 21:02 graanto

The bin folder is in the glpi folder. By default, the location is /var/www/html/glpi.

Maybe you need to set the full path to execute the command

docker exec <YOUR GLPI CONTAINER> '/var/www/html/glpi/bin/console database:enable_timezones'

DiouxX avatar Feb 20 '25 15:02 DiouxX

@DiouxX: the Problem, at least for me, is that the Container crashes immediately when encountering the Error (running with Podman 5.5.2 on Fedora 42 AMD64):

Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_plugins ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/files/_rss...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_rss ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/files/_sessions...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_sessions ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/files/_tmp...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_tmp ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/files/_uploads...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_uploads ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/files/_inventories...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/files/_inventories ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/www/glpi/marketplace ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Creating /var/glpi/logs...
Aug 14 22:12:20 HOST glpi-server[1616197]: Setting /var/glpi/logs ACLs...
Aug 14 22:12:20 HOST glpi-server[1616197]: GLPI is not installed. but auto-install is enabled. Starting installation.
Aug 14 22:12:20 HOST glpi-server[1616197]: Please wait until you see the greeting, this may take a minute...
Aug 14 22:12:21 HOST glpi-server[1616197]: [2025-08-14 20:12:21] glpiphplog.WARNING: Test logger  
Aug 14 22:12:21 HOST glpi-server[1616197]: Timezones usage cannot be activated due to following errors:
Aug 14 22:12:21 HOST glpi-server[1616197]:  - Access to timezone database (mysql) is not allowed.
Aug 14 22:12:21 HOST glpi-server[1616197]: Fix them and run the "php bin/console database:enable_timezones" command to enable timezones.
Aug 14 22:12:21 HOST podman[1616379]: 2025-08-14 22:12:21.50357245 +0200 CEST m=+0.038198448 container died 1a751232dd7b56fc938c329dd8a5a29f20fa35fa319d1499e0891f79d979a452 (image>
Aug 14 22:12:21 HOST podman[1616379]: 2025-08-14 22:12:21.665251084 +0200 CEST m=+0.199877084 container remove 1a751232dd7b56fc938c329dd8a5a29f20fa35fa319d1499e0891f79d979a452 (im>
Aug 14 22:12:21 HOST podman[1616379]: 2025-08-14 22:12:21.676624208 +0200 CEST m=+0.211250209 volume remove f3231c186c218fad6decbaa949eb73756b4f8027688244eb6ba370fa35e55dd5
Aug 14 22:12:21 HOST systemd[1127]: glpi-server.service: Main process exited, code=exited, status=6/NOTCONFIGURED
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ An ExecStart= process belonging to unit UNIT has exited.
░░ 
░░ The process' exit code is 'exited' and its exit status is 6.
Aug 14 22:12:21 HOST systemd[1127]: glpi-server.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Aug 14 22:12:21 HOST systemd[1127]: glpi-server.service: Consumed 1.637s CPU time, 78.6M memory peak.
░░ Subject: Resources consumed by unit runtime
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░ 
░░ The unit UNIT completed and consumed the indicated resources.
podman@HOST:~/containers/quadlets/glpi$ podman exec -it glpi-server /bin/bash
Error: no container with name or ID "glpi-server" found: no such container

I think I'm actually using the "Official" Image (glpi/glpi:latest) and not yours, but I guess they behave in a similar Way.

So I'm not quite sure how I'm supposed to run the Command, when the Container is up for less than a Fraction of a Second:

podman@HOST:~/containers/quadlets/glpi$ podman exec -it glpi-server /bin/bash
Error: no container with name or ID "glpi-server" found: no such container

luckylinux avatar Aug 14 '25 20:08 luckylinux