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

warn about "stuck docker" in minikube delete #6807

Merged
merged 3 commits into from
Feb 26, 2020

Conversation

medyagh
Copy link
Member

@medyagh medyagh commented Feb 26, 2020

Before PR:

delete would hang forever...

because docker container was stuck (however docker itself is healthy and no signs of docker problem but in reality docker needs restart, only way to identify this issue is to do docker inspect on the container and it would hang forever ... (no error) and other docker commands like info or system info were just acting normal)

after this PR:

Fail Fast. Warn User to restart docker.
nothing should hang forever.

🙄  "minikube" profile does not exist, trying anyways.
E0226 12:34:52.650785   31788 oci.go:61] docker daemon seems to be stuck. Please try restarting your docker.
💀  Removed all traces of the "minikube" cluster.```

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2020
pkg/drivers/kic/oci/oci.go Show resolved Hide resolved
// if it doesn't it means docker-daemon is stuck and needs restart
if err != nil {
deleteErrs = append(deleteErrs, errors.Wrapf(err, "delete container %s: -daemon is stuck.", c, ociBin))
glog.Errorf("%s-daemon seems to be stuck. Please try restarting your %s.", ociBin, ociBin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this result in duplicate errors being sent to the console? In general, you either log an error, or return it, but not both.

Copy link
Member Author

@medyagh medyagh Feb 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no because we dont log in parent, we try to delete as much as we can without providing deetails what failed..

cmd := exec.Command(ociBin, "rm", "-f", "-v", c)
if out, err := cmd.CombinedOutput(); err != nil {
deleteErrs = append(deleteErrs, errors.Wrapf(err, "delete container %s: output %s", c, out))
_, err := containerStatus(ociBin, c)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a command available to detect this that does not require querying the status of an individual container?

It seems like it would be better to detect a stuck daemon in a general fashion (like docker status or some other command), rather than one that could be impacted by a container not existing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfortunately that is not the case ! docker status works great ! and it even lets your create new containers

and everything is normal ! only this container is stuck and u can not do anything to it

that was only way I could detect it.

pkg/drivers/kic/oci/oci.go Outdated Show resolved Hide resolved
pkg/drivers/kic/oci/oci.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2020
@codecov-io
Copy link

Codecov Report

Merging #6807 into master will decrease coverage by 0.07%.
The diff coverage is 5.26%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6807      +/-   ##
==========================================
- Coverage    38.5%   38.43%   -0.08%     
==========================================
  Files         142      142              
  Lines        8695     8711      +16     
==========================================
  Hits         3348     3348              
- Misses       4927     4943      +16     
  Partials      420      420
Impacted Files Coverage Δ
pkg/minikube/machine/delete.go 29.72% <0%> (-16.11%) ⬇️
cmd/minikube/cmd/delete.go 24.88% <50%> (ø) ⬆️
pkg/minikube/machine/start.go 53.84% <0%> (-1.16%) ⬇️

@medyagh medyagh changed the title Handle stuck docker daemon in delete warn about "stuck docker" in minikube delete Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants