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

Wrong timezone / timezone can not be set #5

Closed
atetzner opened this issue Jun 5, 2018 · 3 comments
Closed

Wrong timezone / timezone can not be set #5

atetzner opened this issue Jun 5, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@atetzner
Copy link

atetzner commented Jun 5, 2018

Bug description

When executing erichough/kodi:latest, the time displayed in the upper right corner of Kodi is always UTC. In the Kodi settings, it is not possible to change the timezone to the correct values, as the options for this are disabled and can not be changed. The time is in UTC despite the fact, that the correct timezone is set in the container.

Steps to reproduce

  • Set the timezone of your computer to something else than UTC. In my case Europe/Berlin
  • Start kodi: x11docker --hostdisplay --pulseaudio --wm none --gpu --homedir /some/dir/kodi-home -- erichough/kodi:latest
  • In Kodi, the time displayed in the upper right corner is wrong (in my case, it is minus two hours)
  • Open a new terminal while Kodi is running and execute docker exec -ti $(docker ps | grep erichough/kodi | awk '{ print $1 }') date to get the time in the container. The time displayed there is the same than the host machine's time

What I did to isolate the issue

Compare to local Kodi installation

I installed Kodi on a fresh Ubuntu bionic installation (outside of a docker container): The time displayed there is correct. Additionally, the timezone settings are not disabled and may be changed.

See attached screenshots of the dockerized Kodi and a native bionic installation:

  • Displayed time differs by 2h
  • Timezone settings are editable in native installation and disabled in container

kodi_docker
kodi_virtualbox

Explicitely set the timezone in container

I started the docker container with "-v /etc/timezone:/etc/timezone:ro" "-e TZ=$(cat /etc/timezone)" to both mount /etc/timezone of the host computer and set the TZ environment variable - which should both set the correct timezone. This didn't change anything.

Compare to working container

I cloned the repo and reverted back to commit 367f174. I then built the container from this commit and found, that Kodi displayed the correct time. Simply changing FROM ubuntu:xenial to FROM ubuntu:bionic caused the error to appear causing the time to be wrong.

@ehough ehough added the bug Something isn't working label Jun 5, 2018
@ehough
Copy link
Owner

ehough commented Jun 5, 2018

Thanks for this report!

Funny thing - last week I noticed the same thing on my Kodi installation and forgot all about it until now. So I can confirm that it's not just you that's experiencing this bug.

Simply changing FROM ubuntu:xenial to FROM ubuntu:bionic caused the error to appear causing the time to be wrong.

That's a huge clue, thanks. I'll investigate and report back here once I have a solution. Stand by..

@ehough
Copy link
Owner

ehough commented Jun 5, 2018

tl;dr add -v /usr/share/zoneinfo:/usr/share/zoneinfo:ro to your command.

I looked through the Kodi source code and found that it relies on the /usr/share/zoneinfo directory, which is not present in the container. Bind-mounting it into the Kodi container enables the Timezone country (Zeitzonen-Region for the Deutchlanders 😉). Once a country is selected, the Timezone (Zeitzonen) dropdown is enabled.

I'm going to open an issue with x11docker to get his thoughts on this.

@atetzner
Copy link
Author

atetzner commented Jun 6, 2018

@ehough : Thanks for this fast solution!

I can confirm, that adding -v /usr/share/zoneinfo:/usr/share/zoneinfo:ro to the x11docker commandline both makes kodi display the correct timezone and also makes the timezone settings in kodi editable.

@ehough ehough closed this as completed in f1ef05f Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants