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

podman-remote run -it: failed to resize TTY: container in wrong state "stopped|created" #9831

Closed
edsantiago opened this issue Mar 26, 2021 · 2 comments · Fixed by #9833
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote

Comments

@edsantiago
Copy link
Collaborator

In window 1:

$ ./bin/podman system service --timeout=0

In window 2:

$  ./bin/podman-remote run --rm -it quay.io/libpod/alpine echo hello
hello
WARN[0000] failed to resize TTY: container "87e8cefa1dd42c9a819b76ae758d12a3e2358696320e0f178e0db3deabbb1195" in wrong state "stopped"
WARN[0000] Container 87e8cefa1dd42c9a819b76ae758d12a3e2358696320e0f178e0db3deabbb1195 does not exist: no container with name or ID "87e8cefa1dd42c9a819b76ae758d12a3e2358696320e0f178e0db3deabbb1195" found: no such container

The errors are not deterministic. Sometimes the state is "created" instead of "stopped". Sometimes the second message is an error instead of warning:

$  ./bin/podman-remote run --rm -it quay.io/libpod/alpine echo hello
hello
WARN[0000] failed to resize TTY: container "49980f36f6f2c0adddcdc4949199c2b58020074322617dad897e3188d7756f2c" in wrong state "stopped"
ERRO[0000] Error removing container 49980f36f6f2c0adddcdc4949199c2b58020074322617dad897e3188d7756f2c: error looking up container "49980f36f6f2c0adddcdc4949199c2b58020074322617dad897e3188d7756f2c" mounts: layer not known

(Even though it says ERROR, exit code is always 0).

Sometimes there's no second line at all, only the first.

master @ 9e23e0b

@edsantiago edsantiago added kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote labels Mar 26, 2021
@edsantiago
Copy link
Collaborator Author

Forgot to mention: there's a simple workaround, just add a sleep:

$ ./bin/podman-remote run --rm -it quay.io/libpod/alpine sh -c 'sleep 0.3;echo hello'
hello

0.2 is not quite good enough, and 0.1 is even less good.

@edsantiago
Copy link
Collaborator Author

For reference: flake failure in CI

rhatdan added a commit to rhatdan/podman that referenced this issue Mar 26, 2021
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: containers#9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Mar 26, 2021
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: containers#9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
rhatdan added a commit to rhatdan/podman that referenced this issue Mar 26, 2021
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: containers#9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
mheon pushed a commit to mheon/libpod that referenced this issue Mar 29, 2021
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: containers#9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

<MH: Fixed cherry-pick conflicts>

Signed-off-by: Matthew Heon <mheon@redhat.com>
jmguzik pushed a commit to jmguzik/podman that referenced this issue Apr 26, 2021
Since podman-remote resize requests can come in at random times, this
generates a real potential for race conditions. We should only be
attempting to resize TTY on running containers, but the containers can
go from running to stopped at any time, and returning an error to the
caller is just causing noice.

This change will basically ignore requests to resize terminals if the
container is not running and return the caller to success.  All other
callers will still return failure.

Fixes: containers#9831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. remote Problem is in podman-remote
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant