jgeusebroek / docker-spotweb

A docker image running ubuntu/20.04 Linux and Spotweb
47 stars 27 forks source link

Invalid date.timezone value 'EuropeAmsterdam' #25

Closed RLinden22 closed 3 years ago

RLinden22 commented 3 years ago

Created a container with the latest build, after completing the install, this message is displayed: "Warning: strftime(): Invalid date.timezone value 'EuropeAmsterdam', we selected the timezone 'UTC' for now. in /var/www/spotweb/lib/SpotTemplateHelper.php on line 1058", in the list of spots. Tried to start the container with "TZ = Europe\Amsterdam" but error still appears. image

jgeusebroek commented 3 years ago

Hi, it's / not .

RLinden22 commented 3 years ago

I get also these warnings when the container is started without TZ variable specified. How to disable this warning? 2020-12-01_12h42_35

jgeusebroek commented 3 years ago

I cannot replicate this. The default is Europe/Amsterdam. Are you sure this is a new spotweb instance?

root@faf73eb58cb7:/# php -i | grep timezone
Default timezone => Europe/Amsterdam
date.timezone => Europe/Amsterdam => Europe/Amsterdam
RLinden22 commented 3 years ago

When I run this, I get: 2020-12-02_09h26_30 php.ini: 2020-12-02_09h28_09 Container is created yesterday and is started without TZ variable.

jgeusebroek commented 3 years ago

That's very, very strange. Can you run docker inspect spotweb | grep TZ and paste the output here?

RLinden22 commented 3 years ago

2020-12-02_13h11_10

jgeusebroek commented 3 years ago

Ok, and what does docker exec -ti Spotweb cat /etc/php/7.4/cli/php.ini | grep timezone output?

This should output:

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = Europe/Amsterdam
RLinden22 commented 3 years ago

Here is the output: 2020-12-03_08h09_33. Here is also the date output from PHPinfo: 2020-12-03_08h28_15 and the main 2020-12-03_08h30_10 and the output with the php.ini mentioned in the phpinfo: 2020-12-03_08h32_42

jgeusebroek commented 3 years ago

I can't think of a reason, I can't replicate this issue. Can you remove the container docker rm -f Spotweb and recreate?

proddy commented 3 years ago

just to chime in...I'm not seeing the error. I do have a TZ environment variable set to Europe/Amsterdam and in docker compose entry looks like:

  spotweb:
    image: jgeusebroek/spotweb:latest
    container_name: spotweb
    hostname: spotweb
    security_opt:
      - no-new-privileges:true
    volumes:
      - ${USERDIR}/docker/spotweb:/config
    ports:
      - 8082:80
    restart: always
    environment:
      - SPOTWEB_DB_TYPE=pdo_mysql
      - SPOTWEB_DB_HOST=mariadb
      - SPOTWEB_DB_NAME=spotweb
      - SPOTWEB_DB_USER=spotweb
      - SPOTWEB_DB_PASS=spotweb
      - SPOTWEB_CRON_RETRIEVE=*/30 * * * *
      - SPOTWEB_CRON_CACHE_CHECK=10 */1 * * *
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}

thanks for the great image Jeroen!

RLinden22 commented 3 years ago

Deleted the container, deleted the image. Downloaded the image, created the container (without TZ variable). Started the container and I have no Timezone warning.... Thanks for the support and keep up the good work for this image !.

Can't explain the behavior with the first container, was created the same way....

jgeusebroek commented 3 years ago

Thanks @proddy! and glad it's fixed now @RLinden22. I suspect the first container wasn't actually removed. And the \ / mixup caused the initial problem.

Have a nice day!