-
Notifications
You must be signed in to change notification settings - Fork 175
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
Windows docker login, "stub received bad data" #346
Comments
I finally found someone recommending to run the system file checker. It worked!
Sorry for the spam, I just spent far too long on this. Hopefully this helps someone out? |
Interesting; hadn't heard of that one (but admitted, I'm not on Windows myself). IIUC that command is to fix issues with your Windows installation (as a whole?) |
Myself, I'm on a mac 😄 Just over here tryna deploy legacy asp.net applications lol. And yeah, I think there must be something weird with the win server 2022 image from aws. The problem was only manifesting when trying to use |
Thanks! I'll try to keep this one in the back of my mind in case I see someone reporting something like this! |
Hum also encounter this one on windows runners on GHA: https://github.com/docker/login-action/actions/runs/5472897107/jobs/9965664777#step:4:15 |
Let me post that output here as well (easier to search);
|
Some mention in Go code here; https://github.com/minepkg/minepkg/blob/c2146e9b476e6e2ed46a23f21b89a9aaff132c25/internals/auth/microsoft.go#L23-L32 // MicrosoftCredentialStorage is used to trim down the auth data to the minimum required
// otherwise the windows keyring will return an error ("The stub received bad data.")
type MicrosoftCredentialStorage struct {
MicrosoftAuth oauth2.Token `json:"ms"`
PlayerName string `json:"pn"`
UUID string `json:"id"`
AccessToken string `json:"at"`
ExpiresAt time.Time `json:"exp"`
XUID string `json:"xuid,omitempty"`
} Error-code (not the canonical source of truth); https://github.com/mickael-kerjean/filestash/blob/c2059c839d516c2ee56570d1d636c97a9c807278/vendor/github.com/hirochachacha/go-smb2/internal/erref/ntstatus.go#L2938
But looks to be documented here; https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55 |
Hi people. @djeikyb I am sorry to see that you have closed the report. After all, I believe the issue is that the docker windows credential manager doesn't like looong stuff. Maybe they forgot to include tokens, and focused only in human passwords of some maximum length. |
@yerlibilgin tbh i opened this issue after i already had a solution just to document (a) the problem (b) the solution i painstakingly discovered. if you think this is a problem that should be solved in the docker codebase, please do open an issue! and tag this one in for searchability! |
Unfortunately |
I'm re-reading the issue, and the comment I left further up #346, and I think I have a slightly clearer picture of the issue (bear with me; I'm not a Windows user), although I don't exactly understand how the The original issue was reported with this command; (Get-ECRLoginCommand).Password | docker login --username AWS --password-stdin my-ecr-am.amazonaws.example.com This command;
From my understanding, the last part is where things fail, and from #346 it looks that (as also mentioned by @yerlibilgin #346) the I'm not sure if there's good ways around this; the code in the In the docker CLI + credentials helper case, that's not a real option; the CLI treats the password (or token passed as password) as opaque data; it verified that data is correct against the registry in which case it stores it as-is. And, in this case, the token is produced by So the only solution I could see here is to either
That last change would have to be implemented in either the credentials helper (https://github.com/docker/docker-credential-helpers/tree/master/wincred), or the Go library that's used to interact with the Windows Credentials store (github.com/danieljoos/wincred). I will reopen this ticket, but move it to the https://github.com/docker/docker-credential-helpers repository's issue tracker, because the underlying issue here does not appear to be in the docker CLI itself. Let me also cc @austinvazquez in case he has more insight in the ECRLoginCommand to see if there's options for it to produce a token that's smaller (omitting data that may not be essential?) |
@thaJeztah thanks for sharing, it helped me find the solution - in my case I simply removed
I can confirm that. Today I faced the same issue with
Not really an official documentation but if you go to Credential Manager and try to add a generic credential, the password field will remain blank if you try to paste the generated token but it will accept anything that is significantly shorter. On my machine (Windows 10 22H2) the limit is set to 259 characters, the password field will not accept any string equal to or longer than 260 characters. |
I got this for the first time today. I was running WSL2 and trying to build for ECR from there, when I experienced the problem. All the solutions I found suggested removing the In my case I found that |
Description
On windows server 2022, when using docker login so I can push an image to ecr, I get this weird error:
There's lots of recommendations to clear or remove the
.docker\config.json
file, but that doesn't fix the issue.Reproduce
Expected behavior
No response
docker version
Client: Cloud integration: v1.0.33 Version: 24.0.2 API version: 1.43 Go version: go1.20.4 Git commit: cb74dfc Built: Thu May 25 21:53:15 2023 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.20.0 (109717) Engine: Version: 24.0.2 API version: 1.43 (minimum version 1.24) Go version: go1.20.4 Git commit: 659604f9 Built: Thu May 25 21:52:13 2023 OS/Arch: windows/amd64 Experimental: false
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: