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

Executing an interactive terminal needs keystroke after exiting #1171

Closed
TheOnlyJho opened this issue Jan 2, 2022 · 6 comments · Fixed by #1374
Closed

Executing an interactive terminal needs keystroke after exiting #1171

TheOnlyJho opened this issue Jan 2, 2022 · 6 comments · Fixed by #1374
Assignees
Labels
kind/bug Something isn't working platform/windows
Milestone

Comments

@TheOnlyJho
Copy link

Rancher Desktop Version

0.7.1

Rancher Desktop K8s Version

1.21.7

What operating system are you using?

Windows

Operating System / Build Version

Windows 10 Home 21H1

What CPU architecture are you using?

x64

Windows User Only

No response

Actual Behavior

When you exit an interactive terminal (you can either "docker run" a shell with a container or "docker exec" a shell in an already running one) it waits for a keystroke before you get back to your command shell and it displays its prompt again.

I have been trying to use testcontainers with Rancher Desktop (that's why I used dockerd). Testcontainers executes commands in running containers for example to test for some docker requirements on startup or to see if a container has opened its exposed port.
All this hangs on execution and runs in a Timeout (or just grinds to a halt) and it might be that this is due to the "not really exiting" problem I described here.

Also I think this could break scripts that just execute a single command (like trivy checking etc.).

Steps to Reproduce

Run Rancher Desktop with dockerd container runtime.
In a cmd shell execute "docker run -it --rm alpine sh".
Exit the container shell by executing "exit".

Result

The cmd shell does not display its prompt but you have to press any key to get back into the cmd shell.

Expected Behavior

The command should completely exit and should not wait for a keystroke.

Additional Information

No response

@TheOnlyJho TheOnlyJho added the kind/bug Something isn't working label Jan 2, 2022
@evertonlperes
Copy link
Contributor

Issue replicated on Windows 10 PRO, using both cmd and powershell console.
Linux and macOS are working as expected.

@dblanchette
Copy link

dblanchette commented Jan 5, 2022

Same here on Windows 10 21H1 with Rancher 0.7.1. This break scripts calling docker command since it never knows when the command exited which is a pretty major blocker for us.

@evertonlperes evertonlperes added this to the v1.0.0-beta milestone Jan 5, 2022
@jhollmannk
Copy link

This is the last issue for the 1.0.0-beta milestone. Any chance that this will be fixed soon?
This is the only thing that really prevents us from using RancherDektop because we use testcontainers in our Java-JUnit-Tests and this behaviour breaks almost all the JUnit-Tests.
So a major blocker for us too. Would be great if this was fixed!

@gaktive gaktive modified the milestones: v1.0.0-beta, v1.0.0 Jan 24, 2022
@gaktive
Copy link
Contributor

gaktive commented Jan 25, 2022

@jhollmannk This will take a bit longer, alas, so we'll target this for right after 1.0.

@gaktive gaktive modified the milestones: v1.0.0, v1.0.1 Jan 25, 2022
@mook-as
Copy link
Contributor

mook-as commented Jan 25, 2022

To give more details:
I suspect our proxy process is buffering too much, which means the /containers/{id}/wait connection is not closing properly (so the client couldn't tell when it should detach).

Oddly, watching /wait and force-closing the /attach connection fixes the issue, but that seems… very suspect?

@mook-as
Copy link
Contributor

mook-as commented Jan 27, 2022

Making API calls directly, it appears that /wait actually is working correctly; that returns when the container is closed. So we'll have to forcefully terminate the /attach connection instead (which seems wrong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working platform/windows
Projects
None yet
6 participants