-
Notifications
You must be signed in to change notification settings - Fork 284
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 again #4526
Comments
I am also noticing a clock drift when I sleep my host windows machine. I just checked the registry and I am not setting my hardware clock to UTC (I am missing the "RealTimeIsUniversal" key referenced in this post: https://superuser.com/questions/975717/does-windows-10-support-utc-as-bios-time). I noticed this problem after upgrading to Docker Desktop Version: 2.1.1.0. The mitigation so far is to restart docker desktop post-wake. |
If you get fed up of restarting Docker Desktop it's a bit quicker to go into Hyper-V Manager, go to the settings of the docker desktop VM, and un-check and re-check the "Time synchronization" setting under "Integration Services". Fingers crossed for a quick resolution to this one! :-) |
Thanks for the reports. The recent release upgraded the Linux kernel and the Hyper-V time sync strategy is (unfortunately!) different there. We now run a |
Any news on when a docker desktop update will appear that fixes this? Should we revert to an earlier version? |
When this happens, the Time Synchronization integration service in Hyper-V gets into a "Lost Communication" state. For those who don't want to check/uncheck the Time Synchronization service every time, running these two commands is the equivalent of that:
I saved that off in a Powershell script and configured a task in Task Scheduler to run that script on system resume. I tested parts of it, but I'm not 100% sure it'll fix the issue. |
I am experiencing this issue as well. I did check to make sure I have the Time Synchronization box checked in hyper-v. For me this manifests itself when building containers using apt-get, the apt-get instructions fail:
This is from a Python image, see the Dockerfile here. |
Ive got repro of this issue with: Steps to reproduce:
Ive checked and the Time Synchronization for DockerDesktopVM is Enabled with Ok status |
This is happening to me with:
I noted it after the PC was on sleep mode as well. |
also have this problem, make life hard with mage usage inside the container. |
Also seeing this after upgrade to version 2.2.0.0 - containers report totally wrong system times after a while. Didn't see this behaviour in previous versions. |
Hacky workaround/fix that extends off #4526 (comment) is to run that on every resume/wake. https://sumtips.com/how-to/run-program-windows-wakes-up-sleep-hibernate/ Resyncs the host:docker clocks every time you open the lid of the laptop. |
Based on #4526 (comment) this gist sync_docker_time.ps1 requests elevated priviliges and synchronizes the time. |
2.2.0.3, the clock resumes after sleep were it left off, no sync. |
I have to toggle the Time Synchronization option every day when I start working or my AWS tools refuse to use my new credentials. |
I have the same issue. I was going crazy because I couldn't understand why my Keycloak server (running in a container) was sending me back expired tokens.
|
In release note: |
It's nice that they acknowledge it, but when will it be fixed? This affects me and many others on a daily basis. |
This will be fixed in the next release, we’re not sure yet when but we’re hoping it will be a matter of days. |
Thanks for that, but is that actually a link to a stable 2.2.0.4 RC build? I assume that's what you meant? |
Indeed, sorry about that, I’ll fix my comment! |
@SiliconKid I've run the suggested installer and it failed to update my current installation:
Check the installation, please. |
I installed the 2.2.0.4 RC, rebooted my windows 10. I am using the wsl2 integration. I put the computer on sleep mode couple of times in the recent days and when working today I see a gaps between the wsl date UTC time on the local computer and the one in the container resuming from sleep. Note starting a new container also shows the wrong date. The date from the left is from the wsl on the local machine and is correct. the one from the right are from containers |
Saw it again this morning on 2.3.0.2 (45183) stable. |
Maybe this is related to microsoft/WSL#4245 |
@sebastianhaberey are you running the wsl2 or hyper-v backend? |
@simonferquel hyper-v (my Windows 10 build is too low for WSL-2) |
Then @djs55 I think we still have work to do on this subject :/ |
I'm afraid I started seeing this issue again too with 2.3.0.2 and 2.3.0.3 on Hyper-V. This was resolved for me since @djs55's early patch (based on 2.2.0.4) from mid-March and all subsequent releases. The only changes in my environment recently were Windows updates (currently on 1909, build 18363.836) and the various Docker Desktop releases (currently on 2.3.0.3 stable). |
Hi, I've got another experimental build based on Edge which aims to fix clock sync problems with Hyper-V: https://desktop-stage.docker.com/win/edge/46615/Docker%20Desktop%20Installer.exe . This new build runs a custom NTP server on the host and connects to it from the VM, rather than trying to use the kernel support (which seems flakey). This is the same approach we use on Mac. If anyone has a chance to try it, let me know how it goes! |
Downloading it now. Will post here if I encounter time-related issues. |
Using this version on the windows dev branch Build 20161
- very fast (as it was for me 6 month ago)
- no more time drift when resuming from sleep mode
Well done!!!!
…On Thu, 16 Jul 2020 at 15:12, Sebastian Haberey ***@***.***> wrote:
Downloading it now. Will post here if I encounter time-related issues.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4526 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABD4AEHITA2U7K6NXMUN76TR32R7BANCNFSM4ILYSI4Q>
.
|
Ok this is probably totally unrelated but the whole company is complaining about their system clocks being off, starting yesterday. 😅 |
I used https://desktop-stage.docker.com/win/edge/46615/Docker%20Desktop%20Installer.exe which runs a custom NTP server on the host and connects to it from the VM, rather than trying to use the kernel support (which seems flakey). |
Am running:
Restarting Docker for Windows doesn't fix the issue. Is there another workaround? |
If you have wsl2 integration enabled, open wsl bash and type |
For Hyper-V mode + Linux containers (not WSL 2 and not Windows containers) the latest fixes have been released in 2.4.0.0 stable. If there are still problems with Hyper-V mode + Linux containers, let me know! Problems with timekeeping in WSL 2 should be reported to Microsoft here: https://github.com/Microsoft/WSL Problems with timekeeping in Windows containers should probably be reported here: https://github.com/moby/moby (and would probably refer to the Windows hcsshim) |
Thanks for your patience with this issue! 🎉 |
Are you sure Alpine reflects the timezone? Maybe it's just pinned to UTC. |
@stephen-turner It seems to be setting the right time of the host's time zone but it does not show the offset. If I change to UTC+1 it brings the time forward one hour in the container but there is still an hour difference between the container and the host due to daylight saving. |
I don't see anything wrong here. I set my timezone to US Eastern and got this:
This is normal. It is expected that the timezone isn't passed into the container. |
As the main issue in this ticket was fixed in the 2.4 release, I'm going to close the ticket. |
Closed issues are locked after 30 days of inactivity. 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. |
Expected behavior
Time remains correct relative to host. This has been discussed already in #72
Actual behavior
During sleep, Docker Hyper-V VM slowly drifts out of sync with host time.
Information
The problem appears to be a re-emergence of #72. Another individual posted a similar comment at the end of #72. It appears to happen reliably during sleep. It only ends up being important when things happen that require time to be coherent with the real world. For example, this can mess up
apt update
.Steps to reproduce the behavior
You can check time on the Docker VM like:
You can get UTC on Windows PowerShell like:
There is a small chance that this is affected by setting the Windows hardware clock to UTC (which I suspect many Docker users do - since it makes dual-booting linux easier)[per @echadwickb's comment below]The text was updated successfully, but these errors were encountered: