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

v1.12.1 cache add: UNAUTHORIZED: authentication required #8799

Closed
MOZGIII opened this issue Jul 22, 2020 · 7 comments
Closed

v1.12.1 cache add: UNAUTHORIZED: authentication required #8799

MOZGIII opened this issue Jul 22, 2020 · 7 comments
Labels
cmd/cache Issues with the "cache" command kind/support Categorizes issue or PR as a support question.

Comments

@MOZGIII
Copy link

MOZGIII commented Jul 22, 2020

Steps to reproduce the issue:

  1. Build an image: docker build -t localhost/myimage
  2. Add it to cache: minikube cache add localhost/myimage

This used to work with 1.11.0, but with 1.12.1 it doesn't.

Full output of failed command:

Example output from our CI script, first line is the end of docker build:

Successfully tagged localhost/vector-test:test-1595410812-r96ekzmo-debian
E0722 10:26:07.429063   74303 cache.go:63] save image to file "localhost/vector-test:test-1595410812-r96ekzmo-debian" -> "/home/runner/.minikube/cache/images/localhost/vector-test_test-1595410812-r96ekzmo-debian" failed: nil image for localhost/vector-test:test-1595410812-r96ekzmo-debian: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1595410812-r96ekzmo-debian: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]
* 
X Failed to cache and load images: save to dir: caching images: caching image "/home/runner/.minikube/cache/images/localhost/vector-test_test-1595410812-r96ekzmo-debian": nil image for localhost/vector-test:test-1595410812-r96ekzmo-debian: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1595410812-r96ekzmo-debian: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]
* 
* minikube is exiting due to an error. If the above message is not useful, open an issue:
  - https://github.com/kubernetes/minikube/issues/new/choose

Full output of minikube start command used, if not already included:

* minikube v1.12.1 on Ubuntu 18.04
* Using the docker driver based on user configuration
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Downloading Kubernetes v1.18.6 preload ...
* Creating docker container (CPUs=2, Memory=2200MB) ...
* Preparing Kubernetes v1.18.6 on Docker 19.03.2 ...
* Verifying Kubernetes components...
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube"
    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 29.80 MiB     > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 56.00 MiB     > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 77.44 MiB     > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 144.58 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 184.00 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 232.20 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 279.30 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 338.98 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 383.75 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 415.20 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 459.89 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 510.97 MiB    > preloaded-images-k8s-v4-v1.18.6-docker-overlay2-amd64.tar.lz4: 526.26 MiB

This seems to be mangled a bit, it's from a Github Actions output.

@tstromberg tstromberg changed the title Minikube 0.12 fails to add image to cache v1.12.1 cache add: UNAUTHORIZED: authentication required; Jul 22, 2020
@tstromberg tstromberg changed the title v1.12.1 cache add: UNAUTHORIZED: authentication required; v1.12.1 cache add: UNAUTHORIZED: authentication required Jul 22, 2020
@tstromberg tstromberg added cmd/cache Issues with the "cache" command kind/support Categorizes issue or PR as a support question. labels Jul 22, 2020
@MOZGIII
Copy link
Author

MOZGIII commented Aug 5, 2020

Just tried it with version 1.12.2 - still broken.

@priyawadhwa
Copy link

Hey @MOZGIII looks like minikube isn't finding the image in the local daemon, which is odd because we check for it first here:

img, err := daemon.Image(ref)

could you provide the output of minikube cache add <image> --alsologtostderr?

@MOZGIII
Copy link
Author

MOZGIII commented Aug 12, 2020

Sure, here you go:

