rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.84k stars 272 forks source link

Cannot login to azure private container registry with azure cli #1850

Open tilm4nn opened 2 years ago

tilm4nn commented 2 years ago

Actual Behavior

When I use azure cli to login to a azure private container registry that I want to push images to I get an error.

Steps to Reproduce

  1. On azure create a container registry called mycontainerregistry
  2. On azure CLI issue the following command and follow instructions to login to azure az login
  3. On azure CLI issue the following command to login to the container registry az acr login --name mycontainerregistry

Result

The following error is shown in the console: $ az acr login --name mycontainerregistry [077:23:09:47.792][E] (a7ac4134) 52f9999a-CredentialHelperPKG C<-S NoResponse POST /registry/credstore-updated (1.2882ms): Post "http://ipc/registry/credstore-updated": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:47.978][E] (a7ac4134-1) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (0s): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:48.981][E] (a7ac4134-2) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (795.2µs): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:49.996][E] (a7ac4134-3) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (2.1874ms): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:51.009][E] (a7ac4134-4) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (2.1731ms): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:52.021][E] (a7ac4134-5) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (1.6449ms): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:53.034][E] (a7ac4134-6) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (2.8185ms): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:54.048][E] (a7ac4134-7) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (990.9µs): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 [077:23:09:55.063][E] (a7ac4134-8) 52f9999a-CredentialHelperPKG C<-S NoResponse GET /ping (2.0059ms): Get "http://ipc/ping": open \.\pipe\dockerBackendApiServer: The system cannot find the file specified. [common/pkg/backend.(backendClient).NotifyCredstoreUpdated(0xc57d07) [ common/pkg/backend/client.go:413 +0x42 [main.addCredentialsHelperCommand.func1.1() [ common/cmd/docker-credential-desktop/main.go:21 +0x31 [common/pkg/docker-credential-desktop.Helper.Add({0xc0002041e0, 0xc83dd8}, 0xc0002244e0) [ common/pkg/docker-credential-desktop/helper.go:59 +0xf4 [github.com/docker/docker-credential-helpers/credentials.Store({0xd0e380, 0xc00020e130}, {0xd01ee0, 0xc000006010}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:107 +0x229 [github.com/docker/docker-credential-helpers/credentials.HandleCommand({0xd0e380, 0xc00020e130}, {0xc00001e0c0, 0xd0e380}, {0xd01ee0, 0xc000006010}, {0xd01f20, 0xc000006018}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:71 +0xf3 [github.com/docker/docker-credential-helpers/credentials.Serve({0xd0e380, 0xc00020e130}) [ vendor/github.com/docker/docker-credential-helpers/credentials/credentials.go:58 +0xf4 [main.addCredentialsHelperCommand.func1(0xc0000b5180, {0xc50fe6, 0x0, 0x0}) [ common/cmd/docker-credential-desktop/main.go:23 +0x2a [github.com/spf13/cobra.(Command).execute(0xc0000b5180, {0x1089df0, 0x0, 0x0}) [ vendor/github.com/spf13/cobra/command.go:860 +0x5f8 [github.com/spf13/cobra.(Command).ExecuteC(0xc0000b4f00) [ vendor/github.com/spf13/cobra/command.go:974 +0x3bc [github.com/spf13/cobra.(Command).Execute(...) [ vendor/github.com/spf13/cobra/command.go:902 [main.main() [ common/cmd/docker-credential-desktop/main.go:45 +0x107 Error saving credentials: error storing credentials - err: exit status 1, out: Post "http://ipc/registry/credstore-updated": open \\.\pipe\dockerBackendApiServer: The system cannot find the file specified. Login failed.

Expected Behavior

No error is shown login is successful.

Additional Information

I have also Docker Desktop installed (and not running) but binariy path variable points to the Rancher Desktop Docker binaries.

Rancher Desktop Version

1.1.1

Rancher Desktop K8s Version

Disabled

Which container runtime are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 10 Professional Version 21H2 (OS build 19044.1566)

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

No response

Windows User Only

We are using adminbyrequest to elevate user privileges when required. We are using Trend Micro Security Agent Realtime Scan for virus protection.

jonathaneckman commented 2 years ago

+1. Just ran into the exact same issue.

jandubois commented 2 years ago

Check the .docker/config.json file and make sure the credsStore value is set to wincred and not desktop.

tilm4nn commented 2 years ago

Thanks @jandubois I just checked that and changed the setting from desktop to wincred. Now the registry login behaves differently using Rancher Desktop but still does not work.

az acr login --name mycontainerregistry
Error response from daemon: Get "https://mycontainerregistry.azurecr.io/v2/": dial tcp: lookup mycontainerregistry.azurecr.io on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address
Login failed.

However registry login is still working with the changed setting when using Docker Desktop.

tilm4nn commented 2 years ago

I am not quite sure with my last sentence "However registry login is still working with the changed setting when using Docker Desktop." Actually Docker Desktop changed the setting back to desktop when started. And I changed it back once again while it was running. So I cannot tell which config is actually used by Docker Desktop.

jandubois commented 2 years ago

Docker Desktop will always use the "desktop" setting, but that is closed source and somehow ties into Docker Desktop, so we cannot use it.

I will try to get some Azure registry credentials myself for testing, but that may take a couple of days...

stigok commented 8 months ago

Workaround for plain az acr login:

$ az acr login --subscription=mysub --name=registryname --expose-token | jq -r '.accessToken' | docker login -u 00000000-0000-0000-0000-000000000000 --password-stdin registryname.azurecr.io
joshdanko commented 7 months ago

I just started getting this after upgrading to the latest Rancher Desktop. Now i can't connect at all to my azure cr. I tried that workaround and it doesn't work either. I just always get this error from docker login:

Error response from daemon: Get "https://myregistryname.azurecr.io/v2/": EOF

Anyone else found any other possible workarounds?

joshdanko commented 7 months ago

Downgrading back to 1.10.0 from here https://github.com/rancher-sandbox/rancher-desktop/releases got me back up and running.