minikube: tarball.Write panic: runtime error: invalid memory address or nil pointer dereference

The exact command to reproduce the issue: minikube start --vm-driver=virtualbox (Administrator)

The full output of the command that failed:

  • Microsoft Windows 10 Pro 10.0.18362 Build 18362 上的 minikube v1.6.2
  • Selecting ‘virtualbox’ driver from user configuration (alternates: [hyperv])
  • 正在创建 virtualbox 虚拟机(CPUs=2,Memory=2000MB, Disk=20000MB)… panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x28 pc=0x12ee976]

goroutine 103 [running]: github.com/google/go-containerregistry/pkg/v1/tarball.Write(0x0, 0xc0003b4030, 0xa, 0xc0003b403b, 0xe, 0xc0003b404a, 0x7, 0x0, 0x0, 0xc00062bc58, …) /go/pkg/mod/github.com/google/go-containerregistry@v0.0.0-20180731221751-697ee0b3d46e/pkg/v1/tarball/write.go:57 +0x136 k8s.io/minikube/pkg/minikube/machine.CacheImage(0xc0003b4030, 0x21, 0xc0004b41e0, 0x46, 0x0, 0x0) /app/pkg/minikube/machine/cache_images.go:395 +0x615 k8s.io/minikube/pkg/minikube/machine.CacheImages.func1(0xc0004aff68, 0x0) /app/pkg/minikube/machine/cache_images.go:85 +0xed golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00033db90, 0xc00033dbf0) /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:57 +0x6b created by golang.org/x/sync/errgroup.(*Group).Go /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:54 +0x6d panic: runtime error: invalid memory address or nil pointer dereference [signal 0xc0000005 code=0x0 addr=0x28 pc=0x12ee976]

goroutine 106 [running]: github.com/google/go-containerregistry/pkg/v1/tarball.Write(0x0, 0xc00055e300, 0xa, 0xc00055e30b, 0x7, 0xc00055e313, 0x5, 0x0, 0x0, 0xc000699c58, …) /go/pkg/mod/github.com/google/go-containerregistry@v0.0.0-20180731221751-697ee0b3d46e/pkg/v1/tarball/write.go:57 +0x136 k8s.io/minikube/pkg/minikube/machine.CacheImage(0xc00055e300, 0x18, 0xc000598180, 0x3d, 0x0, 0x0) /app/pkg/minikube/machine/cache_images.go:395 +0x615 k8s.io/minikube/pkg/minikube/machine.CacheImages.func1(0xc0004adf68, 0x0) /app/pkg/minikube/machine/cache_images.go:85 +0xed golang.org/x/sync/errgroup.(*Group).Go.func1(0xc00033db90, 0xc00033dc80) /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:57 +0x6b created by golang.org/x/sync/errgroup.(*Group).Go /go/pkg/mod/golang.org/x/sync@v0.0.0-20190423024810-112230192c58/errgroup/errgroup.go:54 +0x6d

The output of the minikube logs command:

X command runner: getting ssh client for bootstrapper: Error dialing tcp via ssh client: dial tcp 127.0.0.1:22: connectex: No connection could be made because the target machine actively refused it.

The operating system version: Windows 10 Pro 1903 VirtualBox 6.1.0 platform packages with VirtualBox 6.1.0 Oracle VM VirtualBox Extension Pack Hyper-V Requirements: 虚拟机监视器模式扩展: 是 固件中已启用虚拟化: 是 二级地址转换: 是 数据执行保护可用: 是

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 21 (4 by maintainers)

Most upvoted comments

OMG…Are all Chinese users above? I found that using --image-repository="registry.cn-hangzhou.aliyuncs.com/google_containers" works well. thanks to Alibaba Cloud. hhhhhhh…

However, img variable in Go source code should be checked not equal nil

(This comment is for Chinese users only)

Note: this is fixed in minikube 1.7.0!

OMG…Are all Chinese users above? I found that using --image-repository="registry.cn-hangzhou.aliyuncs.com/google_containers" works well. thanks to Alibaba Cloud. hhhhhhh… However, img variable in Go source code should be checked not equal nil (This comment is for Chinese users only)

Thank you @Veitor , this works for me as well on macOS 10.15.1 with minikube 1.6.2

> minikube delete
🔥  Deleting "minikube" in virtualbox ...
💔  The "minikube" cluster has been deleted.
🔥  Successfully deleted profile "minikube"
> minikube start --vm-driver=virtualbox --image-repository="registry.cn-hangzhou.aliyuncs.com/google_containers"
😄  minikube v1.6.2 on Darwin 10.15.1
✨  Selecting 'virtualbox' driver from user configuration (alternates: [hyperkit])
✅  Using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
🔥  Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
💾  Downloading kubeadm v1.17.0
💾  Downloading kubelet v1.17.0
🚜  Pulling images ...
🚀  Launching Kubernetes ...
⌛  Waiting for cluster to come online ...
🏄  Done! kubectl is now configured to use "minikube"

this works to me

OMG…Are all Chinese users above? I found that using --image-repository="registry.cn-hangzhou.aliyuncs.com/google_containers" works well. thanks to Alibaba Cloud. hhhhhhh…

However, img variable in Go source code should be checked not equal nil

(This comment is for Chinese users only)

Thank you @Veitor , this works for me as well on macOS 10.15.1 with minikube 1.6.2

> minikube delete
🔥  Deleting "minikube" in virtualbox ...
💔  The "minikube" cluster has been deleted.
🔥  Successfully deleted profile "minikube"
> minikube start --vm-driver=virtualbox --image-repository="registry.cn-hangzhou.aliyuncs.com/google_containers"
😄  minikube v1.6.2 on Darwin 10.15.1
✨  Selecting 'virtualbox' driver from user configuration (alternates: [hyperkit])
✅  Using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
🔥  Creating virtualbox VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
🐳  Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
💾  Downloading kubeadm v1.17.0
💾  Downloading kubelet v1.17.0
🚜  Pulling images ...
🚀  Launching Kubernetes ...
⌛  Waiting for cluster to come online ...
🏄  Done! kubectl is now configured to use "minikube"