You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your Windows build number: (Type ver at a Windows Command Prompt)
Version 1903 Build 19018.1
What you're doing and what's happening: Clock way off.
What's wrong / what should be happening instead: Clock should be in sync with the host.
Windows taskbar clock says 5:22pm
WSL Linux (Ubuntu) date: says 05:09:23 PST
The clock appears to be about 12 hours 13 minutes off? I don't see any obvious ways to resolve this as ntpdate is not installed by default, there's no systemd-style init process that would run ntpd/etc.
The net impact is that time-sensitive things like credential or request signing will all appear expired by the receiver because my requests are signed "12 hours ago" ;)
Thoughts?
Reacted by Aaron Walker, Mark Penner, Dmitry Sazonov, Nic Holthaus, Auke Roorda, Heath Stewart, Hassaan Ahmed, Igor Rendulic, Youda008, Pranav Bolar and 6 more
% date
Wed Nov 13 08:31:08 PST 2019
% exit
PS C:\Users\whack> wsl --shutdown
PS C:\Users\whack> wsl
% date
Wed Nov 13 20:44:00 PST 2019
Reacted by Fabio Pintos, Mike Christiansen, ognjenkurtic, Ajay Shyam, MrMoshkovitz, Erin, anna-guinet, Nguyen Van Thanh, Liu Jialong, Mickael and 1 more
Fair to say we're calling this different than #4245 (message)? Asking because the other one is tag fixininsiders, and I've lost the script on what was (contrast wasn't) addressed in 18970.
This is running the debian distro which supposedly has a hwclock.sh service running, but doesn't seem to sync. Running sudo hwclock -s manually does sync the time, so maybe it's a distro problem?
Just updated to Windows 10 build 19041.21 to start to use WSL-2
I am getting a warning on WSL-2 when building a C++ project on a NTFS drive from withing WSL-2:
make[2]: Warning: File 'samples/convert.cpp/CMakeFiles/convert-cpp.dir/depend.make' has modification time 0.022 s in the future
make[2]: warning: Clock skew detected. Your build may be incomplete.
WSL-1 has never reported these warnings on the same configuration.
Windows 10 build 19041.153 attempting to use WSL2, files are on Windows file system (not rootfs):
-- Build files have been written to: /mnt/e/projects/misc/wsl-ssh-agent/release
make: Warning: File 'Makefile' has modification time 0.6 s in the future
make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.65 s in the future
make[2]: Warning: File 'CMakeFiles/bin_agent.dir/progress.make' has modification time 0.61 s in the future
Scanning dependencies of target bin_agent
make[2]: warning: Clock skew detected. Your build may be incomplete.
make[2]: Warning: File 'CMakeFiles/bin_agent.dir/progress.make' has modification time 0.51 s in the future
[100%] Building wsl-ssh-agent-gui...
make[2]: warning: Clock skew detected. Your build may be incomplete.
[100%] Built target bin_agent
make[1]: warning: Clock skew detected. Your build may be incomplete.
That seems to be an Hyper-V issue instead of an WSL one.
I have had issues with time on Hyper-V instances ever since. Any time I wake up my machine from sleep I have to manually run ntpdate to get the proper time. I tried setting up the ntp service, but that didn't seem to work at all (might have been my fault, but I used the default configuration and got no errors and no time synchronization at all). Rebooting the instance fixes it but IIRC the hardware clock sync is performed during that.
adding that I see this issue as well. I don't see a clear pattern between shutdown vs hibernate, but occasionally clock sensitive operations will fail until I re-sync (AWS or Azure CLI for example).
Ben Hillis (@benhillis) Running sudo hwclock on WSL2 gives a drifted clock, different from NTP & Windows Time.
$ sudo hwclock && date && cmd.exe /c time
2020-10-05 23:33:43.950559+01:00
Mon 05 Oct 2020 11:33:50 PM BST
The current time is: 23:33:50.09
Enter the new time:
When I try to build with cmake I get the following warning:
Run Build Command(s):/usr/sbin/make cmTC_6952b/fast && make: Warning: File 'Makefile' has modification time 0.53 s in the future
I tried building both in the shared filesystem, i.e. /mnt/c and in my home folder in the wsl2 installation. Same issue.
Running date +%T.%N && cmd.exe /c time gives:
08:10:27.146163000
The current time is: 8:10:27,79
Running 19041.746 with Ubuntu 20.04.1 LTS and GNU Make 4.2.1
Tried all the mentioned possible fixes included in this thread including rebooting, wsl --shutdown, and the shell commands listed. The clock in W10 and Ubuntu are definitely at least to the second matched up.
Still get this error when running make. Haven't observed it with other utilities yet.
UPDATE: I was able to discern that the clock skew is about 0.43 to 0.45 seconds. I can sync windows time and try to 'make' right after, and the issue is still present.
From the latest comment (at time of writing), there is a kernel patch which
should fix this. It is being tested but is not released yet. (Per the
comment in that issue)
I ran into this today, ERROR: Clock skew detected. File /mnt/c/Users/Scott/Documents/Documents/Coding/scipy/build/meson-private/coredata.dat has a time stamp 42373.3841s in the future.
and the sudo hwclock -s command fixed it. Might have had something to do with not restarting since the daylight savings time switch?
Activity
jordansissel commentedon Nov 14, 2019
wsl --shutdownseems to be a workaround:benhillis commentedon Nov 14, 2019
You should also be able to use
sudo hwclock -sfrom within the Linux environment.therealkenc commentedon Nov 14, 2019
Fair to say we're calling this different than #4245 (message)? Asking because the other one is tag fixininsiders, and I've lost the script on what was (contrast wasn't) addressed in 18970.
benhillis commentedon Nov 14, 2019
therealkenc - Specifically large skews when resuming from sleep should be fixed, but small skews that accumulate during runtime may still be an issue.
jishi commentedon Dec 18, 2019
This is still a problem in
Microsoft Windows [Version 10.0.19037.1]The machine have been running WSL2 for some days, the clock in WSL2 is:
And in windows
This is running the debian distro which supposedly has a hwclock.sh service running, but doesn't seem to sync. Running
sudo hwclock -smanually does sync the time, so maybe it's a distro problem?vbaderks commentedon Feb 1, 2020
Just updated to Windows 10 build 19041.21 to start to use WSL-2
I am getting a warning on WSL-2 when building a C++ project on a NTFS drive from withing WSL-2:
make[2]: Warning: File 'samples/convert.cpp/CMakeFiles/convert-cpp.dir/depend.make' has modification time 0.022 s in the future
make[2]: warning: Clock skew detected. Your build may be incomplete.
WSL-1 has never reported these warnings on the same configuration.
JurrianFahner commentedon Mar 14, 2020
I need to set the time every time my laptop was in hibernate.
Can something done, so the time within WSL has an auto sync capability with the host.
Workaround for me is to use ntpdate, but I think it should not needed. To work properly.
rupor-github commentedon Mar 16, 2020
Windows 10 build 19041.153 attempting to use WSL2, files are on Windows file system (not rootfs):
firewave commentedon May 28, 2020
That seems to be an Hyper-V issue instead of an WSL one.
I have had issues with time on Hyper-V instances ever since. Any time I wake up my machine from sleep I have to manually run
ntpdateto get the proper time. I tried setting up thentpservice, but that didn't seem to work at all (might have been my fault, but I used the default configuration and got no errors and no time synchronization at all). Rebooting the instance fixes it but IIRC the hardware clock sync is performed during that.firewave commentedon Jun 4, 2020
While checking
dmesgfor my WSL 2 Kali instance I saw the following:Justin-DynamicD commentedon Jun 15, 2020
adding that I see this issue as well. I don't see a clear pattern between shutdown vs hibernate, but occasionally clock sensitive operations will fail until I re-sync (AWS or Azure CLI for example).
MauriceS-gti commentedon Jun 19, 2020
I still see this issue using Windows 10/2004 build 19041.329. HOURS of difference:
PS C:\src\cs> date
Friday, June 19, 2020 11:40:07 AM
[/workspaces]$ date [docker-native:localhost]
Thu Jun 18 21:30:29 MDT 2020
gbro3n commentedon Jul 24, 2020
To add this is causing problems when running AWS cli commands when my Windows machine running WSL2 has slept.
For example:
aws ecr get-login-password
Results in an error like
(InvalidSignatureException) when calling the GetAuthorizationToken operation: Signature expired: <DATE> is now earlier than <DATE> (<DATE> - 15 min.)
nbdd0121 commentedon Oct 5, 2020
Ben Hillis (@benhillis) Running
sudo hwclockon WSL2 gives a drifted clock, different from NTP & Windows Time.EDIT: WSL2 uptime is 5 days without sleep.
frke242 commentedon Dec 4, 2020
Microsoft Windows [Version 10.0.18363.1198]
When I try to build with cmake I get the following warning:
Run Build Command(s):/usr/sbin/make cmTC_6952b/fast && make: Warning: File 'Makefile' has modification time 0.53 s in the future
I tried building both in the shared filesystem, i.e. /mnt/c and in my home folder in the wsl2 installation. Same issue.
Running
date +%T.%N && cmd.exe /c timegives:08:10:27.146163000
The current time is: 8:10:27,79
gkochera commentedon Jan 19, 2021
Running 19041.746 with Ubuntu 20.04.1 LTS and GNU Make 4.2.1
Tried all the mentioned possible fixes included in this thread including rebooting, wsl --shutdown, and the shell commands listed. The clock in W10 and Ubuntu are definitely at least to the second matched up.
Still get this error when running make. Haven't observed it with other utilities yet.
UPDATE: I was able to discern that the clock skew is about 0.43 to 0.45 seconds. I can sync windows time and try to 'make' right after, and the issue is still present.
nbdd0121 commentedon Jan 20, 2021
I wrote a program to workaround this problem: https://github.com/nbdd0121/wsld. Assuming you don't also need X11 forwarding, you can put
[time]in
~/.wsld.toml, and follow the instructions there to setup automatic startup.It will sync time from Windows every 10 minutes, and will adjust time like NTP.
yanrez commentedon Mar 30, 2021
This is dup of #5324
therealkenc commentedon Mar 31, 2021
/dupe #5324
nbdd0121 commentedon Mar 31, 2021
I don't think this is a dupe; I've seen my clock drifting without sleep or hibernation.
jordansissel commentedon Mar 31, 2021
Animeshz commentedon May 7, 2021
Since this issue pops first from google, Issue comment 5650 here's how one can install the update 😁, this has fixed the issue for me 😄
scottshambaugh commentedon Nov 21, 2022
I ran into this today,
ERROR: Clock skew detected. File /mnt/c/Users/Scott/Documents/Documents/Coding/scipy/build/meson-private/coredata.dat has a time stamp 42373.3841s in the future.and the
sudo hwclock -scommand fixed it. Might have had something to do with not restarting since the daylight savings time switch?edmoman commentedon Feb 6, 2023
I keep receiving the message even after trying the hwclock and touch workarounds.
The problem seems to be that the files generated during compiling have a timestamp 2-4 second in the future.
This seems as a major bug to me.
Keep in mind that most companies block the Microsoft Store and implement proxies that block NTP.