Skip to content

"minikube image load" silently fails when repo/image:tag combination is already in use #16032

@holograph

Description

@holograph

What Happened?

I've verified that the following happens on:

  • Windows 11, minikube v1.29.0, Docker Desktop v20.10.23
  • MacOS 13.2.1 (Apple M1), minikube v1.29.0, Docker Desktop v20.10.23

When attempting to overwrite an image that already exists and is in use by a running container, the following happens:

  1. The image listed in the minikube Docker context doesn't change (verified via minikube docker-env as well as directly via minikube ssh; the running container has the same image ID listed even after restart).
  2. The command actually fails silently (no output or exit code). Adding --alsologtostderr -v=2 showcases the real problem, see listing below (edited for brevity and identifying information).

Expected results:

  1. Image is updated in the minikube Docker context (fresh image ID in docker inspect + updated images when restarting containers)
  2. Loading a new repo/image:tag combination makes it available in the local Docker context without affecting existing versions (or at least not pruning images in use), i.e. the operation should be idempotent and not affect running containers in the cluster

Attach the log file

C:\work>call minikube image load -v=2 --alsologtostderr :latest
I0312 12:23:03.452060 13268 config.go:180] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.26.1
I0312 12:23:03.452060 13268 localpath.go:146] windows sanitize: C:\Users\Tomer Gabel.minikube\cache\images\amd64<elided>:latest -> C:\Users\Tomer Gabel.minikube\cache\images\amd64<elided>_latest
I0312 12:23:03.518637 13268 cache.go:107] acquiring lock: {Name:mke5e77430a5115bfec9d416d57a1ce605f867e8 Clock:{} Delay:500ms Timeout:10m0s Cancel:}
I0312 12:23:03.518637 13268 image.go:134] retrieving image: :latest
I0312 12:23:03.523927 13268 image.go:173] found :latest locally: &{ref:{Repository:{Registry:{insecure:false registry:} repository:} tag:latest original::latest} opener:0xc000ef4b60 tarballImage: id:0xc0005a1180 once:{done:0 m:{state:0 sema:0}} err:}
I0312 12:23:03.523951 13268 cache.go:162] opening: \?\Volume{2a631cad-8831-474c-990c-9d491179baea}\Users\Tomer Gabel.minikube\cache\images\amd64<elided>_latest
I0312 12:24:03.083014 13268 cache.go:157] \?\Volume{2a631cad-8831-474c-990c-9d491179baea}\Users\Tomer Gabel.minikube\cache\images\amd64<elided>_latest exists
I0312 12:24:03.083506 13268 cache.go:96] cache image ":latest" -> "C:\Users\Tomer Gabel\.minikube\cache\images\amd64\_latest" took 59.6309196s
I0312 12:24:03.084947 13268 cache.go:80] save to tar file :latest -> C:\Users\Tomer Gabel.minikube\cache\images\amd64<elided>_latest succeeded
I0312 12:24:03.085976 13268 cache.go:87] Successfully saved all images to host disk.
I0312 12:24:03.086493 13268 config.go:180] Loaded profile config "minikube": Driver=docker, ContainerRuntime=docker, KubernetesVersion=v1.26.1
I0312 12:24:03.092144 13268 cli_runner.go:164] Run: docker container inspect minikube --format={{.State.Status}}
I0312 12:24:03.180442 13268 ssh_runner.go:195] Run: systemctl --version
I0312 12:24:03.183008 13268 cli_runner.go:164] Run: docker container inspect -f "'{{(index (index .NetworkSettings.Ports "22/tcp") 0).HostPort}}'" minikube
I0312 12:24:03.269653 13268 sshutil.go:53] new ssh client: &{IP:127.0.0.1 Port:52378 SSHKeyPath:C:\Users\Tomer Gabel.minikube\machines\minikube\id_rsa Username:docker}
I0312 12:24:03.349854 13268 cache_images.go:88] LoadImages start: [:latest]
I0312 12:24:03.357620 13268 ssh_runner.go:195] Run: docker image inspect --format {{.Id}} :latest
I0312 12:24:03.370608 13268 cache_images.go:116] ":latest" needs transfer: ":latest" does not exist at hash "sha256:8fc1f5d25500253504025a2a65f852ae5c80c224c9f2b7553608d3f43bc4149e" in container runtime
I0312 12:24:03.371124 13268 docker.go:306] Removing :latest
I0312 12:24:03.373706 13268 ssh_runner.go:195] Run: docker rmi :latest
I0312 12:24:03.385569 13268 cache_images.go:92] LoadImages completed in 35.7153ms
W0312 12:24:03.385569 13268 cache_images.go:254] Failed to load cached images for profile minikube. make sure the profile is running. loading cached images: removing image: remove image docker: docker rmi :latest: Process exited with status 1
stdout:

stderr:
Error response from daemon: conflict: unable to remove repository reference ":latest" (must force) - container 42cd2bcf6d2b is using its referenced image 5c02f5b8a047
I0312 12:24:03.385569 13268 cache_images.go:262] succeeded pushing to:
I0312 12:24:03.386079 13268 cache_images.go:263] failed pushing to: minikube

Operating System

Windows

Driver

Docker

Metadata

Metadata

Assignees

Labels

area/imageIssues/PRs related to the minikube image subcommand

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions