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

Can't open wsl possibly after update "the data is invalid" #8826

Closed
1 of 2 tasks
jameschapman19 opened this issue Sep 16, 2022 · 27 comments
Closed
1 of 2 tasks

Can't open wsl possibly after update "the data is invalid" #8826

jameschapman19 opened this issue Sep 16, 2022 · 27 comments

Comments

@jameschapman19
Copy link

Version

Microsoft Windows [Version 10.0.22579.100]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

wsl.exe ->

Expected Behavior

Open a wsl console

Actual Behavior

The data is invalid.
Error code: Wsl/Service/CreateInstance/CreateVm/0x8007000d

Diagnostic Logs

No response

@KRTone
Copy link

KRTone commented Sep 16, 2022

Exactly the same error. Cant run docker dosktop.
Yesterday I updated win11. Everything was fine before the update.

WslLogs-2022-09-16_17-17-44.zip

@jameschapman19
Copy link
Author

Short fix (from another discussion I found) change the system date backwards in time

@jameschapman19
Copy link
Author

Fixed mine completely by downloading and installing another update

@jameschapman19
Copy link
Author

Strongest recommendation don’t do anything silly- your files are probably fine (mine were)

@jameschapman19
Copy link
Author

I used system date trick to back everything up in case though

@KRTone
Copy link

KRTone commented Sep 16, 2022

Hell no! :D
Big thanks! It really works

@KRTone
Copy link

KRTone commented Sep 16, 2022

Can do you give link to that issue.
Because it's not a real-world fix, because everything in win11 stop work with incorrect datetime.

@Biswa96
Copy link

Biswa96 commented Sep 16, 2022

If this is a Docker Desktop related issue it may not be caused by actual WSL layer.

@KRTone
Copy link

KRTone commented Sep 16, 2022

powershell (or cmd) ">>> wsl" throws the same error
изображение
Docker speaks:

изображение

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\KRT\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: The data is invalid. 
Error code: Wsl/Service/CreateVm/0x8007000d

 stderr: 
   at Docker.ApiServices.WSL2.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\WSL2\WslCommand.cs:line 146
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 168
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\WSL2Provisioning.cs:line 77
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__28.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.Engines\WSL2\LinuxWSL2Engine.cs:line 180
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\PR-16360\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

I think that is not a docker bug

@Biswa96
Copy link

Biswa96 commented Sep 16, 2022

I think that it's not a docker bug

It looks like a Docker Desktop bug. Can you reproduce the issue with a different Linux distribution from Windows Store after uninstalling Docker Desktop?

@KRTone
Copy link

KRTone commented Sep 16, 2022

everything are same

@iagocq
Copy link

iagocq commented Sep 16, 2022

This is also happening to me. Setting the date back in time fixed it.

Why I think this is happening

I wasn't able to update my system for months. Today, every action I take regarding the system configuration / administration now shows an UAC prompt (opening task manager, changing settings). Checking their exes, they all have one thing in common: the certificate they were signed with (Microsoft Windows) is valid until 2022-09-15. I think some WSL-related binary was signed with that certificate and some check is failing because of that.

This won't happen if your machine is properly updated

@benhillis
Copy link
Member

This is happening because you are stuck on a very old Windows Insiders build (from March). Fix is to make sure you install a more recent version of Windows.

@StartForKiller
Copy link

Nope, that's not true, as i'm in 25179.1000 and it failing for me too, and the update KB2267602 is giving me a wrong date or time error too, so maybe is realted to other problem too

@StartForKiller
Copy link

StartForKiller commented Sep 16, 2022

Okay, seems that updating the system solves the problem, that build expires on 15/09/2022
To do that change the date and try to update

@SauloSilva
Copy link

SauloSilva commented Sep 16, 2022

Ok, solve to me:

1 - Travel to 14/09/2022 in my windows
2 - Open powersheel and execute: wsl update
3 - Travel back today

@IzaGz
Copy link

IzaGz commented Sep 17, 2022

Ok, solve to me:

1 - Travel to 14/09/2022 in my windows 2 - Open powersheel and execute: wsl update 3 - Travel back today

when i do this, i am getting error:
the data is invalid Error code: Wsl/Service/CreateInstance/CreateVm/0x8007000d
I have latest windows updates
please help to solve this and dont lose ubuntu data

@syedadeel2
Copy link

Ok, solve to me:

1 - Travel to 14/09/2022 in my windows 2 - Open PowerShell and execute: wsl update 3 - Travel back today

Not sure why changing the date works; whatever it is, it needs to be fixed.

