Skip to content

Podman missinterprets %h symbol in the bind volume source when container created/started from a unit (BTRFS file system) #11547

Closed
@PavelSosin-320

Description

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

/kind bug

Description

When container that assumes bind volume mounting is created or run from the generated by podman generate systemd command the source path can be expressed by the absolute path or via % builtin symbols, %h for example. All % builtin "path" symbols like %t and %h are expanded into an absolute path, i.e. must be accepted by podman as a valid bind volume source. All subdirectories related to the %h, %v, etc. should be accepted. I hope, local driver and fuse.mount support this scenario.

Steps to reproduce the issue:

  1. Create a container from the docker.io/theiaide/theis image with bind volume as /home/user/project:/home/project
  2. Generate Systemd unit from the container.
  3. Put the unit into ~/.config/systemd/user and enable it
  4. Create a "project workspace directory" ~/project
  5. Modify unit .service file: add Condition=PathExists=%h/project (to be sure that bind volume source exists and its full path is correctly expanded) and the bind volume source expressed as -v %h/project:/home/project
  6. Start the unit using systemctl start
    Describe the results you received:
    "Invalid reference" error message
    Describe the results you expected:
    It must work because systemd unit must be shareable between users

Additional information you deem important (e.g. issue happens only occasionally):
It works OK in WSL because the workspace is located in the host filesystem
Output of podman version:
Podman Version 3.3.1
API Version: 3.3.1


**Output of `podman info --debug`:**

(paste your output here)


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

(paste your output here)


**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

**Additional environment details (AWS, VirtualBox, physical, etc.):**
Fedora 4 Workstation on the laptop
security-opt lable=disable has been added
Standalone podman run  -v /home/pavelsosin/project:/home/project [TheiaIDE](https://hub.docker.com/r/theiaide/theia) is OK.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions