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

docker driver: don't mount to /var as it causes race condition #8179

Closed
polzka90 opened this issue May 16, 2020 · 16 comments · Fixed by #8777
Closed

docker driver: don't mount to /var as it causes race condition #8179

polzka90 opened this issue May 16, 2020 · 16 comments · Fixed by #8777
Assignees
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. needs-solution-message Issues where where offering a solution for an error would be helpful os/windows priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@polzka90
Copy link

Steps to reproduce the issue:

Im following the official guide to use minikube and i am getting an error inside the container image

INFO: ensuring we can execute /bin/mount even with userns-remap

INFO: remounting /sys read-only

INFO: making mounts shared

INFO: fix cgroup mounts for all subsystems

INFO: clearing and regenerating /etc/machine-id

Initializing machine ID from random generator.

INFO: faking /sys/class/dmi/id/product_name to be "kind"

INFO: faking /sys/class/dmi/id/product_uuid to be random

INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well

INFO: setting iptables to detected mode: legacy

update-alternatives: error: no alternatives for iptables

i use windows 10 and my docker desktop version is 2.3.0.2

Full output of failed command:
I0516 17:24:50.867547 12524 start.go:99] hostinfo: {"hostname":"DESKTOP-CFDRBNO","uptime":28728,"bootTime":1589631962,"procs":243,"os":"windows","platform":"Microsoft Windows 10 Enterprise","platformFamily":"Standalone Workstation","platformVersion":"10.0.18362 Build 18362","kernelVersion":"","virtualizationSystem":"","virtualizationRole":"","hostid":"d16cd74e-4922-43f3-8935-a8a21e85fb43"}
W0516 17:24:50.867547 12524 start.go:107] gopshost.Virtualization returned error: not implemented yet

  • minikube v1.10.1 on Microsoft Windows 10 Enterprise 10.0.18362 Build 18362
    I0516 17:24:50.881545 12524 notify.go:125] Checking for updates...
    I0516 17:24:50.884546 12524 driver.go:253] Setting default libvirt URI to qemu:///system
    I0516 17:24:51.279998 12524 docker.go:95] docker version: linux-19.03.8
  • Using the docker driver based on existing profile
    I0516 17:24:51.285999 12524 start.go:215] selected driver: docker
    I0516 17:24:51.286998 12524 start.go:594] validating driver "docker" against &{Name:minikube KeepContext:false EmbedCerts:false MinikubeISO: KicBaseImage:gcr.io/k8s-minikube/kicbase:v0.0.10@sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438 Memory:1989 CPUs:2 DiskSize:20000 Driver:docker HyperkitVpnKitSock: HyperkitVSockPorts:[] DockerEnv:[] InsecureRegistry:[] RegistryMirror:[] HostOnlyCIDR:192.168.99.1/24 HypervVirtualSwitch: HypervUseExternalSwitch:false HypervExternalAdapter: KVMNetwork:default KVMQemuURI:qemu:///system KVMGPU:false KVMHidden:false DockerOpt:[] DisableDriverMounts:false NFSShare:[] NFSSharesRoot:/nfsshares UUID: NoVTXCheck:false DNSProxy:false HostDNSResolver:true HostOnlyNicType:virtio NatNicType:virtio KubernetesConfig:{KubernetesVersion:v1.18.2 ClusterName:minikube APIServerName:minikubeCA APIServerNames:[] APIServerIPs:[] DNSDomain:cluster.local ContainerRuntime:docker CRISocket: NetworkPlugin: FeatureGates: ServiceCIDR:10.96.0.0/12 ImageRepository: LoadBalancerStartIP: LoadBalancerEndIP: ExtraOptions:[{Component:kubeadm Key:pod-network-cidr Value:10.244.0.0/16}] ShouldLoadCachedImages:true EnableDefaultCNI:false NodeIP: NodePort:8443 NodeName:} Nodes:[{Name: IP: Port:8443 KubernetesVersion:v1.18.2 ControlPlane:true Worker:true}] Addons:map[] VerifyComponents:map[apiserver:true system_pods:true]}
    I0516 17:24:51.286998 12524 start.go:600] status for docker: {Installed:true Healthy:true Error: Fix: Doc:}
    I0516 17:24:51.287999 12524 start.go:917] auto setting extra-config to "kubeadm.pod-network-cidr=10.244.0.0/16".
  • Starting control plane node minikube in cluster minikube
    I0516 17:24:51.292004 12524 cache.go:104] Beginning downloading kic artifacts for docker with docker
    I0516 17:24:51.464001 12524 image.go:88] Found gcr.io/k8s-minikube/kicbase:v0.0.10@sha256:f58e0c4662bac8a9b5dda7984b185bad8502ade5d9fa364bf2755d636ab51438 in local docker daemon, skipping pull
    I0516 17:24:51.464001 12524 preload.go:81] Checking if preload exists for k8s version v1.18.2 and runtime docker
    I0516 17:24:51.465998 12524 preload.go:96] Found local preload: C:\Users\Lepa.minikube\cache\preloaded-tarball\preloaded-images-k8s-v3-v1.18.2-docker-overlay2-amd64.tar.lz4
    I0516 17:24:51.465998 12524 cache.go:48] Caching tarball of preloaded images
    I0516 17:24:51.466999 12524 preload.go:122] Found C:\Users\Lepa.minikube\cache\preloaded-tarball\preloaded-images-k8s-v3-v1.18.2-docker-overlay2-amd64.tar.lz4 in cache, skipping download
    I0516 17:24:51.467999 12524 cache.go:51] Finished verifying existence of preloaded tar for v1.18.2 on docker
    I0516 17:24:51.468998 12524 profile.go:156] Saving config to C:\Users\Lepa.minikube\profiles\minikube\config.json ...
    I0516 17:24:51.470998 12524 cache.go:132] Successfully downloaded all kic artifacts
    I0516 17:24:51.471998 12524 start.go:223] acquiring machines lock for minikube: {Name:mkd0ecf026d95e036f7a91a8d78fbc6cb8d50d6f Clock:{} Delay:500ms Timeout:15m0s Cancel:}
    I0516 17:24:51.471998 12524 start.go:227] acquired machines lock for "minikube" in 0s
    I0516 17:24:51.471998 12524 start.go:87] Skipping create...Using existing machine configuration
    I0516 17:24:51.472998 12524 fix.go:53] fixHost starting:
    I0516 17:24:51.519001 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:51.656003 12524 fix.go:105] recreateIfNeeded on minikube: state=Stopped err=
    W0516 17:24:51.656998 12524 fix.go:131] unexpected machine state, will restart:
  • Restarting existing docker container for "minikube" ...
    I0516 17:24:51.687998 12524 cli_runner.go:108] Run: docker start minikube
    I0516 17:24:52.246999 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:52.604000 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:52.758997 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:52.918001 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.080999 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.245998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.409997 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.568998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.736997 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:53.896998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:54.072998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:54.263997 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:54.476998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:54.679004 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:54.936998 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:55.223011 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:55.602012 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:56.047013 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:56.602057 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:57.632049 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:58.584195 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:24:59.911981 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:02.223268 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:06.390494 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:14.200094 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:21.035955 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:31.262799 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:31.408802 12524 fix.go:55] fixHost completed within 39.9348019s
    I0516 17:25:31.408802 12524 start.go:74] releasing machines lock for "minikube", held for 39.9368033s
    ! StartHost failed, but will try again: driver start: expected container state be running but got "Stopped"
    I0516 17:25:36.411282 12524 start.go:223] acquiring machines lock for minikube: {Name:mkd0ecf026d95e036f7a91a8d78fbc6cb8d50d6f Clock:{} Delay:500ms Timeout:15m0s Cancel:}
    I0516 17:25:36.412285 12524 start.go:227] acquired machines lock for "minikube" in 0s
    I0516 17:25:36.414276 12524 start.go:87] Skipping create...Using existing machine configuration
    I0516 17:25:36.414276 12524 fix.go:53] fixHost starting:
    I0516 17:25:36.465281 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:36.609284 12524 fix.go:105] recreateIfNeeded on minikube: state=Stopped err=
    W0516 17:25:36.609284 12524 fix.go:131] unexpected machine state, will restart:
  • Restarting existing docker container for "minikube" ...
    I0516 17:25:36.637277 12524 cli_runner.go:108] Run: docker start minikube
    I0516 17:25:37.097246 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:37.408239 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:37.569241 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:37.726240 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:37.892239 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.052244 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.218241 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.388240 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.553239 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.727241 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:38.892241 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:39.079242 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:39.267241 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:39.495240 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:39.734409 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:40.002405 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:40.386424 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:40.914258 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:42.952233 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:43.788253 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:45.090653 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:46.497019 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:25:48.603142 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:26:10.953385 12524 cli_runner.go:108] Run: docker inspect minikube --format={{.State.Status}}
    I0516 17:26:11.106385 12524 fix.go:55] fixHost completed within 34.6921086s
    I0516 17:26:11.106385 12524 start.go:74] releasing machines lock for "minikube", held for 34.6931059s
  • Failed to start docker container. "minikube start" may fix it: driver start: expected container state be running but got "Stopped"
    I0516 17:26:11.109383 12524 exit.go:58] WithError(error provisioning host)=Failed to start host: driver start: expected container state be running but got "Stopped" called from:
    goroutine 1 [running]:
    runtime/debug.Stack(0x40acf1, 0x18d3660, 0x18b8300)
    /usr/local/go/src/runtime/debug/stack.go:24 +0xa4
    k8s.io/minikube/pkg/minikube/exit.WithError(0x1b3f8de, 0x17, 0x1dfc340, 0xc000396640)
    /app/pkg/minikube/exit/exit.go:58 +0x3b
    k8s.io/minikube/cmd/minikube/cmd.runStart(0x2b53760, 0xc0002f5410, 0x0, 0x1)
    /app/cmd/minikube/cmd/start.go:170 +0xac9
    github.com/spf13/cobra.(*Command).execute(0x2b53760, 0xc0002f5400, 0x1, 0x1, 0x2b53760, 0xc0002f5400)
    /go/pkg/mod/github.com/spf13/[email protected]/command.go:846 +0x2b1
    github.com/spf13/cobra.(*Command).ExecuteC(0x2b527a0, 0x0, 0x0, 0xc000005001)
    /go/pkg/mod/github.com/spf13/[email protected]/command.go:950 +0x350
    github.com/spf13/cobra.(*Command).Execute(...)
    /go/pkg/mod/github.com/spf13/[email protected]/command.go:887
    k8s.io/minikube/cmd/minikube/cmd.Execute()
    /app/cmd/minikube/cmd/root.go:112 +0x6f5
    main.main()
    /app/cmd/minikube/main.go:66 +0xf1
    W0516 17:26:11.110383 12524 out.go:201] error provisioning host: Failed to start host: driver start: expected container state be running but got "Stopped"

Optional: Full output of minikube logs command:

@afbjorklund
Copy link
Collaborator

afbjorklund commented May 17, 2020

Probably same as #8100, triggered by enabling Docker Desktop file sharing.

Try minikube start --driver=docker --preload=false

@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container os/windows triage/duplicate Indicates an issue is a duplicate of other open issue. labels May 17, 2020
@polzka90
Copy link
Author

I tried but i get the same error like here #7818
later i try to use minikube start --driver=none --preload=false and i get this

The existing "minikube" VM was created using the "docker" driver, and is incompatible with the "none" driver.

later i tried to create the VM using minikube start -p minikubenone --vm-driver=none but i get
The driver 'none' is not supported on windows

@afbjorklund
Copy link
Collaborator

Kubernetes requires Linux, so you can't run the "none" driver (kubeadm) on a Windows host.

@polzka90
Copy link
Author

ok i will try to do the minikube guide in ubuntu, thanks for the help

@afbjorklund
Copy link
Collaborator

Were you able to try disabling preloading, while using Docker Desktop ?

minikube start --driver=docker --preload=false

@polzka90
Copy link
Author

polzka90 commented May 17, 2020

yes i was try but i get the same error of #7818

@afbjorklund
Copy link
Collaborator

That was about another architecture, it seems unlikely here (unless you run Windows on ARM)

Just wondered if this was the issue as #8100 or not, but if you want to swich to Ubuntu that's OK

@kitos9112
Copy link

Despite this issue being closed as a duplicate, I hit the exact same issue as clearly described/depicted here. @afbjorklund workaround by removing the preload=false did fix the initialisation errors.
All good now!

@polzka90
Copy link
Author

Sorry but i tried using preload=false without success. Let me know if you want to see another log, i still have the docker with the minikube in my windows

@rh01
Copy link

rh01 commented May 27, 2020

minikube  start --network-plugin=cni --driver=docker  --base-image=gcr.io/k8s-minikube/kicbase:v0.0.10 --preload=false
😄  minikube v1.10.1 on Centos 7.6.1810
✨  Using the docker driver based on existing profile
👍  Starting control plane node minikube in cluster minikube
🤷  docker "minikube" container is missing, will recreate.
E0527 14:38:41.205406  135861 oci.go:79] docker daemon seems to be stuck. Please try restarting your docker. Will try to delete anyways: unknown state "minikube": docker inspect minikube --format={{.State.Status}}: exit status 1
stdout:


stderr:
Template parsing error: template: :1:8: executing "" at <.State.Status>: map has no entry for key "State"
🔥  Creating docker container (CPUs=2, Memory=32100MB) ...
🤦  StartHost failed, but will try again: recreate: creating host: create: creating: prepare kic ssh: apply authorized_keys file ownership, output
** stderr **
Error response from daemon: Container ab98f509e5966ebe7338783bd1da5a4dae4512d3f0abe12b7ced51647f0785ea is not running

** /stderr **: chown docker:docker /home/docker/.ssh/authorized_keys: exit status 1
stdout:

stderr:
Error response from daemon: Container ab98f509e5966ebe7338783bd1da5a4dae4512d3f0abe12b7ced51647f0785ea is not running

🔄  Restarting existing docker container for "minikube" ...

I also stuck here, I run CentOS7.6, lastest minikube version.

@rh01
Copy link

rh01 commented May 27, 2020

INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables
INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables
INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables

Above is my minikube container logs.

@priyawadhwa priyawadhwa reopened this Jun 17, 2020
@tstromberg tstromberg added kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed triage/duplicate Indicates an issue is a duplicate of other open issue. labels Jun 24, 2020
@priyawadhwa
Copy link

priyawadhwa commented Jun 24, 2020

Hey @rh01 would you mind trying with the kicbase/stable:v0.0.11 image?

The command line would look like:

minikube  start --network-plugin=cni --driver=docker  --base-image=kicbase/stable:v0.0.11 --preload=false

It would be really helpful if you could let us know if that does or doesn't fix the bug; I've been trying to fix it but have found it difficult to reproduce. Thank you!

@priyawadhwa
Copy link

strace output for this failure:

+ mode=legacy
+ echo 'INFO: setting iptables to detected mode: legacy'
INFO: setting iptables to detected mode: legacy
+ strace -f update-alternatives --set iptables /usr/sbin/iptables-legacy --verbose
execve("/usr/bin/update-alternatives", ["update-alternatives", "--set", "iptables", "/usr/sbin/iptables-legacy", "--verbose"], 0x7ffd729e8468 /* 8 vars */) = 0
brk(NULL)                               = 0x562dd6aa0000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffd9de94360) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=12194, ...}) = 0
mmap(NULL, 12194, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fadb9be9000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360r\2\0\0\0\0\0"..., 832) = 832
lseek(3, 64, SEEK_SET)                  = 64
read(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784) = 784
lseek(3, 848, SEEK_SET)                 = 848
read(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32) = 32
lseek(3, 880, SEEK_SET)                 = 880
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0!U\364U\255V\275\207\34\202%\274\312\205\356%"..., 68) = 68
fstat(3, {st_mode=S_IFREG|0755, st_size=2025032, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fadb9be7000
lseek(3, 64, SEEK_SET)                  = 64
read(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784) = 784
lseek(3, 848, SEEK_SET)                 = 848
read(3, "\4\0\0\0\20\0\0\0\5\0\0\0GNU\0\2\0\0\300\4\0\0\0\3\0\0\0\0\0\0\0", 32) = 32
lseek(3, 880, SEEK_SET)                 = 880
read(3, "\4\0\0\0\24\0\0\0\3\0\0\0GNU\0!U\364U\255V\275\207\34\202%\274\312\205\356%"..., 68) = 68
mmap(NULL, 2032984, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7fadb99f6000
mmap(0x7fadb9a1b000, 1540096, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x7fadb9a1b000
mmap(0x7fadb9b93000, 303104, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19d000) = 0x7fadb9b93000
mmap(0x7fadb9bdd000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1e6000) = 0x7fadb9bdd000
mmap(0x7fadb9be3000, 13656, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fadb9be3000
close(3)                                = 0
arch_prctl(ARCH_SET_FS, 0x7fadb9be8580) = 0
mprotect(0x7fadb9bdd000, 12288, PROT_READ) = 0
mprotect(0x562dd5584000, 4096, PROT_READ) = 0
mprotect(0x7fadb9c18000, 4096, PROT_READ) = 0
munmap(0x7fadb9be9000, 12194)           = 0
brk(NULL)                               = 0x562dd6aa0000
brk(0x562dd6ac1000)                     = 0x562dd6ac1000
openat(AT_FDCWD, "/var/lib/dpkg/alternatives/iptables", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "update-alternatives: error: ", 28update-alternatives: error: ) = 28
write(2, "no alternatives for iptables", 28no alternatives for iptables) = 28
write(2, "\n", 1
)                       = 1
exit_group(2)                           = ?
+++ exited with 2 +++

@priyawadhwa priyawadhwa changed the title update-alternatives: error: no alternatives for iptables docker driver: don't mount to /var as it causes race condition Jun 26, 2020
@priyawadhwa
Copy link

It seems this bug is caused by a race condition between mounting /var to the container and calling "/var/lib/dpkg/alternatives/iptables" from the entrypoint script

@afbjorklund
Copy link
Collaborator

@priyawadhwa : this problem also applies to the "podman" driver, since it uses the same mounts and the same image and volume setup as the "docker" driver

@medyagh
Copy link
Member

medyagh commented Jul 1, 2020

@priyawadhwa cloud code team also has this issue on mac

they seem to fix it with minikube delete --all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. needs-solution-message Issues where where offering a solution for an error would be helpful os/windows priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
7 participants