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

podman/docker compatibility during volume creation #7740

Closed
rsommer opened this issue Sep 23, 2020 · 10 comments · Fixed by #7804
Closed

podman/docker compatibility during volume creation #7740

rsommer opened this issue Sep 23, 2020 · 10 comments · Fixed by #7804
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

@rsommer
Copy link
Contributor

rsommer commented Sep 23, 2020

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

/kind bug

Description
When a named volume is created via docker and the volume does already exist, no error ist returned. podman on the other hand returns Error: volume with name test already exists: volume already exists

Steps to reproduce the issue:

docker:

$ docker volume create test
test
$ docker volume create test
test

podman:

$ podman volume create test
test
$ podman volume create test
Error: volume with name test already exists: volume already exists

Describe the results you received:
podman throws an error when the volume does already exist.

Describe the results you expected:
podman just "returns" the existing volume, being compatible to docker. The behaviour was discovered while trying to replace the docker daemon in gitlab ci. The cache volumes used by the gitlab runner are (re-)created using the same volume name, leading to the shown error.

Output of podman version:

Version:      2.1.0
API Version:  2.0.0
Go Version:   go1.14
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.16.1
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.20, commit: '
  cpus: 2
  distribution:
    distribution: debian
    version: "10"
  eventLogger: journald
  hostname: cirunnertest01
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1221
      size: 1
    - container_id: 1
      host_id: 2459296
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1221
      size: 1
    - container_id: 1
      host_id: 2459296
      size: 65536
  kernel: 4.19.0-10-amd64
  linkmode: dynamic
  memFree: 209768448
  memTotal: 2066657280
  ociRuntime:
    name: runc
    package: 'runc: /usr/sbin/runc'
    path: /usr/sbin/runc
    version: |-
      runc version 1.0.0~rc6+dfsg1
      commit: 1.0.0~rc6+dfsg1-3
      spec: 1.0.1
  os: linux
  remoteSocket:
    path: /run/user/1221/podman/podman.sock
  rootless: true
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.4
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
  swapFree: 190300160
  swapTotal: 213905408
  uptime: 1h 4m 43.96s (Approximately 0.04 days)
version:
  APIVersion: 2.0.0
  Built: 0
  BuiltTime: Thu Jan  1 00:00:00 1970
  GitCommit: ""
  GoVersion: go1.14
  OsArch: linux/amd64
  Version: 2.1.0

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

podman/additional,now 2.1.0~1 amd64 [installed]

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

Yes

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

rhatdan commented Sep 23, 2020

Do you think this is a bug in Docker? Does not see proper to not return an error when something already exists. I checked their man page and it does not mention this behaviour?

@rsommer
Copy link
Contributor Author

rsommer commented Sep 23, 2020

The man page of docker-volume-create states: Multiple containers can use the same volume in the same time period - so I would assume, that two or more containers could require that a specific volume exists and that it could be ok to call create again with the same name. I just came accross the difference in behaviour that renders the gitlab-runner useless when using the podman service instead of the docker daemon.

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2020

Sure, but you could make the arguments about creating a directory.

mkdir /tmp
mkdir: cannot create directory ‘/tmp’: File exists

What happens in Docker if I change the options?

       -d, --driver="local"
           Specify volume driver name

       --label=
           Set metadata for a volume

       -o, --opt=map[]
           Set driver specific options

This really feels like a bug in docker.

@rhatdan
Copy link
Member

rhatdan commented Sep 23, 2020

Does docker network create, docker container create, docker config create, docker service create
All work the same way?

@rsommer
Copy link
Contributor Author

rsommer commented Sep 23, 2020

The behaviour is inconsistent. docker network create for example does throw an error if the network already exists.

@rhatdan
Copy link
Member

rhatdan commented Sep 24, 2020

By any chance could you open an issue with Docker on this to get their opinion.

@rsommer
Copy link
Contributor Author

rsommer commented Sep 25, 2020

Docker issue/question

@rsommer
Copy link
Contributor Author

rsommer commented Sep 25, 2020

@mheon
Copy link
Member

mheon commented Sep 25, 2020

So Docker seem to be of the opinion that this behavior is not good and should be changed... Given that, I think we should document the difference and leave it, in the expectation that Docker will eventually change it.

@rhatdan
Copy link
Member

rhatdan commented Sep 25, 2020

@rsommer Interested in opening a PR to transfer.md?

baude added a commit to baude/podman that referenced this issue Sep 28, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Sep 28, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Sep 28, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@redhat.com>
baude added a commit to baude/podman that referenced this issue Sep 28, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@redhat.com>
mheon pushed a commit to mheon/libpod that referenced this issue Oct 14, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@redhat.com>
edsantiago pushed a commit to edsantiago/libpod that referenced this issue Nov 4, 2020
in the compatibility layer, creating a volume with a name that already does not result in an error.  instead a 201 response with the existing volume's information is returned. while it seems like a bug on the part of docker and they agree, no attempt has been made to fix it in five years.  See moby/moby#16068

Fixes: containers#7740

Signed-off-by: baude <bbaude@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.

4 participants