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

Windows remote breaks with stdout redirection. #11444

Closed
mook opened this issue Sep 4, 2021 · 5 comments · Fixed by #11550
Closed

Windows remote breaks with stdout redirection. #11444

mook opened this issue Sep 4, 2021 · 5 comments · Fixed by #11550
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.

Comments

@mook
Copy link

mook commented Sep 4, 2021

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

/kind bug

Description

On Windows, redirecting output from podman run results in an error.

Steps to reproduce the issue:

  1. podman.exe help version | more

Describe the results you received:

Error string:

time="2021-09-03T19:28:38-07:00" level=error msg="The handle is invalid."

Describe the results you expected:

Help about the command:

Display the Podman Version Information …

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

  • Running without redirection works.
  • Reproducible on demand.
  • This would be useful for podman run; the bug is also reproducible in that situation.

Output of podman version:

Client:
Version:      3.3.0
API Version:  3.3.0
Go Version:   go1.15.14
Git Commit:   98f252a3a1a8f1ee00f9f96c6ba00500954b5093
Built:        Fri Aug 20 11:29:20 2021
OS/Arch:      windows/amd64

Server:
Version:      3.2.3
API Version:  3.2.3
Go Version:   go1.13.15
Built:        Fri Jul 16 17:00:00 2021
OS/Arch:      linux/amd64

(I don't believe the server version matters here; podman help version shouldn't need a server.)

Output of podman info --debug:

(This is probably irrelevant)
host:
  arch: amd64
  buildahVersion: 1.21.3
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.29-1.1.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.29, commit: unknown'
  cpus: 16
  distribution:
    distribution: '"opensuse-tumbleweed"'
    version: "20210801"
  eventLogger: file
  hostname: wsl
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.19.128-microsoft-standard
  linkmode: dynamic
  memFree: 12594503680
  memTotal: 12872359936
  ociRuntime:
    name: runc
    package: runc-1.0.1-1.1.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.1
      spec: 1.0.2-dev
      go: go1.13.15
      libseccomp: 2.5.1
  os: linux
  remoteSocket:
    path: tcp:127.0.0.1:1234
  security:
    apparmorEnabled: false
_CHROOT
    rootless: false
    seccompEnabled: true
    seccompProfilePath: /etc/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 14m 6.89s
registries:
  search:
  - registry.opensuse.org
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 2
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.2.3
  Built: 1626480000
  BuiltTime: Fri Jul 16 17:00:00 2021
  GitCommit: ""
  GoVersion: go1.13.15
  OsArch: linux/amd64
  Version: 3.2.3

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

On the server side, which isn't needed to reproduce:

# rpm -q podman
podman-3.2.3-1.1.x86_64

The client is freshly downloaded from https://github.com/containers/podman/releases/download/v3.3.0/podman-remote-release-windows.zip

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

Yes (just the client)

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

Windows 10 / WSL2 (using PowerShell and cmd.exe)

@Luap99 Luap99 added the kind/bug Categorizes issue or PR as related to a bug. label Sep 7, 2021
@atykhyy
Copy link
Contributor

atykhyy commented Sep 13, 2021

This same issue is reproduced in releases as far back as 2.0.2. podman-remote-windows from 2.0.1 and 2.0.0 handle redirection correctly. 1.x.x releases fail to start on Windows (known fixed issue #6558).

@atykhyy
Copy link
Contributor

atykhyy commented Sep 13, 2021

This bug also prevents podman from working in alternative Windows consoles such as ConEmu or MSYS2/MingW console:

Anton@DESKTOP MINGW64 ~
$ /c/users/anton/programs/podman.exe
time="2021-09-13T19:04:21+03:00" level=error msg="The handle is invalid."

openshift-merge-robot added a commit that referenced this issue Sep 13, 2021
Fix #11444: remote breaks with stdout redirection
@ultymatom
Copy link

Hello,

I have the same error (that was preventing the creation of volume to work in podman-compose)

I see that there were a merge pull request, but I'm not sure I understand when will this be ready, do we need to wait for next release ? or is there already a version that we can install with the fix ?

(And thank you for the fix !)

@rhatdan
Copy link
Member

rhatdan commented Sep 17, 2021

podman 3.4 rc1 is just being cut.

#11616

@rhatdan
Copy link
Member

rhatdan commented Sep 17, 2021

@lsm5 this seem to be only available in Rawhide. Can we get builds for f34?

mheon pushed a commit to mheon/libpod that referenced this issue Sep 20, 2021
`setConsoleMode` should do nothing if the handle is not a terminal. The proposed change is [exactly what `golang.org/x/term/IsTerminal()` does on Windows](https://cs.opensource.google/go/x/term/+/6886f2df:term_windows.go).

[NO TESTS NEEDED]

Signed-off-by: Anton Tykhyy <[email protected]>
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants