Skip to content

Inconsistent fs errors (EIO vs ENOENT) on Windows WSL and Hyper-V providers #27979

@brentobi

Description

@brentobi

Issue Description

Podman throws inconsistent errors (ENOENT vs. EIO) on Windows guests (WSL vs. Hyper-V) for lstat on invalid volume path. (including * in quoted path)

Steps to reproduce the issue

Follow instructions below for hyperv provider.
Then, do the same for WSL provider.
Compare output error codes.

On Windows, (commands for PowerShell 5)

# 1. Create an empty test directory.
mkdir $HOME/podman-ls | Out-Null

# 2. Init machine
powershell.exe -Command { $env:CONTAINERS_MACHINE_PROVIDER="hyperv"; podman machine init guesthyperv --rootful=true --memory=4096 }

# 3. Start machine
powershell.exe -Command { $env:CONTAINERS_MACHINE_PROVIDER="hyperv"; podman machine start guesthyperv }

# 4. Set default connection
powershell.exe -Command { $env:CONTAINERS_MACHINE_PROVIDER="hyperv"; podman system connection default guesthyperv }

# 5. Test: list invalid path
podman run -v="/mnt/c:/mnt/c" --rm registry.access.redhat.com/ubi9/ubi sh -c "ls '/mnt/c/Users/me/podman-ls/*'"
# [HYPERV] => ls: cannot access '/mnt/c/Users/me/podman-ls/*': Input/output error
# [WSL   ] => ls: cannot access '/mnt/c/Users/me/podman-ls/*': No such file or directory

# 6. Test: node-fs.lstat invalid path
podman run -v="/mnt/c:/mnt/c" --rm node:22 sh -c "node --eval 'require(\`"node:fs/promises\`").lstat(\`"/mnt/c/Users/me/podman-ls/*\`")'"
# [HYPERV] => [...] Error: EIO: i/o error, lstat '/mnt/c/Users/me/podman-ls/*' [...]
# [WSL   ] => [...] Error: ENOENT: no such file or directory, lstat '/mnt/c/Users/me/podman-ls/*' [...]

Describe the results you received

For WSL, I got ENOENT.
For Hyper-V, I got EIO.

Describe the results you expected

I'd expect ENOENT for both, because that is how WSL behaves already and because that would be the behaviour for linux, too, afaik.

(Alternatively, at least make it consistent across windows providers, throw EIO for both.)

podman info output

Client:
  APIVersion: 5.7.1
  Built: 1765378491
  BuiltTime: Wed Dec 10 15:54:51 2025
  GitCommit: f845d14e941889ba4c071f35233d09b29d363c75
  GoVersion: go1.25.5
  Os: windows
  OsArch: windows/amd64
  Version: 5.7.1
host:
  arch: amd64
  buildahVersion: 1.42.2
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: cgroupfs
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.13-2.fc43.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: '
  cpuUtilization:
    idlePercent: 98.77
    systemPercent: 0.53
    userPercent: 0.71
  cpus: 8
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: container
    version: "43"
  eventLogger: journald
  freeLocks: 2048
  hostname: my-redacted-hostname
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
  kernel: 6.6.87.2-microsoft-standard-WSL2
  linkmode: dynamic
  logDriver: journald
  memFree: 6055079936
  memTotal: 8170733568
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.17.0-1.fc43.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.17.0
    package: netavark-1.17.0-1.fc43.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.17.0
  ociRuntime:
    name: crun
    package: crun-1.25.1-1.fc43.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.25.1
      commit: 156ae065d4a322d149c7307034f98d9637aa92a2
      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^20250919.g623dbf6-1.fc43.x86_64
    version: |
      pasta 0^20250919.g623dbf6-1.fc43.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/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: false
  serviceIsRemote: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 2147483648
  swapTotal: 2147483648
  uptime: 0h 8m 13.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - docker.io
store:
  configFile: /home/user/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/user/.local/share/containers/storage
  graphRootAllocated: 1081101176832
  graphRootUsed: 2326265856
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 2
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/user/.local/share/containers/storage/volumes
version:
  APIVersion: 5.7.1
  BuildOrigin: 'Copr: packit/containers-podman-27732'
  Built: 1765238400
  BuiltTime: Tue Dec  9 01:00:00 2025
  GitCommit: f845d14e941889ba4c071f35233d09b29d363c75
  GoVersion: go1.25.4 X:nodwarf5
  Os: linux
  OsArch: linux/amd64
  Version: 5.7.1

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

Yes

Additional environment details

No response

Additional information

With that invalid path, this seems to be an edge case. There might be valid use cases though. (i.e. test suites which check error codes for non-green-paths of their code)

Personally, I ran into this, using js ecosystem code formatter npm:prettier.
It uses npm:fast-glob, which seems to build some paths incorrectly on each call.
On Linux, Windows/WSL/Podman, that does not seem to be a problem, because fast-glob handles ENOENT.
But on Windows/Hyper-V/Podman it causes trouble, because EIO is thrown instead, which is not handled.

I already file a bug with fast-glob. (mrmlnc/fast-glob#499) But the basic issue with Podman persists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.remoteProblem is in podman-remotewindowsissue/bug on Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions