podman: Ctrl+C doesn't kill the container using `podman run -i` with podman machine

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

/kind bug

Description

It’s impossible to stop container attached to the terminal (flags -a, -i or -t) by pressing Ctrl+C.

Steps to reproduce the issue:

  1. podmain machine start

  2. podman run -i nginx

  3. press ctrl+c

  4. podman ps --noheading

Describe the results you received:

330f2d2ee822  docker.io/library/nginx:latest  nginx -g daemon o...  14 hours ago  Up 14 hours ago              wonderful_kowalevski

Describe the results you expected:

(empty output)

Additional information you deem important (e.g. issue happens only occasionally): Created and Status in docker ps output are suspicious. They say 14 hours despite the fact that container is several seconds old.

➜  ~ podman run -i --log-level=debug nginx
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called run.PersistentPreRunE(podman run -i --log-level=debug nginx) 
DEBU[0000] SSH Ident Key "/Users/ponimas/.ssh/podman-machine-default" SHA256:tOvATDNZzT3jTcmqxc4SrKQnIicNP17+MTCNpfV3FIk ssh-ed25519 
DEBU[0000] Found SSH_AUTH_SOCK "/var/folders/ff/y12n_58x3yq88ysv7jk864p40000gn/T//ssh-itLGKjzLvN9B/agent.595", ssh-agent signer(s) enabled 
DEBU[0000] SSH Agent Key SHA256:ucuqyTCiUBQSM+huZ1uxzQHtO9OMdHFwrvuUlxwXxMM ssh-rsa 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/_ping 
DEBU[0000] Loading registries configuration "/etc/containers/registries.conf" 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] No credentials matching pierone.stups.zalan.do found in /Users/ponimas/.config/containers/auth.json 
DEBU[0000] Looking up in credential helper pierone based on credHelpers entry in /Users/ponimas/.docker/config.json 
DEBU[0000] Found credentials for pierone.stups.zalan.do in credential helper containers-auth.json in file /Users/ponimas/.docker/config.json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/images/pull 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/create 
INFO[0000] Going to attach to container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" 
DEBU[0000] DoRequest Method: GET URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/json 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/attach 
DEBU[0000] Copying standard streams of container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" in non-terminal mode 
DEBU[0000] Copying STDIN to socket                      
INFO[0000] Going to start container "ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185" 
DEBU[0000] DoRequest Method: POST URI: http://d/v4.1.1/libpod/containers/ca8d4efa8af12f0fe13a9162dd5757d79cfb6196aced5e4da4eee8a36ce48185/start 
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2022/06/22 15:14:23 [notice] 1#1: using the "epoll" event method
2022/06/22 15:14:23 [notice] 1#1: nginx/1.21.6
2022/06/22 15:14:23 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 
2022/06/22 15:14:23 [notice] 1#1: OS: Linux 5.18.5-200.fc36.aarch64
2022/06/22 15:14:23 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
2022/06/22 15:14:23 [notice] 1#1: start worker processes
2022/06/22 15:14:23 [notice] 1#1: start worker process 26
2022/06/22 15:14:23 [notice] 1#1: start worker process 27
^C
➜  ~ 

Output of podman version:

lient:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Tue Jun 14 22:12:46 2022
OS/Arch:      darwin/arm64

Server:       Podman Engine
Version:      4.1.0
API Version:  4.1.0
Go Version:   go1.18.2
Built:        Mon May 30 18:04:32 2022
OS/Arch:      linux/arm64

Output of podman info --debug:

host:
  arch: arm64
  buildahVersion: 1.26.1
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.aarch64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.7
    systemPercent: 0.2
    userPercent: 0.1
  cpus: 2
  distribution:
    distribution: fedora
    variant: coreos
    version: "36"
  eventLogger: journald
  hostname: localhost.localdomain
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
    uidmap:
    - container_id: 0
      host_id: 501
      size: 1
    - container_id: 1
      host_id: 100000
      size: 1000000
  kernel: 5.18.5-200.fc36.aarch64
  linkmode: dynamic
  logDriver: journald
  memFree: 3513565184
  memTotal: 4090519552
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.4.5-1.fc36.aarch64
    path: /usr/bin/crun
    version: |-
      crun version 1.4.5
      commit: c381048530aa750495cf502ddb7181f2ded5b400
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    exists: true
    path: /run/user/501/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
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.aarch64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 0
  swapTotal: 0
  uptime: 4h 22m 12.55s (Approximately 0.17 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /var/home/core/.config/containers/storage.conf
  containerStore:
    number: 2
    paused: 0
    running: 0
    stopped: 2
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/home/core/.local/share/containers/storage
  graphRootAllocated: 106825756672
  graphRootUsed: 3219861504
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 4
  runRoot: /run/user/501/containers
  volumePath: /var/home/core/.local/share/containers/storage/volumes
version:
  APIVersion: 4.1.0
  Built: 1653926672
  BuiltTime: Mon May 30 18:04:32 2022
  GitCommit: ""
  GoVersion: go1.18.2
  Os: linux
  OsArch: linux/arm64
  Version: 4.1.0

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

brew info podman
podman: stable 4.1.1 (bottled), HEAD
Tool for managing OCI containers and pods
https://podman.io/
/opt/homebrew/Cellar/podman/4.1.1 (174 files, 46.4MB) *
  Poured from bottle on 2022-06-16 at 06:53:11
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/podman.rb
License: Apache-2.0
==> Dependencies
Build: go ✘, go-md2man ✘
Required: qemu ✘
==> Options
--HEAD
	Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 19,991 (30 days), 60,518 (90 days), 161,801 (365 days)
install-on-request: 19,812 (30 days), 60,294 (90 days), 161,556 (365 days)
build-error: 4 (30 days)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/~No~

Additional environment details (AWS, VirtualBox, physical, etc.):

OSX Monterey 12.4
MacBook Pro (14-inch, 2021)
Chip:	Apple M1 Max

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Week after next, probably

On Thu, Sep 22, 2022 at 16:30 Alexander Ponimaskin @.***> wrote:

When should we expect a release?

— Reply to this email directly, view it on GitHub https://github.com/containers/podman/issues/14707#issuecomment-1255516906, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3AOCEKK7SINVT3F3S5JWDV7S6UZANCNFSM5ZS6FUOA . You are receiving this because you were mentioned.Message ID: @.***>

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

Looking further, I don’t see a sig-proxy implementation for remote Podman. Should not be difficult to add.