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 resizes content wrongly in terminal #9780

Closed
millerthegorilla opened this issue Mar 22, 2021 · 11 comments
Closed

podman resizes content wrongly in terminal #9780

millerthegorilla opened this issue Mar 22, 2021 · 11 comments
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. stale-issue

Comments

@millerthegorilla
Copy link

millerthegorilla commented Mar 22, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

I've been using podman heavily for the last two months, and across that time I haven't had any point when I haven't had an issue with terminal sizing. The terminal seems to be fixed at the standard 80 columns by 24 rows, and even when I expand the terminal to fill my screen, the lines are wrapping at the 80th column. Also, if my line extends longer than that 80th column, the next line is often slightly garbled, in that it backspaces a couple of chars.
I have the following error message since I created a new pod, a couple of days ago....

WARN[0000] Error resizing exec session c241487039f4d11a00d24c578408798794b4a111294df6f1a168f1ae96c77aeb: cannot resize container c76fd4d8ff602eaa01c46d19a47dc861bf2cb7db620f322ddada4786a9b95f0c exec session c241487039f4d11a00d24c578408798794b4a111294df6f1a168f1ae96c77aeb as it is not running: exec session state improper 

Steps to reproduce the issue:

  1. Run 'podman pod start pod_name'.

  2. Run 'podman exec -it container_name bash'

  3. Error occurs, and terminal text wraps at length slightly less (or perhaps slightly more) than terminal is currently sized at.

WARN[0000] Error resizing exec session c241487039f4d11a00d24c578408798794b4a111294df6f1a168f1ae96c77aeb: cannot resize container c76fd4d8ff602eaa01c46d19a47dc861bf2cb7db620f322ddada4786a9b95f0c exec session c241487039f4d11a00d24c578408798794b4a111294df6f1a168f1ae96c77aeb as it is not running: exec session state imprope


**Describe the results you received:**
lines wrapping at 80 columns even when command window is maximised.
garbled input at beginning of wrapped line.

**Describe the results you expected:**
normal terminal behaviour.

**Additional information you deem important (e.g. issue happens only occasionally):**

**Output of `podman version`:**

podman version 3.1.0-rc1
but was happening with version 2.2.1


**Output of `podman info --debug`:**

$ podman info --debug
host:
arch: amd64
buildahVersion: 1.19.7
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.0.26-1.fc33.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.26, commit: 777074ecdb5e883b9bec233f3630c5e7fa37d521'
cpus: 2
distribution:
distribution: fedora
version: "33"
eventLogger: journald
hostname: localhost.localdomain
idMappings:
gidmap:
- container_id: 0
host_id: 1001
size: 1
- container_id: 1
host_id: 165536
size: 65536
uidmap:
- container_id: 0
host_id: 1001
size: 1
- container_id: 1
host_id: 165536
size: 65536
kernel: 5.11.7-200.fc33.x86_64
linkmode: dynamic
memFree: 841912320
memTotal: 8215302144
ociRuntime:
name: crun
package: crun-0.18-1.fc33.x86_64
path: /usr/bin/crun
version: |-
crun version 0.18
commit: 808420efe3dc2b44d6db9f1a3fac8361dde42a95
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
os: linux
remoteSocket:
path: /run/user/1001/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
rootless: true
seccompEnabled: true
selinuxEnabled: true
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.1.9-1.fc33.x86_64
version: |-
slirp4netns version 1.1.9
commit: 4e37ea557562e0d7a64dc636eff156f64927335e
libslirp: 4.3.1
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.0
swapFree: 4107268096
swapTotal: 4107268096
uptime: 49m 24.31s
registries:
search:

  • registry.fedoraproject.org
  • registry.access.redhat.com
  • registry.centos.org
  • docker.io
    store:
    configFile: /var/home/dev/.config/containers/storage.conf
    containerStore:
    number: 16
    paused: 0
    running: 6
    stopped: 10
    graphDriverName: overlay
    graphOptions:
    overlay.mount_program:
    Executable: /usr/bin/fuse-overlayfs
    Package: fuse-overlayfs-1.4.0-1.fc33.x86_64
    Version: |-
    fusermount3 version: 3.9.3
    fuse-overlayfs: version 1.4
    FUSE library version 3.9.3
    using FUSE kernel interface version 7.31
    graphRoot: /var/home/dev/.local/share/containers/storage
    graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
    imageStore:
    number: 38
    runRoot: /run/user/1001/containers
    volumePath: /var/home/dev/.local/share/containers/storage/volumes
    version:
    APIVersion: 3.1.0-rc1
    Built: 1615309580
    BuiltTime: Tue Mar 9 17:06:20 2021
    GitCommit: ""
    GoVersion: go1.15.8
    OsArch: linux/amd64
    Version: 3.1.0-rc1

**Package info (e.g. output of `rpm -q podman` or `apt list podman`):**

using rpm-ostree, so not sure. podman is in the base refspec tree.


**Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?**

Yes

**Additional environment details (AWS, VirtualBox, physical, etc.):**
fedora silverblue updates applied.
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 22, 2021
@StayPirate
Copy link

Your error is slightly different, but I think this related to a race condition that is currently discussed #9431

@afbjorklund
Copy link
Contributor

It has been there since #9172 and 3.0, and it is seen more often with podman-remote (larger window?)

@millerthegorilla
Copy link
Author

Yh, it looks like it has been reported elsewhere.

I have had this issue since I started, with 2.2.1 about three months ago.

I had to stop using terminology cause the issue was so bad.

I'll leave it open though cause it is slightly different.

@afbjorklund
Copy link
Contributor

The workaround is to call eval $(resize), but it also gets a bit old quickly.

@mheon
Copy link
Member

mheon commented Mar 22, 2021

Alternatively, force a SIGWINCH to Podman (resizing your terminal window ought to be enough).

@millerthegorilla
Copy link
Author

Ah, ok, when it was getting too bad/difficult, I was exiting the container's bash and then rerunning the podman exec bash command, same as sigwinch, I guess.

@StayPirate
Copy link

StayPirate commented Mar 28, 2021

Any idea about which version of Podman will address this bug? It's quite recurrent here in my workflow, I'm wondering if add a workaround, or wait until this will be fixed.
In case I opt for a workaround, can you suggest any solution better than prepend sleep 1 before any command issued via podman exec??

@afbjorklund
Copy link
Contributor

afbjorklund commented Mar 28, 2021

There are two bugs, one was that "resize" comes before it is started (#9172)
and another was that the params were flipped around (#9756).

The first one sometimes leads to COLUMNS=0 LINES=0 and is not fixed,
the second one always lead to COLUMNS=24 LINES=80 but has been fixed.


When Docker had the same bug, we added eval $(resize) to the bashrc.

@StayPirate
Copy link

podman container exec "$_ti" -w "$(pwd)" $container bash -c "resize &>/dev/null && $@" doesn't seem to work.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented May 15, 2021

I am going to close this as a duplicate of #9172

@rhatdan rhatdan closed this as completed May 15, 2021
@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. stale-issue
Projects
None yet
Development

No branches or pull requests

6 participants