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

Warning unable to load '/usr/share/zoneinfo/*' as time zone. Skipping it. #229

Closed
ghost opened this issue Oct 26, 2016 · 12 comments
Closed

Comments

@ghost
Copy link

ghost commented Oct 26, 2016

I'm running the following docker configuration:

devmysql:
image: mysql
hostname: mysql
environment:
    - MYSQL_ROOT_PASSWORD=super_secret_password
    - MYSQL_DATABASE=db_user
    ports:
    - "127.0.0.1:3306:3306"

And i'm getting the following warning messages:

Warning: Unable to load '/usr/share/zoneinfo/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/posix/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/right/Factory' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.

Is there a way to do load the timezone information without showing these warnings?

@strarsis
Copy link

strarsis commented Dec 2, 2016

Apparently this can be fixed by installing the tzdata package:

FROM mariadb:10.1

RUN apt-get update \
 && apt-get install --no-install-recommends -y tzdata \
 && apt-get clean \
 && rm -r /var/lib/apt/lists/*

Using an image with this modification instead
results in the warning not being logged anymore.

However, because proper timezone handling may be important,
it may be useful to install this package in the official image.

@AndyBowes
Copy link

I have encountered the same issue when attempting to set the MySQL timezone as UTC on our image.

  • timezone=+0:00
  • default-time-zone=+0:00

Is this issue likely to be fixed for a 5.7 image as I'd rather not create & extend our own mysql docker image. Other that the slight increase in the image size, is there any other reason not to install tzdata as part of the standard image?

@tianon
Copy link
Member

tianon commented Nov 8, 2017

The tzdata package is already included in the images -- the warnings described in the OP are harmless (and simply refer to files that aren't timezones that MySQL is thus appropriately ignoring):

$ docker pull mysql:5.7
5.7: Pulling from library/mysql
Digest: sha256:1a2f9361228e9b10b4c77a651b460828514845dc7ac51735b919c2c4aec864b7
Status: Image is up to date for mysql:5.7

$ docker run --rm mysql:5.7 dpkg -l | grep tzdata
ii  tzdata                    2017b-0+deb8u1           all          time zone and daylight-saving time data

Is there actual harm being caused by these warnings? A simple reproducer for issues with MySQL using timezones properly would be appreciated for digging further.

@tianon
Copy link
Member

tianon commented Dec 26, 2017

Closing given lack of additional information for reproduction.

@boay24
Copy link

boay24 commented Mar 14, 2020

2020 i confirmed this problem still persists.
image

@tianon
Copy link
Member

tianon commented Mar 14, 2020

Is there actual harm being caused by these warnings?

@someonewithpc
Copy link

@tianon I think so:

MariaDB [(none)]> select convert_tz(now(), 'UTC', 'CET');
+---------------------------------+
| convert_tz(now(), 'UTC', 'CET') |
+---------------------------------+
| NULL                            |
+---------------------------------+

This seems to suggest that all timezone related operations are broken.

@tianon
Copy link
Member

tianon commented Apr 27, 2020

@someonewithpc I think the underlying cause of your issue is not these warnings:

$ docker pull mariadb:10.4
10.4: Pulling from library/mariadb
Digest: sha256:379f3689cfcd53fd561c1aa2aea0a336a2362c9d31306528228321344a9cf979
Status: Image is up to date for mariadb:10.4
docker.io/library/mariadb:10.4

$ docker run -dit -e MYSQL_ROOT_PASSWORD=example --name test mariadb:10.4
bf0814561d25bbd45704b89a704dc370a8be5eecd45998d30d7e42260d4cd73d

$ docker logs test | grep -i zone
Warning: Unable to load '/usr/share/zoneinfo/leap-seconds.list' as time zone. Skipping it.

$ docker logs --tail=2 test
2020-04-27 20:46:45 0 [Note] mysqld: ready for connections.
Version: '10.4.12-MariaDB-1:10.4.12+maria~bionic'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution

$ docker exec -i test mysql -uroot -pexample <<<'select convert_tz(now(), "UTC", "CET")'
convert_tz(now(), "UTC", "CET")
2020-04-27 22:47:57

@someonewithpc
Copy link

@tianon Hm, yeah, your steps work for me too. Sorry for the false alarm. It seems I had an error in an entrypoint script.

However, with docker-compose, even though I specify MYSQL_ROOT_PASSWORD=foobar in the environment, I still get the prompt saying I need to add a password to the root user. It's just a mild annoyance, much like this, it seems, though.

@ctrlbrk42
Copy link

I use this code on several docker build files, and it works well for me:

ENV DEBIAN_FRONTEND=noninteractive
RUN echo "US/Eastern" | tee /etc/timezone && \
    dpkg-reconfigure tzdata && \
    cp /usr/share/zoneinfo/US/Eastern /etc/localtime

I can confirm that at least with the mariadb:10.4 tag, tzdata is already pre-installed and just reconfiguring it like the above will solve the problem and eliminate the warning message.

@daryong
Copy link

daryong commented Jun 16, 2020

Thank you. Works fine for me.

Dockerfile

FROM mariadb:10.5.3

RUN echo "Asia/Seoul" > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata

@pratikgoud123

This comment was marked as off-topic.

@docker-library docker-library locked as resolved and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants