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 Date/Time #72

Closed
devlife opened this issue Sep 6, 2016 · 34 comments
Closed

Wrong Date/Time #72

devlife opened this issue Sep 6, 2016 · 34 comments

Comments

@devlife
Copy link

@devlife devlife commented Sep 6, 2016

Expected behavior

I would expect the container date and time would match host date and time

Actual behavior

The container is a day+ behind my windows host

Information

Steps to reproduce the behavior

  1. docker run... for ubuntu:latest
  2. date from within the container
  3. Note that the date/time is different than your windows host
@rn

This comment has been minimized.

Copy link
Contributor

@rn rn commented Sep 6, 2016

@devlife thanks for the report. We use the in kernel Hyper-V time synchronisation and it should work, but may only gradually adjust time. A couple of questions:

  • did this happen after your computer was set to sleep?
  • did you check the time soon after waking up after sleep?
  • did the gap get less over time?
@antoniocanas

This comment has been minimized.

Copy link

@antoniocanas antoniocanas commented Sep 9, 2016

This is happening to me as well, since last update

@cvillerm

This comment has been minimized.

Copy link

@cvillerm cvillerm commented Sep 9, 2016

Same problem happening to me. The clock drift corresponded exactly to the time my laptop was in sleep mode. I didn't realize it immediately, but I started to see wrong behaviors in my Docker applications (ELK stack reporting logs with a time difference) just after resuming.

@devlife

This comment has been minimized.

Copy link
Author

@devlife devlife commented Sep 9, 2016

@rneugeba My computer was not set to sleep. I'll set my computer to sleep and check the time and see if the gap has lessened.

@cvillerm

This comment has been minimized.

Copy link

@cvillerm cvillerm commented Sep 9, 2016

Disabling and then enabling again the MobyLinuxVM > Settings > Integration Services > Time synchronization service from Hyper-V Manager resyncs the clock of containers immediately.

@Matthias247

This comment has been minimized.

Copy link

@Matthias247 Matthias247 commented Sep 28, 2016

Unfortunately I have issues with this as well. I'm using docker for windows mainly as some build/cross-compilation tool, by running a build scripts inside linux containers. This problems e.g. leads to automake failing:

checking whether build environment is sane... configure: error: newly created file is older than distributed files!

Always happens if the PC is going to sleep (e.g. during lunch time). Does not recover until I manually restart docker, so I think it's not really syncing during runtime but only at startup.
The workaround from @cvillerm helps to recover without a docker restart.

@rlpowell

This comment has been minimized.

Copy link

@rlpowell rlpowell commented Sep 29, 2016

My symptom was that on every change vim would say "WARNING File has changed since last read!". Took me ages to figure out it was a time problem.

This was not happening 2 or 3 updates ago, even with regular laptop sleep/hibernation.

@schwamster

This comment has been minimized.

Copy link

@schwamster schwamster commented Oct 5, 2016

also ran into that problem while running terraform within a container to create an infrastructure on azure.
creating a storage account failed with an authorization problem. cvillerms Tipp helped

@cfstras

This comment has been minimized.

Copy link

@cfstras cfstras commented Oct 18, 2016

For me, resuming from hibernate leaves the docker clock at the same time it was hibernated at. Restarting docker fixes the timestamp, but also means restarting containers...

@entzik

This comment has been minimized.

Copy link

@entzik entzik commented Oct 20, 2016

same issue here, exactly as reported by @cfstras . Annoying thing for me is one of the containers is running keycloak and after the laptop sleeps, it issues OIDC certificates with an outdated timstamp so all my authentication chain is broken.

I would rather have docker stop all my containers after a sleep, at least I would know I have to restart everything.

@rcarmo

This comment has been minimized.

Copy link

@rcarmo rcarmo commented Oct 24, 2016

Add me to the list. Using make inside Moby with time drift is impossible, so much so that I've resorted to building my containers on a remote box instead.

@zifik

This comment has been minimized.

Copy link

@zifik zifik commented Oct 25, 2016

@rneugeba

  • did this happen after your computer was set to sleep? Yes
  • did you check the time soon after waking up after sleep? Yes, correction is either not happening or not happening quickly enough. -- Needs to be immediate
  • did the gap get less over time? Not sure, will look into this aspect

Using Docker GUI to Restart Docker appears fix it immediately every time. Though there has got to be a more elegant solution.

@provegard

This comment has been minimized.

Copy link

@provegard provegard commented Nov 15, 2016

Any update/priority on this issue?

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Nov 21, 2016

Hi everyone, a fix should ship in the next Beta version (Beta31), scheduled next week.

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Dec 1, 2016

@devlife @cvillerm @Matthias247 @cfstras @provegard @zifik @rcarmo Beta 31 was just released. It's expected to fix this issue. Please give it a try!

@Matthias247

This comment has been minimized.

Copy link

@Matthias247 Matthias247 commented Dec 1, 2016

@dgageot Thanks for working on it. Just tested with beta31 but still experience the same problem after PC went to sleep after the amount of time that was set in the windows power options (power plan) settings.

@rlpowell

This comment has been minimized.

Copy link

@rlpowell rlpowell commented Dec 1, 2016

Same here:

rlpowell@680e70564cca> date
Thu Dec 1 01:22:37 PST 2016
rlpowell@680e70564cca> date
Thu Dec 1 08:48:11 PST 2016

I'll note that the list of integration services looks different; "Data Exchange" and "Backup" are now unchecked. Maybe your code is toggling the wrong thing depending on versions of hyper-v, or something like that?

@rlpowell

This comment has been minimized.

Copy link

@rlpowell rlpowell commented Dec 2, 2016

Oh, for the record: this is with a fresh docker VM after a reboot.

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Dec 2, 2016

@Matthias247 @cfstras @rlpowell I'm working on a fix. A good way to test it would be for you to contact by at david dot gageot at docker.com. I'll send you a pre-release version for you to test.

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Dec 8, 2016

Hi @Matthias247 @cfstras @rlpowell have you tried to install Beta32?

@Matthias247

This comment has been minimized.

Copy link

@Matthias247 Matthias247 commented Dec 9, 2016

@dgageot I could test it only very briefly since I'm working on something different at the moment. But apperently it works now. After an hour of standby I can still build the stuff without automake complaining about wrong time.
Thanks for fixing it!

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Dec 9, 2016

@Matthias247 Good to hear!

@cfstras

This comment has been minimized.

Copy link

@cfstras cfstras commented Dec 12, 2016

@dgageot I immediately got problems because I had deactivated Hyper-V to do a clean install -- and saw you pushed a hotfix because the installer did not remind me I still had it disabled :)

Since then, docker has been working like a charm for me! Thanks for all your efforts!

@dgageot

This comment has been minimized.

Copy link

@dgageot dgageot commented Dec 12, 2016

@cfstras Good to hear, I'm going to close the issue then!

@krab-skunk

This comment has been minimized.

Copy link

@krab-skunk krab-skunk commented Feb 16, 2017

This error remains on Mac OS with latest beta docker version

Client:
Version: 1.13.1-rc1
API version: 1.25
Go version: go1.7.4
Git commit: 2527cfc
Built: Sat Jan 28 00:43:00 2017
OS/Arch: darwin/amd64

Server:
Version: 1.13.1-rc1
API version: 1.25 (minimum version 1.12)
Go version: go1.7.4
Git commit: 2527cfc
Built: Sat Jan 28 00:43:00 2017
OS/Arch: linux/amd64
Experimental: true

@rn

This comment has been minimized.

Copy link
Contributor

@rn rn commented Feb 16, 2017

@steve-heslouin this is already tracked here docker/for-mac#1260

@aron-truvian

This comment has been minimized.

Copy link

@aron-truvian aron-truvian commented Aug 13, 2019

Is this actually resolved? I am experiencing this currently on my docker desktop for windows (v2.1.0.1)

If my computer has been put to sleep, and then awakens, my docker containers are all out of sync with my host's time. This continues until I restart docker.

@davclark

This comment has been minimized.

Copy link

@davclark davclark commented Aug 13, 2019

I can confirm that this has re-emerged as a bug - also running Docker on Windows, Edge, v2.1.1.0

Maybe this is due to WSL2-related changes? I'm experiencing the issue with Hyper-V / Moby.

@rensa

This comment has been minimized.

Copy link

@rensa rensa commented Oct 3, 2019

I'm also experiencing this issue. I'm experimenting with leaving the Time Synchronisation service off and getting my containers syncing with something like ntp themselves.

@giggio

This comment has been minimized.

Copy link

@giggio giggio commented Nov 6, 2019

This issue is still ocurring on the latest version:

▶ docker version
Client: Docker Engine - Community
 Version:           19.03.4
 API version:       1.40
 Go version:        go1.12.10
 Git commit:        9013bf5
 Built:             Thu Oct 17 23:44:48 2019
 OS/Arch:           windows/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.4
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.10
  Git commit:       9013bf5
  Built:            Thu Oct 17 23:50:38 2019
  OS/Arch:          linux/amd64
  Experimental:     true
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

Are there any plans to actually fix this? The problem happened after the PC hibernated.

The solution to disable and reenable time synchronization on HyperV works, but we shouldn't have to do this manually.

@LiamRoelsWA

This comment has been minimized.

Copy link

@LiamRoelsWA LiamRoelsWA commented Nov 13, 2019

I have the exact same issue and it messes up all sorts of things. I usually fix it by restarting docker but there really should be a better fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.