Skip to content

kubectl exec -it <pod> bash hangs after you type exit #13395

Closed

Description

@ncdc

If you run the following

kubectl exec -it <pod> bash
# exit

it will hang instead of returning control to the user in the shell. This is due to various changes to how go-dockerclient handles attach and exec.

I am working on a fix and will have a PR soon.

Activity

  1. added
    priority/backlogHigher priority than priority/awaiting-more-evidence.
    sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.
    on Sep 1, 2015
  2. ghost closed this as completedin #13322on Sep 4, 2015
  3. jiaweizhou commented on Sep 8, 2015

    @jiaweizhou

    It's still can't be use when I run the following

    kubelet exec -it  <pod> sh
    #exit
    

    It will hang the throw an error

    # error: error executing remote command: Error executing command in container: write unix /var/run/docker.sock: broken pipe
    
  4. jiaweizhou commented on Sep 8, 2015

    @jiaweizhou
  5. ncdc commented on Sep 8, 2015

    @ncdc
    MemberAuthor

    What image is your pod running? Can you provide the output when you run
    with DEBUG=1? What Docker version?
    On Mon, Sep 7, 2015 at 10:56 PM jiaweizhou notifications@github.com wrote:

    @ncdc https://github.com/ncdc

    —
    Reply to this email directly or view it on GitHub
    #13395 (comment)
    .

  6. jiaweizhou commented on Sep 9, 2015

    @jiaweizhou

    I am sorry ,I forgot to deploy a new k8 cluster of the branch master .I just use the kubectl builded from the master with the old version of k8 cluster .Thanks for your concern.

  7. Marcofeli commented on Jan 15, 2019

    @Marcofeli

    Hi @ncdc I'm working with the following and I'm having exactly this and other related issues (#13394 #51835).

    kubectl version

    Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T18:02:47Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
    Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.5", GitCommit:"753b2dbc622f5cc417845f0ff8a77f539a4213ea", GitTreeState:"clean", BuildDate:"2018-11-26T14:31:35Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
    

    kubeadm version

    &version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.3", GitCommit:"a4529464e4629c21224b3d52edfe0ea91b072862", GitTreeState:"clean", BuildDate:"2018-09-09T17:59:42Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
    

    kubelet --version

     Kubernetes v1.11.3
    

    docker --version

    Docker version 17.03.2-ce, build f5ec1e2
    

    Before this problem appeared the cluster was working fine, and I didn't change anything when this happened. I just accessed my pod, as usual, and then I tried to exit from it but it just hangs, forcing me to close the terminal. I also tried deleting the pod and creating a new one but the problem persists and the "deleted" pod keeps on "Terminating" status.

    By the way, I'm working with two nodes one master and one slave, both with the same versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

priority/backlogHigher priority than priority/awaiting-more-evidence.sig/api-machineryCategorizes an issue or PR as relevant to SIG API Machinery.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions