Skip to content

Release file for repository is not valid yet #4114

Closed

Description

Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.

If you have a feature request, please post to the UserVoice.

If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to [email protected]. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".

Please fill out the below information:

  • Your Windows build number: Microsoft Windows [Version 10.0.18917.1000]

  • What you're doing and what's happening: Attempting to run a sudo apt update within a WSL 2 installation. Seeing thing following error

[sudo] password for xander: Hit:1 https://packages.microsoft.com/repos/azure-cli bionic InRelease Hit:2 http://archive.ubuntu.com/ubuntu bionic InRelease Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Hit:5 http://archive.ubuntu.com/ubuntu bionic-backports InRelease Get:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Reading package lists... Done E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 10h 29min 48s). Updates for this repository will not be applied. E: Release file for http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 11h 0min 22s). Updates for this repository will not be applied.

Based on my own searching, I suspect the WSL clock may be falling out of sync with my windows machine? Though trying to cat /etc/localtime causes WSL to hang

  • What's wrong / what should be happening instead: apt should run an update with no error output

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

  • For WSL launch issues, please collect detailed logs.

See our contributing instructions for assistance.

Activity

  1. benhillis commented on Jun 13, 2019

    @benhillis
    Member

    What do the following commands return?

    date
    cmd.exe /c time /t
    readlink /etc/localtime

    What is your Windows timezone? Any interesting errors in sudo dmesg?

  2. salaxander commented on Jun 13, 2019

    @salaxander
    Author

    Thanks for the reply!

    ~ date 
    Wed Jun 12 19:29:19 PDT 2019 
    
    ~ cmd.exe /c time /t
     '\\wsl$\Ubuntu\home\xander'
    CMD.EXE was started with the above path as the current directory. 
    UNC paths are not supported.  Defaulting to Windows directory.
    09:14 AM
    
    ~ readlink /etc/localtime
     /usr/share/zoneinfo/America/Los_Angeles
    

    The only thing that catches my eye in sudo dmesg is

    [    0.606657] hv_utils: cannot register PTP clock: 0
    
  3. benhillis commented on Jun 13, 2019

    @benhillis
    Member

    Interesting, not only is the hour wrong, the minutes is way off as well...

    Thanks, does Ameria/Los_Angeles match your Windows time zone (Pacific)?

  4. salaxander commented on Jun 13, 2019

    @salaxander
    Author

    It does indeed! For what it's worth, I was also selfhosting a build with WSL 2 about a month ago (I work at Microsoft 😄), and I encountered the same issue, sorry for not reporting it to the team sooner!

  5. trondhindenes commented on Jun 13, 2019

    @trondhindenes

    Can repro. My windows computer is in CET, but WSL2 gives a completely different utc time altho /etc/localtime seems to be correctly set to Europe/Berlin

  6. benhillis commented on Jun 13, 2019

    @benhillis
    Member

    This seems to have to do with clock drift. If you shut down wsl and restart, is the problem solved?

    wsl.exe --shutdown

  7. salaxander commented on Jun 13, 2019

    @salaxander
    Author

    That does seem to resolve the issue for now. Running date shows the correct time. I'm still seeing [ 0.531827] hv_utils: cannot register PTP clock: 0 when running a sudo dmesg though (not sure if that's consequential or not). I'll report back if things fall out of sync again.

  8. therealkenc commented on Jun 14, 2019

    @therealkenc

    Laptop? Did it sleep? Maybe related this. WAG.

  9. added
    wsl2
    and removed on Jun 14, 2019
  10. mithunshanbhag commented on Jun 16, 2019

    @mithunshanbhag

    Running into this same issue when running sudo apt update && sudo apt upgrade (Ubuntu 18.04 with WSL2 on windows insider build 18917.1000 on Macbook air).

    Definitely some clock drift issue as the date command is returning the wrong time.

    Shutting down WSL2 (wsl --shutdown) and rerunning the apt update command seems to fix it for now.

  11. 20 remaining items

  12. shinebayar-g commented on Nov 25, 2020

    @shinebayar-g

    Another quick fix:

    sudo apt-get install ntpdate
    sudo ntpdate pool.ntp.org
    

    Working on WSL2, Ubuntu 20.04 LTS.

  13. mcandre commented on Dec 5, 2020

    @mcandre

    Why does WSL ntpd fail upon resuming from hibernation?

  14. brandonh-msft commented on Dec 16, 2020

    @brandonh-msft

    Another quick fix:

    sudo apt-get install ntpdate
    sudo ntpdate pool.ntp.org
    

    Working on WSL2, Ubuntu 20.04 LTS.

    Even better, added to ~/.bashrc :)

    This lost me hours of work last night as I tried to troubleshoot a mysterious auth error from Terraform as it was trying to deploy an Azure Storage Account. Shows up in the form of a "bad authorization header" error message.

  15. SebTardif commented on Oct 13, 2021

    @SebTardif

    Another quick fix:

    sudo apt-get install ntpdate
    sudo ntpdate pool.ntp.org
    

    Working on WSL2, Ubuntu 20.04 LTS.

    Even better, added to ~/.bashrc :)

    It's not good enough for me. I need to have a cron job that execute it each 5 minutes. Basic things are so complicated when Windows is close by.

  16. devedse commented on Dec 7, 2021

    @devedse

    Hi all, I created a script that creates a scheduled task to automatically update the time of WSL when you either restore from sleep or you restore a "Saved" Hyper-V VM.

    wsl -d Ubuntu -u root apt-get update && apt-get install ntpdate
    schtasks /Create /TN wsl-clock /TR "wsl -d Ubuntu -u root ntpdate pool.ntp.org" /SC ONEVENT /EC System /MO "*[System[Provider[@Name='Microsoft-Windows-Kernel-Power'] and (EventID=107 or EventID=507) or Provider[@Name='Microsoft-Windows-Kernel-General'] and (EventID=1)]]" /F
    

    Change Ubuntu (in both places in the script) to the name of your WSL Instance (See wsl --list), then execute the script in cmd.

    Thanks to all the other comments/suggestions that helped me create this script 😄 .

  17. SerhiiRohoza commented on Dec 22, 2022

    @SerhiiRohoza

    I have the same issue on Windows 11 22H2, WSL2, Ubuntu 22.04 while updating packages:

    $sudo apt update && sudo apt upgrade -y                                                                                                                                                                    
    [sudo] password for serhii_rohoza:
    Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
    Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
    Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
    Hit:4 https://baltocdn.com/helm/stable/debian all InRelease
    Get:5 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease [7,535 B]
    Hit:6 https://apt.releases.hashicorp.com jammy InRelease
    Hit:7 https://packages.cloud.google.com/apt cloud-sdk InRelease
    Get:8 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease [7,459 B]
    Get:9 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease [7,453 B]
    Get:10 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
    Get:11 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease [7,452 B]
    Reading package lists... Done
    E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 1d 16h 4min 18s). Updates for this repository will not be applied.
    E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease is not valid yet (invalid for another 1d 16h 4min 40s). Updates for this repository will not be applied.
    E: Release file for http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease is not valid yet (invalid for another 1d 16h 5min 15s). Updates for this repository will not be applied.
    

    It could be fixed with sudo hwclock --hctosys, but it's quite annoying.

  18. matthewnourse commented on Mar 16, 2023

    @matthewnourse

    This problem was killing me so a chucked a tantrum and wrote a little daemon for it:
    https://github.com/matthewnourse/polite-hwclock-hctosys

    I hope you find it useful.

  19. ManuInNZ commented on Mar 16, 2023

    @ManuInNZ
  20. craigloewen-msft commented on Apr 21, 2023

    @craigloewen-msft
    Member

    /dupe #10006

    We're migrating all clock skew issues to a megathread so we can keep the top comment up to date with any updates and work arounds. Thank you for filing this!

  21. microsoft-github-policy-service commented on Apr 21, 2023

    @microsoft-github-policy-service
    Contributor

    Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

    Thanks for your report!

  22. roskee commented on Jun 6, 2023

    @roskee

    This might occur when there is another OS dual booted on the computer. For example, there will be a 3-hour clock offset between Ubuntu and Windows dual boot setup. I used the configuration changes recommended by Leon (@leon-strong).

  23. mcandre commented on Aug 8, 2023

    @mcandre

    I'm not dual booting.

    Why do WSL and native Windows have split clocks?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugduplicateworkaround-availablewsl2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions