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

Getting issue when i deploy to docker registry #1959

Closed
kalanchiyamtutorial opened this issue May 8, 2020 · 7 comments
Closed

Getting issue when i deploy to docker registry #1959

kalanchiyamtutorial opened this issue May 8, 2020 · 7 comments

Comments

@kalanchiyamtutorial
Copy link

Does this occur consistently?
Repro steps:

Action: vscode-docker.registries.logInToDockerCli
Error type: Error
Error Message: In order to log in to the Docker CLI using tokens, you currently need to go to
Open your Docker config file and remove "credsStore": "wincred" from the config.json file, then try again.
Doing this will disable wincred and cause Docker to store credentials directly in the .docker/config.json file. All registries that are currently logged in will be effectly logged out.

Version: 1.1.0
OS: win32
OS Release: 10.0.17763
Product: Visual Studio Code
Product Version: 1.44.2
Language: en

Call Stack
extension.bundle.js:164:252001extension.bundle.js:164:252001
ChildProcess.exithandler child_process.js:315:5
ChildProcess.emit events.js:203:13
maybeClose child_process.js:1021:16
Process.ChildProcess._handle.onexit child_process.js:283:5
@bwateratmsft
Copy link
Contributor

Have you tried removing "credsStore": "wincred" from the Docker config.json?

@Naninani
Copy link

Naninani commented May 29, 2020

Have you tried removing "credsStore": "wincred" from the Docker config.json?

Removing the "credsStore": "wincred" is exposing the auth token in the config file. Sure that works, but how is it considered a secure and compliant approach?
In addition the config.json has "credsStore": "desktop", not "credsStore": "wincred".
image

By the way I hit the exact same issue after enabling WSL 2 and trying running VS Code from both the linux fs and windows.

Even the error code is not complete and has typos.

Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The stub received bad data.``
Error: In order to log in to the Docker CLI using tokens, you currently need to go to 
Open your Docker config file and remove "credsStore": "wincred" from the config.json file, then try again. 
Doing this will disable wincred and cause Docker to store credentials directly in the .docker/config.json file. All registries that are currently logged in will be effectly logged out.

Not sure what "effectly" mens and "you currently need to go to " does not point to any location nor url.

fyi: @bwateratmsft

@bwateratmsft
Copy link
Contributor

bwateratmsft commented May 29, 2020

@Naninani I looked at our code and it appears this warning message was created to do the same work around as Azure/azure-cli#4843. This was years ago. I'll take a look to see if it is needed anymore.

@bwateratmsft
Copy link
Contributor

bwateratmsft commented May 29, 2020

@Naninani the problem still exists and is outside of our control--wincred has a limit of 2.5K and the refresh tokens used for CLI login far exceed that. In an old comment, @djyou implied that there would be a server-side change to limit the token length; @djyou, has that actually happened? A refresh token I got just now is 2717 characters long, so the error reproduces.

In the meantime, I'm going to clean up the messy grammar in the message. You are absolutely correct that turning off wincred is less secure, but there's nothing the Docker extension can do about the limitations of it.

The "real" answer given by the Azure team is to use the Azure CLI + ACR Docker Credential Helper, but we can't assume those prerequisites are present on the machines.

@bwateratmsft
Copy link
Contributor

@sajayantony as well

@bwateratmsft
Copy link
Contributor

We think this should be fixed by #2153. Users who want to remove the "credsStore": "desktop" entry can do so, but may need to log out and back in.

@bwateratmsft
Copy link
Contributor

We have released Docker 1.4.0 which contains a fix for this.

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants