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 · 52 comments
Closed

Wrong Date/Time #72

devlife opened this issue Sep 6, 2016 · 52 comments

Comments

@devlife
Copy link

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
Copy link
Contributor

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
Copy link

This is happening to me as well, since last update

@cvillerm
Copy link

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

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
Copy link

Any update/priority on this issue?

@dgageot
Copy link
Member

dgageot commented Nov 21, 2016

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

@dgageot
Copy link
Member

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!

@jimjam-slam
Copy link

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
Copy link

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.

@LiamRoels
Copy link

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...

@twodrops
Copy link

Is this issue still tracked somewhere else? The issue is reproducible with Docker Edge Version 2.1.7.0.
The clock drift happens after windows goes to sleep

@SiobhanBaynes
Copy link

I'm also seeing this on V19.03.5. This doesn't appear to be fixed.

@motish1111
Copy link

Having the same problem. V19. Please Help

@ftrauernicht
Copy link

I also have this Problem on docker V.19.0.3.5. Its very annoying to restart the service every morning :/

@borgez
Copy link

borgez commented Jan 9, 2020

I also have this Problem

@aron-truvian
Copy link

Note: This issue still exists, and will cause certificate failures in a docker image when trying to do a dotnet restore.

See: Dotnet Restore SSL Error

@TomasEkeli
Copy link

I'm seeing this on Windows 10 running Docker version 19.03.2, build 6a30dfc

It stops an apt-get update on build as it thinks some security-updates are from the future. I'm currently over 16hours off.

@ahernandez-allegion
Copy link

Same issue with Docker 19.03.5 on Windows but running Linux VMs on Windows Subsystem for Linux (WSL). Restarting Docker fixes the issue.

@truman303
Copy link

Hi. Same issue running Docker Desktop Community 19.03.5 pn Windows 10. Using windows containers with microsoft/iis base image. Restarting Docker Desktop doesn't seem to help. Recreating the image doesn't seem to help either.

@MateusAmin
Copy link

Time slip of 4 minutes after bringing the host up from sleep. Diagnostics ID:

1CE0BF2A-0D0C-4EA2-BECE-8C51FE289A95/20200123010621

@kamko
Copy link

kamko commented Jan 23, 2020

Definitely not fixed. Should we open a new issue?

@ftrauernicht
Copy link

Hi. Same issue running Docker Desktop Community 19.03.5 pn Windows 10. Using windows containers with microsoft/iis base image. Restarting Docker Desktop doesn't seem to help. Recreating the image doesn't seem to help either.

I also have this some times, I try to restart the service and sometimes it get fixed but not always.. In such cases i get a new error called "Error getting userland proxy(...)". As soon as I get this the only solution seems to be restarting the whole pc :/

@jimjam-slam
Copy link

@ftrauernicht There's a new issue at #4526 :)

@philippe-granet
Copy link

In release note:
https://docs.docker.com/docker-for-windows/release-notes/#docker-desktop-community-2203
Known issues:
In some cases, Docker containers do not synchronize time with the host when the host machine is put to sleep.

@lucaalex87
Copy link

Known issue means it's fixed, or if we know about it, we can just forget it? 😃

@davclark
Copy link

@lucaalex87 as of 3 days ago, there's an installer linked here that appears to fix the issue. Still not stable / release, but a fix if you need it:

#4526

@lucaalex87
Copy link

@davclark Thank you for this comment - I'll give it a try! :) I wasn't aware of the other issue number.

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests