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

Error: podman version takes no arguments #25162

Closed
som1ein opened this issue Jan 30, 2025 · 3 comments
Closed

Error: podman version takes no arguments #25162

som1ein opened this issue Jan 30, 2025 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. remote Problem is in podman-remote windows issue/bug on Windows

Comments

@som1ein
Copy link

som1ein commented Jan 30, 2025

Issue Description

I am trying to use Podman for devcontainers inside VSCode on Windows 10 using WSL2.

I have cloned the basic vscode-remote-try-node repository and I am trying to open it inside VSCode using "Dev Containers: Open Folder in Container..." command.

The command fails to execute.

Steps to reproduce the issue

Steps to reproduce the issue

Follow the VSCode Devcontainers - Getting Started guide:

  1. Clone https://github.com/Microsoft/vscode-remote-try-node locally.
  2. Open VSCode
  3. Execute the "Dev Containers: Open Folder in Container..." command
  4. See the error output in the VSCode terminal

Describe the results you received

VSCode terminal reports:

[36692 ms] Stop (24 ms): Run in Host: podman version --format {{json .}}
[36692 ms] Exit code 125
[36695 ms] CLI host's PATH: undefined
[36695 ms] Windows build number: 19045
[36704 ms] WSL feature installed: true (dll path: C:\Windows\System32\lxss\LxssManager.dll)

Running the same command on the Windows host (under cmd):

> podman version -f '{{json .}}'
Error: `podman version` takes no arguments
> podman version --help
Display the Podman version information

Description:


Usage:
  podman version [options]

Options:
  -f, --format string   Change the output format to JSON or a Go template

Describe the results you expected

podman version -f '{{json .}}' outputs version information in the JSON format.

podman info output

host:
  arch: amd64
  buildahVersion: 1.38.0
  cgroupControllers:
  - cpuset
  - cpu
  - cpuacct
  - blkio
  - memory
  - devices
  - freezer
  - net_cls
  - perf_event
  - net_prio
  - hugetlb
  - pids
  - rdma
  - misc
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.1.12-2.fc40.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.12, commit: '
  cpuUtilization:
    idlePercent: 99.92
    systemPercent: 0.04
    userPercent: 0.03
  cpus: 16
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: container
    version: "40"
  eventLogger: journald
  freeLocks: 2046
  hostname: COMPUTER
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 5.15.167.4-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 14732828672
  memTotal: 16515416064
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.13.1-1.fc40.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.13.1
    package: netavark-1.13.1-1.fc40.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.13.1
  ociRuntime:
    name: crun
    package: crun-1.19.1-1.fc40.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.19.1
      commit: 3e32a70c93f5aa5fea69b50256cca7fd4aa23c80
      rundir: /run/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^20241211.g09478d5-1.fc40.x86_64
    version: |
      pasta 0^20241211.g09478d5-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: true
    path: unix:///run/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: false
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: false
  serviceIsRemote: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 20h 13m 58.00s (Approximately 0.83 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 1
    paused: 0
    running: 0
    stopped: 1
  graphDriverName: overlay
  graphOptions:
    overlay.imagestore: /usr/lib/containers/storage
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 1288646656
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 1
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.3.1
  Built: 1732147200
  BuiltTime: Thu Nov 21 01:00:00 2024
  GitCommit: ""
  GoVersion: go1.22.7
  Os: linux
  OsArch: linux/amd64
  Version: 5.3.1

Podman in a container

Yes

Privileged Or Rootless

None

Upstream Latest Release

Yes

Additional environment details

Podman version information

> podman version
Client:       Podman Engine
Version:      5.3.2
API Version:  5.3.2
Go Version:   go1.23.5
Git Commit:   85043bb1a3818102194afa82845cb63841067c9c
Built:        Wed Jan 22 14:42:46 2025
OS/Arch:      windows/amd64

Server:       Podman Engine
Version:      5.3.1
API Version:  5.3.1
Go Version:   go1.22.7
Built:        Thu Nov 21 01:00:00 2024
OS/Arch:      linux/amd64

Host system information (abbreviated)

> systeminfo

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19045 N/A Build 19045
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 141 Stepping 1 GenuineIntel ~2496 Mhz
Total Physical Memory:     32,276 MB
Available Physical Memory: 10,144 MB
Virtual Memory: Max Size:  50,156 MB
Virtual Memory: Available: 6,060 MB
Virtual Memory: In Use:    44,096 MB

WSL version information

> wsl --version
WSL version: 2.3.26.0
Kernel version: 5.15.167.4-1
WSLg version: 1.0.65
MSRDC version: 1.2.5620
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26100.1-240331-1435.ge-release
Windows version: 10.0.19045.5371

VSCode version
URL: https://code.visualstudio.com/

> code --version
1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
x64

VSCode devcontainers Extension
URL: https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers

Identifier ms-vscode-remote.remote-containers
Version 0.394.0
Last Updated 2025-01-23, 17:14:49

Additional information

The issue happens always.

@som1ein som1ein added the kind/bug Categorizes issue or PR as related to a bug. label Jan 30, 2025
@github-actions github-actions bot added remote Problem is in podman-remote windows issue/bug on Windows labels Jan 30, 2025
@som1ein
Copy link
Author

som1ein commented Jan 30, 2025

I think the problematic code might be here:

Args: validate.NoArgs,

cobra/args.go :

NoArgs returns an error if any args are included.

https://github.com/spf13/cobra/blob/e94f6d0dd9a5e5738dca6bce03c4b1207ffbc0ec/args.go#L41C1-L42C1

@som1ein
Copy link
Author

som1ein commented Jan 30, 2025

Just found out that using single-quotes for arguments doesn't work as expected in Windows cmd.

If I run the following command in cmd, the version --format works as expected:

> podman version --format "{{json .}}"
{"Client":{"APIVersion":"5.3.2","Version":"5.3.2","GoVersion":"go1.23.5","GitCommit":"85043bb1a3818102194afa82845cb63841067c9c","BuiltTime":"Wed Jan 22 14:42:46 2025","Built":1737553366,"OsArch":"windows/amd64","Os":"windows"},"Server":{"APIVersion":"5.3.1","Version":"5.3.1","GoVersion":"go1.22.7","GitCommit":"","BuiltTime":"Thu Nov 21 01:00:00 2024","Built":1732147200,"OsArch":"linux/amd64","Os":"linux"}}

I think this is probably an issue in the VSCode extension command invocation and not in Podman.

@Luap99
Copy link
Member

Luap99 commented Jan 30, 2025

Yes version does not take any args so that is expected. If windows is incorrectly escaping arguments that is not something we can fix in podman. We just get an an array of args.

I think it might work when you use powershell.

@Luap99 Luap99 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2025
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. remote Problem is in podman-remote windows issue/bug on Windows
Projects
None yet
Development

No branches or pull requests

2 participants