@Jackky90
Copy link

Ok, solve to me:

1 - Travel to 14/09/2022 in my windows 2 - Open powersheel and execute: wsl update 3 - Travel back today

That's totally insane, but this is what helped me after doing all other instructions.

@OneBlue
Copy link
Collaborator

OneBlue commented Sep 20, 2022

Thanks for reporting this @jameschapman19.
This is unfortunately a Windows issue, it can only be solved by updating your Windows build.

@OneBlue OneBlue closed this as completed Sep 20, 2022
@StephaneKazmierczak
Copy link

StephaneKazmierczak commented Sep 23, 2022

I am having the exact same error, updating insider to a new build doesn't work,
and I can't change the date as it is locked by my organization, even though I am admin on the machine it is gray out.

Update: I managed to change the date with command line
set-Date -Date "14/09/2022" and run wsl --update
however I am now getting:
The data is invalid. Error code: Wsl/Service/CreateInstance/CreateVm/0x8007000d

Edit: I found that with the date from the paste then wsl works. So I will just backup everything and then install real linux instead

@iandouglas
Copy link

What worked for me:

@SauloSilva said to set my date back to Sept 14, 2022 in Windows, which I did
I then ran "wsl update" in PowerShell, which gave an error saying "update" wasn't a command:

PS C:\Users\iando> wsl update
/bin/bash: update: command not found
PS C:\Users\iando> wsl

Wed Sep 14 13:19:32 MDT 2022
[7213] /mnt/c/Users/iando |
[id] $ exit
logout
PS C:\Users\iando> _

... changed my date back via "set time automatically"

Starting a new WSL2 shell seems to be working, all data appears to be present.

@IzaGz
Copy link

IzaGz commented Sep 25, 2022

still getting Error code: Wsl/Service/CreateInstance/CreateVm/0x8007000d anyone can help?

@StephaneKazmierczak
Copy link

@IzaGz open a terminal with admin privilege, reset the date to something before the 15th ex : set-Date -Date "01/09/2022"
then type wsl

@StephaneKazmierczak
Copy link

StephaneKazmierczak commented Sep 26, 2022

What worked for me:

@SauloSilva said to set my date back to Sept 14, 2022 in Windows, which I did I then ran "wsl update" in PowerShell, which gave an error saying "update" wasn't a command:

PS C:\Users\iando> wsl update
/bin/bash: update: command not found
PS C:\Users\iando> wsl

Wed Sep 14 13:19:32 MDT 2022
[7213] /mnt/c/Users/iando |
[id] $ exit
logout
PS C:\Users\iando> _

... changed my date back via "set time automatically"

Starting a new WSL2 shell seems to be working, all data appears to be present.

@iandouglas the first command : wsl update failed because it is missing "--" it should be: wsl --update
after running wsl while setting an older date, I found that it keeps working after I reset the date to the current one until I reboot

@tik9
Copy link

tik9 commented Oct 11, 2022

Everytime I need wsl I have to change the date? My windows 11 inside preview updates - last one today 10.0.25217.1010 - are done. If I start wsl with wrong date, apt update will not work because of the date shift: Release file for http://security.debian.org/debian-security/dists/buster/updates/InRelease is not valid yet (invalid for another 40d

@iandouglas
Copy link

iandouglas commented Oct 11, 2022

Here's my "fix":

I wrote a PowerShell script that grabs the date/time, sets it back to Sept 13, launches WSL, then sets the date back to today. In WSL, I have a script that runs in my .bashrc that ensures some necessary startup tasks are running (Redis, PostgreSQL, corn, etc) and then calls ntpdate to reset its own time/date. Opening the usual WSL window after that works just fine, at which point I "exit" the WSL that PowerShell launched, and "exit" the PowerShell script.

The first part of the script relaunches itself in Administrator mode if you don't already run it in Administrator mode.

param([switch]$Elevated)

function Test-Admin {
    $currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
    $currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
}

if ((Test-Admin) -eq $false)  {
    if ($elevated) {
        # tried to elevate, did not work, aborting
    } else {
        Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition))
    }
    exit
}

'running with full privileges'

# get current date
$date = Get-Date -Format g
$time = Get-Date -Format t

# set date to Sept 13, 2022
Set-Date -Date "09/13/2022 $time"
Get-Date

# sleep for 1 seconds
Start-Sleep -s 1
Start-Process c:\windows\system32\wsl.exe
Start-Sleep -s 10

Set-Date -Date "$date"
Get-Date

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

No branches or pull requests