kubernetes/minikube

`minikube start` doesn't stop after download failure due to network issues

Open

#10,164 opened on Jan 18, 2021

View on GitHub
 (9 comments) (0 reactions) (1 assignee)Go (5,222 forks)batch import
co/docker-driverhelp wantedkind/buglifecycle/frozenpriority/backlog

Repository metrics

Stars
 (31,799 stars)
PR merge metrics
 (Avg merge 12d 19h) (43 merged PRs in 30d)

Description

I'm testing the minikube network connection issues in China and happened to find there is a potential bug:

After all image fallback addresses failed, minikube didn't stop to the process as expected, and failed later due to lack of valid images.

Steps to reproduce the issue: os version: macOs catalina 10.15.7 minikube version: v1.16.0 commit: 9f1e482427589ff8451c4723b6ba53bb9742fbb1

minikube start --driver=virtualbox --v=1 --alsologtostderr

Full output of failed command: I0114 22:46:46.233396 10344 cache.go:159] failed to download docker.pkg.github.com/kubernetes/minikube/kicbase:v0.0.15-snapshot4, will try fallback image if available: GET https://docker.pkg.github.com/v2/kubernetes/minikube/kicbase/manifests/v0.0.15-snapshot4: UNAUTHORIZED: GitHub Docker Registry needs login E0114 22:46:46.233427 10344 cache.go:180] Error downloading kic artifacts: failed to download kic base image or any fallback image I0114 22:46:46.233444 10344 cache.go:185] Successfully downloaded all kic artifacts I0114 22:46:46.233473 10344 start.go:314] acquiring machines lock for minikube: {Name:mkb987fd896c2845336bd726163c7ebf1c4ecf2e Clock:{} Delay:500ms Timeout:10m0s Cancel:} I0114 22:46:46.233601 10344 start.go:318] acquired machines lock for "minikube" in 114.554µs I0114 22:46:46.233634 10344 start.go:90] Provisioning new machine with config: &{Name:minikube KeepContext:false EmbedCerts:false MinikubeISO: KicBaseImage:registry.cn-hangzhou.aliyuncs.com/google_containers/kicbase:v0.0.15-snapshot4@sha256:ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb3

I checked the master code:

In pkg/minikube/node/cache.go, in function "beginDownloadKicBaseImage", if all fallback addresses fails, it returns:

fmt.Errorf("failed to download kic base image or any fallback image")

I think it should wrap the type of the error here, so the function "waitDownloadKicBaseImage" could go to the desired branch and exit.

Contributor guide