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

Conflict at mount destination with podman 1.3.1 #3174

Closed
vsim3 opened this issue May 21, 2019 · 12 comments · Fixed by #3177
Closed

Conflict at mount destination with podman 1.3.1 #3174

vsim3 opened this issue May 21, 2019 · 12 comments · Fixed by #3177
Assignees
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

@vsim3
Copy link

vsim3 commented May 21, 2019

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

/kind bug

Description

Podman 1.3 error with docker postgres:10-alpine image
Upgrade to f30 lead to postgresql container error
_ Work fine on v1.2

Steps to reproduce the issue:

  1. sudo podman run -d --name rss-postgresdb --cap-drop=CAP_NET_BIND_SERVICE --cap-drop=CAP_NET_RAW --conmon-pidfile=${DB_PID} -v ${PGDATA}:/var/lib/postgresql/data:Z -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=${PW} -e POSTGRES_DB=db --uidmap=0:100000:65536 --gidmap=0:100000:65536--oom-score-adj="-1000" -p 127.0.0.1:5432:5432 docker.io/library/postgres:10-alpine

Describe the results you received:
Error: conflict at mount destination /var/lib/postgresql/data: duplicate mount destination

podman version:
podman-1.3.1-1.git7210727.fc30

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 21, 2019
@cwawak
Copy link

cwawak commented May 21, 2019

Also seeing the same behavior on the same version - this was a clean Fedora 30 server minimal install. Also on 1.3.1-1-git7210727.fc30.x86_64. Specifying a volume using -v always results in this error.

@mheon
Copy link
Member

mheon commented May 21, 2019

This was my code, I'll take a look.

@mheon mheon self-assigned this May 21, 2019
@mheon
Copy link
Member

mheon commented May 21, 2019

Image volumes - has to be image volumes.

We have a named volume from an image volume at /var/lib/postgresql/data and an explicit user-specified mount at /var/lib/postgresql/data and we're not properly handling the conflict.

Working up a patch.

@cwawak
Copy link

cwawak commented May 21, 2019

@mheon this is exactly what's going on - thank you so much for taking a look, and allowing me to have choice in my container life. 👍

mheon added a commit to mheon/libpod that referenced this issue May 21, 2019
When we supercede low-priority mounts and volumes (image volumes,
and volumes sourced from --volumes-from) with higher-priority
ones (the --volume and --mount flags), we always replaced
lower-priority mounts of the same type (e.g. a user mount to
/tmp/test1 would supercede a volumes-from mount to the same
destination). However, we did not supercede the opposite type - a
named volume from image volumes at /tmp/test1 would be allowed to
remain and create a conflict, preventing container creation.

Solve this by destroying opposite types before merging (we can't
do it in the same loop, as then named volumes, which go second,
might trample changes made by mounts).

Fixes containers#3174

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@mheon
Copy link
Member

mheon commented May 21, 2019

#3177 should fix

@langdon
Copy link

langdon commented May 21, 2019

Is there a work around for this while we wait for the patch to land?

@mheon
Copy link
Member

mheon commented May 21, 2019

Try --image-volume=tmpfs - it should make the conflict one that Podman is able to automatically resolve.

@langdon
Copy link

langdon commented May 21, 2019

that worked! thanks!

@vsim3
Copy link
Author

vsim3 commented May 22, 2019

Thanks for that quick fix.

@rhatdan
Copy link
Member

rhatdan commented May 22, 2019

@mheon Do we need a new release for this? Is this worth blocking podman 1.3.1?

@TomSweeneyRedHat
Copy link
Member

+1 on the new release from me, blocking I'm on the fence for.

@mheon
Copy link
Member

mheon commented May 22, 2019 via email

mheon added a commit that referenced this issue May 28, 2019
When we supercede low-priority mounts and volumes (image volumes,
and volumes sourced from --volumes-from) with higher-priority
ones (the --volume and --mount flags), we always replaced
lower-priority mounts of the same type (e.g. a user mount to
/tmp/test1 would supercede a volumes-from mount to the same
destination). However, we did not supercede the opposite type - a
named volume from image volumes at /tmp/test1 would be allowed to
remain and create a conflict, preventing container creation.

Solve this by destroying opposite types before merging (we can't
do it in the same loop, as then named volumes, which go second,
might trample changes made by mounts).

Fixes #3174

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
@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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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.

7 participants