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

Unexpected behavior when using "--root" option with trailing slash #8160

Closed
M0ses opened this issue Oct 27, 2020 · 1 comment · Fixed by #8163
Closed

Unexpected behavior when using "--root" option with trailing slash #8160

M0ses opened this issue Oct 27, 2020 · 1 comment · Fixed by #8163
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

@M0ses
Copy link

M0ses commented Oct 27, 2020

/kind bug

Description
When running podman with the '--root' option a trailing slash in the path leads to an error message like this:

Error: database storage graph root directory (graphroot) "/tmp/containers" does not match our storage graph root directory (graphroot) "/tmp/containers/": database configuration mismatch

This is quite confusing because if you use shell expansion for path (tab) the trailing slash is added.

IMO the trailing slash should be removed automatically

Steps to reproduce the issue:

  1. call podman with '--root' containing a trailing slash

Describe the results you received:

podman pull --root /tmp/containers/ registry.opensuse.org/opensuse/tumbleweed:latest
Error: database storage graph root directory (graphroot) "/tmp/containers" does not match our storage graph root directory (graphroot) "/tmp/containers/": database configuration mismatch

Describe the results you expected:

pull the image

Output of podman version:

# podman version
Version:      2.1.1
API Version:  2.0.0
Go Version:   go1.13.15
Built:        Wed Sep 30 02:00:00 2020
OS/Arch:      linux/amd64


Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.1
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: conmon-2.0.21-1.1.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.0.21, commit: unknown'
  cpus: 8
  distribution:
    distribution: '"opensuse-tumbleweed"'
    version: "20201019"
  eventLogger: journald
  hostname: $HOSTNAME$
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 100
      size: 1
    - container_id: 1
      host_id: 200000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 200000
      size: 65536
  kernel: 5.8.14-1-default
  linkmode: dynamic
  memFree: 629202944
  memTotal: 33335214080
  ociRuntime:
    name: runc
    package: runc-1.0.0~rc92-1.1.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc92
      spec: 1.0.2-dev
  os: linux
  remoteSocket:
    path: /run/user/$UID$/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.0.0-1.3.x86_64
    version: |-
      slirp4netns version 1.0.0
      commit: unknown
      libslirp: 4.3.1
  swapFree: 33782755328
  swapTotal: 34359734272
  uptime: 119h 52m 54.25s (Approximately 4.96 days)
registries:
  search:
  - registry.opensuse.org
  - docker.io
store:
  configFile: $HOME$/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: fuse-overlayfs-1.1.2-2.1.x86_64
      Version: |-
        fusermount3 version: 3.10.0
        fuse-overlayfs: version 1.1.0
        FUSE library version 3.10.0
        using FUSE kernel interface version 7.31
  graphRoot: $HOME$/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 0
  runRoot: /run/user/$UID$
  volumePath:$HOME$/.local/share/containers/storage/volumes
version:
  APIVersion: 2.0.0
  Built: 1601424000
  BuiltTime: Wed Sep 30 02:00:00 2020
  GitCommit: ""
  GoVersion: go1.13.15
  OsArch: linux/amd64
  Version: 2.1.1

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

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

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

No

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

openSUSE Tumbleweed

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 27, 2020
@giuseppe
Copy link
Member

opened a PR: #8163

giuseppe added a commit to giuseppe/libpod that referenced this issue Oct 28, 2020
clean the paths before checking whether its value is different than
what is stored in the db.

Closes: containers#8160

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 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.

3 participants