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

Minikube fails to start with docker driver on macOS 11.1. Error: /var/lib/dpkg: no such file or directory #10302

Closed
colli173 opened this issue Jan 28, 2021 · 6 comments
Labels
co/docker-driver Issues related to kubernetes in container kind/bug Categorizes issue or PR as related to a bug. os/macos priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.

Comments

@colli173
Copy link

colli173 commented Jan 28, 2021

Steps to reproduce the issue:

  1. docker system prune --volumes
  2. minikube delete
  3. docker start --driver=docker

Full output of failed command:

πŸ˜„ minikube v1.17.0 on Darwin 11.1
✨ Using the docker driver based on user configuration
πŸ‘ Starting control plane node minikube in cluster minikube
πŸ”₯ Creating docker container (CPUs=2, Memory=1990MB) ...
βœ‹ Stopping node "minikube" ...
πŸ”₯ Deleting "minikube" in docker ...
🀦 StartHost failed, but will try again: creating host: create: creating: create kic node: container name "minikube": log: 2021-01-28T21:19:13.799746495Z + mount
2021-01-28T21:19:13.806546956Z + df -h /var
2021-01-28T21:19:13.809660555Z + find /var/lib/dpkg
2021-01-28T21:19:13.822425814Z find: '/var/lib/dpkg': No such file or directory: container exited unexpectedly
πŸ”₯ Creating docker container (CPUs=2, Memory=1990MB) ...
😿 Failed to start docker container. Running "minikube delete" may fix it: creating host: create: creating: create kic node: container name "minikube": log: 2021-01-28T21:20:01.961530779Z + mount
2021-01-28T21:20:01.964084926Z + df -h /var
2021-01-28T21:20:01.969789288Z + find /var/lib/dpkg
2021-01-28T21:20:01.971640267Z find: '/var/lib/dpkg': No such file or directory: container exited unexpectedly

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

Optional: Full output of minikube logs command:

@afbjorklund
Copy link
Collaborator

afbjorklund commented Jan 28, 2021

The usual reason for this was that a race condition has caused an empty /var to get mounted...

Using --preload=false might help ? But it would be interesting to see, if this is something new.

What docker version was this ? (sad that we don't log it)

The previous issue was #8100

@afbjorklund afbjorklund added co/docker-driver Issues related to kubernetes in container os/macos priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. kind/bug Categorizes issue or PR as related to a bug. labels Jan 28, 2021
@colli173
Copy link
Author

Thanks! I'll try with --preload=false and update here. It may be worth noting I've reproduced this issue with Minikube version 1.16.0 and 1.17.1 as well

╰─❯ docker version
Client: Docker Engine - Community
 Cloud integration: 1.0.7
 Version:           20.10.2
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        2291f61
 Built:             Mon Dec 28 16:12:42 2020
 OS/Arch:           darwin/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.2
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8891c58
  Built:            Mon Dec 28 16:15:28 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

@afbjorklund
Copy link
Collaborator

The previous trick was to run a simple container with a /var volume mount, to make sure docker copied it from the image:

docker run --entrypoint /usr/bin/test -v /var ubuntu:20.04 -d /var/lib

That will create a volume with 4.5 MB of various junk that also happens to be in the /var directory of the ubuntu image...

backups/ cache/ lib/ local/ lock@ log/ mail/ opt/ run@ spool/ tmp/

And then we can go ahead and add the minikube preload data, on top of that.

Instead of replacing the files, that it expects to be present (like /var/lib/dpkg)

@colli173
Copy link
Author

@afbjorklund issue seems to persist with --preload=false. I'll take another look at the /var dir image trick you mentioned too

❯ minikube start --preload=false
πŸ˜„  minikube v1.17.0 on Darwin 11.1
✨  Using the docker driver based on user configuration
πŸ‘  Starting control plane node minikube in cluster minikube
πŸ”₯  Creating docker container (CPUs=2, Memory=1990MB) ...
βœ‹  Stopping node "minikube"  ...
πŸ”₯  Deleting "minikube" in docker ...
🀦  StartHost failed, but will try again: creating host: create: creating: create kic node: container name "minikube": log: 2021-01-28T23:09:12.620840500Z  + mount
2021-01-28T23:09:12.622663400Z  + df -h /var
2021-01-28T23:09:12.624084000Z  + find /var/lib/dpkg
2021-01-28T23:09:12.625627800Z  find: '/var/lib/dpkg': No such file or directory: container exited unexpectedly
πŸ”₯  Creating docker container (CPUs=2, Memory=1990MB) ...
😿  Failed to start docker container. Running "minikube delete" may fix it: creating host: create: creating: create kic node: container name "minikube": log: 2021-01-28T23:09:58.116230900Z  + mount
2021-01-28T23:09:58.118790900Z  + df -h /var
2021-01-28T23:09:58.120561100Z  + find /var/lib/dpkg
2021-01-28T23:09:58.121964700Z  find: '/var/lib/dpkg': No such file or directory: container exited unexpectedly

πŸ’’  The minikube docker container exited unexpectedly.

@colli173
Copy link
Author

I've been able to get Minikube 1.17.0 running again by selecting Clean/Purge data from the troubleshoot section of the Docker Desktop app and then running minikube start --driver=docker. For whatever reason that worked when docker system prune --volumes wouldn't. Perhaps it's a more comprehensive purge when run from the app

@olivierACRI
Copy link

Hi,
I fall into the same issue but without any luck fixing it properly, so here is my 2 cents comment that could help people.
I was using the profile feature in minikube (-p PROFILE_NAME), doing so, I was able to change the profile and the issue vanished.

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. os/macos priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done.
Projects
None yet
Development

No branches or pull requests

3 participants