$ minikube cache add localhost/vector-test:test-1594158952-npg8733f-debug --alsologtostderr
I0813 00:38:58.741394   75132 cache.go:92] acquiring lock: {Name:mk394455ae0f9a8b588e4ad3c5fccb74c3ae627c Clock:{} Delay:500ms Timeout:10m0s Cancel:<nil>}
I0813 00:38:58.741486   75132 image.go:168] retrieving image: localhost/vector-test:test-1594158952-npg8733f-debug
I0813 00:38:58.741783   75132 image.go:176] daemon lookup for localhost/vector-test:test-1594158952-npg8733f-debug: Error response from daemon: client version 1.41 is too new. Maximum supported API version is 1.40
W0813 00:39:00.629027   75132 image.go:185] authn lookup for localhost/vector-test:test-1594158952-npg8733f-debug (trying anon): GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]
W0813 00:39:01.843806   75132 cache.go:118] unable to retrieve image: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]
I0813 00:39:01.843968   75132 cache.go:81] cache image "localhost/vector-test:test-1594158952-npg8733f-debug" -> "/home/mozgiii/.minikube/cache/images/localhost/vector-test_test-1594158952-npg8733f-debug" took 3.102582395s
E0813 00:39:01.844015   75132 cache.go:63] save image to file "localhost/vector-test:test-1594158952-npg8733f-debug" -> "/home/mozgiii/.minikube/cache/images/localhost/vector-test_test-1594158952-npg8733f-debug" failed: nil image for localhost/vector-test:test-1594158952-npg8733f-debug: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]
I0813 00:39:01.844680   75132 exit.go:58] WithError(Failed to cache and load images)=save to dir: caching images: caching image "/home/mozgiii/.minikube/cache/images/localhost/vector-test_test-1594158952-npg8733f-debug": nil image for localhost/vector-test:test-1594158952-npg8733f-debug: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]] called from:
goroutine 1 [running]:
runtime/debug.Stack(0x1, 0xc000a3fc60, 0xc000a3fbf0)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
k8s.io/minikube/pkg/minikube/exit.WithError(0x1bc485b, 0x1f, 0x1ec7e20, 0xc0009ff120)
	/app/pkg/minikube/exit/exit.go:58 +0x34
k8s.io/minikube/cmd/minikube/cmd.glob..func1(0x2cc91c0, 0xc00000f900, 0x1, 0x2)
	/app/cmd/minikube/cmd/cache.go:46 +0xea
github.com/spf13/cobra.(*Command).execute(0x2cc91c0, 0xc00000f8e0, 0x2, 0x2, 0x2cc91c0, 0xc00000f8e0)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0x2ccc8e0, 0x0, 0x1, 0xc00021f6a0)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
	/go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
k8s.io/minikube/cmd/minikube/cmd.Execute()
	/app/cmd/minikube/cmd/root.go:106 +0x72c
main.main()
	/app/cmd/minikube/main.go:71 +0x11f
W0813 00:39:01.846845   75132 out.go:252] Failed to cache and load images: save to dir: caching images: caching image "/home/mozgiii/.minikube/cache/images/localhost/vector-test_test-1594158952-npg8733f-debug": nil image for localhost/vector-test:test-1594158952-npg8733f-debug: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]

💣  Failed to cache and load images: save to dir: caching images: caching image "/home/mozgiii/.minikube/cache/images/localhost/vector-test_test-1594158952-npg8733f-debug": nil image for localhost/vector-test:test-1594158952-npg8733f-debug: GET https://index.docker.io/v2/localhost/vector-test/manifests/test-1594158952-npg8733f-debug: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:localhost/vector-test Type:repository]]

😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
👉  https://github.com/kubernetes/minikube/issues/new/choose

@MOZGIII
Copy link
Author

MOZGIII commented Sep 21, 2020

As of minikube 1.13.0 this is fixed.

@MOZGIII MOZGIII closed this as completed Sep 21, 2020
@pzs-pzs
Copy link

pzs-pzs commented Dec 9, 2020

my minikube version is v1.14.2

➜ gin-demo minikube cache add my_image:1.0.0
E1210 00:05:26.980452 31876 cache.go:63] save image to file "my_image:1.0.0" -> "/Users/puzhengsong/.minikube/cache/images/my_image_1.0.0" failed: nil image for my_image:1.0.0: GET https://index.docker.io/v2/library/my_image/manifests/1.0.0: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/my_image Type:repository]]

❌ Exiting due to MK_CACHE_LOAD: save to dir: caching images: caching image "/Users/puzhengsong/.minikube/cache/images/my_image_1.0.0": nil image for my_image:1.0.0: GET https://index.docker.io/v2/library/my_image/manifests/1.0.0: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/my_image Type:repository]]

😿 If the above advice does not help, please let us know:
👉 https://github.com/kubernetes/minikube/issues/new/choose

@MOZGIII
Copy link
Author

MOZGIII commented Dec 9, 2020

It works for me at 1.15.1:

$ minikube cache add test:latest
$ minikube version
minikube version: v1.15.1
commit: 23f40a012abb52eff365ff99a709501a61ac5876

@pzs-pzs can you open another issue for this please? It looks like a different bug.

@pzs-pzs
Copy link

pzs-pzs commented Dec 9, 2020

@MOZGIII thx, I will open another issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/cache Issues with the "cache" command kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

4 participants