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 run or exec and pipes somehow does not terminate pipes #23931

Closed
ibotty opened this issue Sep 11, 2024 · 2 comments
Closed

podman run or exec and pipes somehow does not terminate pipes #23931

ibotty opened this issue Sep 11, 2024 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@ibotty
Copy link
Contributor

ibotty commented Sep 11, 2024

Issue Description

This happens with rootful and rootless podman.

The same happens with podman exec but the reproduction below is simpler.

Steps to reproduce the issue

Steps to reproduce the issue

  1. echo echo aha | podman run --rm -it registry.fedoraproject.org/fedora-toolbox:40 bash -x
  2. observe (the ^C is me pressing ctrl-c once):
$ echo echo aha | podman run --rm -it registry.fedoraproject.org/fedora-toolbox:40 bash
WARN[0000] The input device is not a TTY. The --tty and --interactive flags might not work properly
echo aha
[root@ed76234e307e /]# echo aha
aha
[root@ed76234e307e /]# ^C^C
[root@ed76234e307e /]#
  1. podman kill -l the container in another shell to get the original shell back

Describe the results you received

see above.

Describe the results you expected

it returns after running the command.

podman info output

:
  arch: amd64
  buildahVersion: 1.37.2
  cgroupControllers:
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.12-2.fc40.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 97.13
    systemPercent: 0.87
    userPercent: 2
  cpus: 16
  databaseBackend: boltdb
  distribution:
    distribution: fedora
    variant: sway-atomic
    version: "40"
  eventLogger: journald
  freeLocks: 2016
  hostname: framework
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 6.10.8-200.fc40.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 47918600192
  memTotal: 65098342400
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.12.2-2.fc40.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.12.2
    package: netavark-1.12.2-1.fc40.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.12.2
  ociRuntime:
    name: crun
    package: crun-1.15-1.fc40.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.15
      commit: e6eacaf4034e84185fd8780ac9262bbf57082278
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20240906.g6b38f07-1.fc40.x86_64
    version: |
      pasta 0^20240906.g6b38f07-1.fc40.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: false
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.2-2.fc40.x86_64
    version: |-
      slirp4netns version 1.2.2
      commit: 0ee2d87523e906518d34a6b423271e4826f71faf
      libslirp: 4.7.0
      SLIRP_CONFIG_VERSION_MAX: 4
      libseccomp: 2.5.5
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 2h 26m 42.00s (Approximately 0.08 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
store:
  configFile: /var/home/tob/.config/containers/storage.conf
  containerStore:
    number: 9
    paused: 0
    running: 4
    stopped: 5
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/tob/.local/share/containers/storage
  graphRootAllocated: 998483427328
  graphRootUsed: 450714636288
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 15
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /var/home/tob/.local/share/containers/storage/volumes
version:
  APIVersion: 5.2.2
  Built: 1724198400
  BuiltTime: Wed Aug 21 02:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.6
  Os: linux
  OsArch: linux/amd64
  Version: 5.2.2

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional information

@ibotty ibotty added the kind/bug Categorizes issue or PR as related to a bug. label Sep 11, 2024
@auyer
Copy link
Contributor

auyer commented Sep 11, 2024

Hi. I was able to reproduce your case, but I was also able to run what you intended.
Check it out:

echo "echo aha" | podman run --interactive docker.io/busybox ash -x

My output:
image

@giuseppe
Copy link
Member

you are passing a pipe as stdin, but requesting to create a terminal. Podman warns you WARN[0000] The input device is not a TTY. The --tty and --interactive flags might not work properly.

Just drop the -t from the command or do not use a pipe as stdin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants