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

service on docker with Ctrl-C: error stopping tunnel: stopping ssh tunnel: os: process already finished #8511

Open
tstromberg opened this issue Jun 18, 2020 · 16 comments
Assignees
Labels
co/docker-driver Issues related to kubernetes in container co/service issues related to the service feature help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@tstromberg
Copy link
Contributor

This is a useless and necessarily scary error message from minikube service when Ctrl-C is hit on macOS and the Docker driver:

πŸŽ‰  Opening service triage-party/triage-party in default browser...
❗  Because you are using a Docker driver on darwin, the terminal needs to be open to run it.
^Cβœ‹  Stopping tunnel for service triage-party.

πŸ’£  error stopping tunnel: stopping ssh tunnel: os: process already finished

😿  minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰  https://github.com/kubernetes/minikube/issues/new/choose
@tstromberg tstromberg added co/docker-driver Issues related to kubernetes in container co/service issues related to the service feature kind/bug Categorizes issue or PR as related to a bug. labels Jun 18, 2020
@medyagh medyagh added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Jun 18, 2020
@vinu2003
Copy link
Contributor

@tstromberg & @medyagh - I am new to this community and looking to learn and contribute. Can I pick this up ? and start experiment if no one else is looking into it.
Thanks!

@tstromberg
Copy link
Contributor Author

tstromberg commented Jun 19, 2020 via email

@vinu2003
Copy link
Contributor

vinu2003 commented Jun 20, 2020

/assign @vinu2003

@vinu2003
Copy link
Contributor

@tstromberg I have verified this issue in my local macOS setup with docker.
The reason that we get this error is the ssh service tunnel process termination doesn't return 'nil' when the process is-done successfully waited on. The error handling is done here and exit with error.

But the error that is returned from os.signal function in go seems to be private:
(for 2 cases isDone and ERSCH as well)
go/src/os/exec_unix.go

var errFinished = errors.New("os: process already finished")

func (p *Process) signal(sig Signal) error {
	if p.Pid == -1 {
		return errors.New("os: process already released")
	}
	if p.Pid == 0 {
		return errors.New("os: process not initialized")
	}
	p.sigMu.RLock()
	defer p.sigMu.RUnlock()
	if p.done() {
		return errFinished
	}
	s, ok := sig.(syscall.Signal)
	if !ok {
		return errors.New("os: unsupported signal type")
	}
	if e := syscall.Kill(p.Pid, s); e != nil {
		if e == syscall.ESRCH {
			return errFinished
		}
		return e
	}
	return nil
}

And there is discussion/proposal to export errFinished to ErrFinished.
Please note: golang/go#39444

All your concern is about these below lines when SIGINT is sent from.
πŸ’£ error stopping tunnel: stopping ssh tunnel: os: process already finished

😿 minikube is exiting due to an error. If the above message is not useful, open an issue:
πŸ‘‰ https://github.com/kubernetes/minikube/issues/new/choose

I suggest we can get this in place and handle the specific error case here and exit gracefully in minikube/cmd/service.go if it's the proposal is approved.

Keen to know your thoughts on this.

@vinu2003
Copy link
Contributor

Proposal to export errFinished - golang/go#39444 seems to be OK. Its in final comment period.

@vinu2003
Copy link
Contributor

https://go-review.googlesource.com/c/go/+/242998/ - proposal accepted. Once its in we can update and get similar issues error handling addressed correctly.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 14, 2020
@sharifelgamal sharifelgamal removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 2, 2020
@ilya-zuyev
Copy link
Contributor

@vinu2003 are you still interested in fixing this issue?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 18, 2021
@vishjain
Copy link
Contributor

/assign

@sharifelgamal sharifelgamal removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jun 23, 2021
@sharifelgamal
Copy link
Collaborator

Please reach out if you have any questions working on this issue.

@igbanam
Copy link

igbanam commented Jul 12, 2021

I just experienced this issue while going through the Example: Deploying WordPress and MySQL with Persistent Volumes. I know neither Go nor Kubernetes, but I am interested in the latter. So I'm interested in the solution here. I can help test where necessary

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 10, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 9, 2021
@sharifelgamal sharifelgamal added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Nov 17, 2021
@spowelljr spowelljr added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Mar 16, 2022
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 co/service issues related to the service feature help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests