Skip to content

podman volume mount returns empty path for volume from plugin drivers #27858

@kriansa

Description

@kriansa

Issue Description

When using a volume plugin driver, podman volume mount <volume> successfully mounts the volume but prints an empty string instead of the mount path. Local volumes work correctly. Tested in 5.6.0 as well as on 5.7.1.

[root@stg--test system]# podman volume mount voltest1

[root@stg--test system]#

Steps to reproduce the issue

  1. Set up a volume plugin (any Docker/Podman volume plugin)
  2. Create a volume using the plugin: podman volume create --driver <plugin-name> testvol
  3. Mount the volume: podman volume mount testvol

Describe the results you received

It shows a blank line, whereas for "local" mounts, it shows the path to the volume.

[root@stg--test system]# podman volume mount voltest1

[root@stg--test system]#

Describe the results you expected

It should display the path to the volume, the same I get when I run podman volume inspect voltest1

podman info output

host:
  arch: amd64
  buildahVersion: 1.41.5
  cgroupControllers:
  - cpuset
  - cpu
  - io
  - memory
  - hugetlb
  - pids
  - rdma
  - misc
  - dmem
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.13-1.el10.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: '
  cpuUtilization:
    idlePercent: 99.88
    systemPercent: 0.03
    userPercent: 0.09
  cpus: 8
  databaseBackend: sqlite
  distribution:
    distribution: almalinux
    version: "10.1"
  eventLogger: journald
  freeLocks: 2044
  hostname: stg--test.svc.lan.cx
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 6.12.0-124.21.1.el10_1.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 1014685696
  memTotal: 2034749440
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.16.0-2.el10.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.16.0
    package: netavark-1.16.0-1.el10.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.16.0
  ociRuntime:
    name: crun
    package: crun-1.23.1-1.el10_0.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.23.1
      commit: d20b23dba05e822b93b82f2f34fd5dada433e0c2
      rundir: /run/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  pasta:
    executable: /bin/pasta
    package: passt-0^20250512.g8ec1341-4.el10_1.x86_64
    version: ""
  remoteSocket:
    exists: true
    path: /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: true
  serviceIsRemote: false
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 0
  swapTotal: 0
  uptime: 29h 17m 24.00s (Approximately 1.21 days)
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
  - volume-fs
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /usr/share/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphRootAllocated: 9383706624
  graphRootUsed: 1812062208
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Supports shifting: "true"
    Supports volatile: "true"
    Using metacopy: "true"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 0
  runRoot: /run/containers/storage
  transientStore: false
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 5.6.0
  BuildOrigin: AlmaLinux Packaging Team <packager@almalinux.org>
  Built: 1764720000
  BuiltTime: Wed Dec  3 00:00:00 2025
  GitCommit: 3bf531332cf3895b4a8220532c84e5849824e9e9
  GoVersion: go1.25.3 (Red Hat 1.25.3-1.el10_1.alma.2)
  Os: linux
  OsArch: linux/amd64
  Version: 5.6.0

Podman in a container

No

Privileged Or Rootless

Privileged

Upstream Latest Release

Yes

Additional environment details

N/A

Additional information

In libpod/volume.go, the Mount() function returns v.config. For plugin volumes, however, the mount path is stored in v.state.MountPoint, not v.config.MountPoint.

  func (v *Volume) Mount() (string, error) {
      v.lock.Lock()
      defer v.lock.Unlock()
      err := v.mount()
      return v.config.MountPoint, err  // <-- Bug: should use v.mountPoint()
  }

The internal helper mountPoint() already handles this correctly:

  func (v *Volume) mountPoint() string {
      if v.UsesVolumeDriver() || v.config.Driver == define.VolumeDriverImage {
          return v.state.MountPoint  // Correct for plugins
      }
      return v.config.MountPoint
  }

So I believe the fix is simply a oneliner change:

  func (v *Volume) Mount() (string, error) {
      // ...
      return v.mountPoint(), err
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.triagedIssue has been triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions