-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[APIv2]: container copy rewrite broke PUT /containers/{id}/archive endpoint #8649
Comments
Note that we're currently in process to get |
FWIW, the new error may not be a regression but actually pointing to another bug.
|
Alright, that's... Confusing. There are already two fields for making
volumes in the request, Binds and Mounts, and now we have a third with no
direct CLI companion (and thus no docs).
…On Wed, Dec 9, 2020, 06:15 Valentin Rothberg ***@***.***> wrote:
FWIW, the new error may not be a regression but actually pointing to
another bug.
200 {"cause":"destination must be a directory or stream when copying from
a stream","message":"destination must be a directory or stream when copying
from a stream","response":500}
/vol1 seems to be currently ignored. @jwhonce <https://github.com/jwhonce>
@mheon <https://github.com/mheon> is the Volumes parameter supposed to
create or use a volume on the server? It's currently not processed so
/vol1 simply does not exist on the container. Just creating the directory
(as before) is a bug.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8649 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCFHKRMJNVMBC4I2EY3ST5L47ANCNFSM4USE5Z5Q>
.
|
Indeed ... just checked against Docker:
|
Checking Docker's
Docker's API docs say about the
It looks like the |
@mheon do you have cycles to tackle it? |
Sure, I think I can get this done. Tricky part: it looks like Docker adds everything to volumes - even things that are already in Binds and Mounts - so we need to deduplicate before we add the new anonymous volumes. |
A friendly reminder that this issue had no activity for 30 days. |
@mheon did you make any progress on this? |
Nope, not yet
…On Sun, Jan 10, 2021 at 08:04 Daniel J Walsh ***@***.***> wrote:
@mheon <https://github.com/mheon> did you make any progress on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#8649 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCHWKWCRD7K2O3RIJ73SZGQWNANCNFSM4USE5Z5Q>
.
|
#9025 to fix |
Docker has, for unclear reasons, three separate fields in their Create Container struct in which volumes can be placed. Right now we support two of those - Binds and Mounts, which (roughly) correspond to `-v` and `--mount` respectively. Unfortunately, we did not support the third, `Volumes`, which is used for anonymous named volumes created by `-v` (e.g. `-v /test`). It seems that volumes listed here are *not* included in the remaining two from my investigation, so it should be safe to just append them into our handling of the `Binds` (`-v`) field. Fixes containers#8649 Signed-off-by: Matthew Heon <[email protected]>
Docker has, for unclear reasons, three separate fields in their Create Container struct in which volumes can be placed. Right now we support two of those - Binds and Mounts, which (roughly) correspond to `-v` and `--mount` respectively. Unfortunately, we did not support the third, `Volumes`, which is used for anonymous named volumes created by `-v` (e.g. `-v /test`). It seems that volumes listed here are *not* included in the remaining two from my investigation, so it should be safe to just append them into our handling of the `Binds` (`-v`) field. Fixes containers#8649 Signed-off-by: Matthew Heon <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
Trying to find regressions by exercising the APIv2 trough docker-py's test suite (see #5386) I came across a regressions in the
ArchiveTest.test_copy_directory_to_container
test.It specifically broke with commit 0f496e4 .
Steps to reproduce the issue:
Assuming you have a tar archive for upload:
Describe the results you received:
The archive upload fails with:
Note: the
200
response code. 😞Describe the results you expected:
The contents of the archive should be extracted into the directory given in the
path
parameter (here:"/vol1"
).Additional information you deem important (e.g. issue happens only occasionally):
The 200 response code in case of an error is because of
podman/pkg/api/handlers/compat/containers_archive.go
Line 173 in 0cccba8
http.StatusOK
header out before the last fallible operation.The copy error happens in:
podman/pkg/copy/copy.go
Line 120 in 0cccba8
called by
podman/pkg/copy/copy.go
Line 32 in 0cccba8
called by
podman/pkg/api/handlers/compat/containers_archive.go
Line 174 in 0cccba8
... incidentally exactly after setting the
http.StatusOK
header.But the actual cause is that
destination
is invalid inpodman/pkg/api/handlers/compat/containers_archive.go
Line 159 in 0cccba8
Because the
resolvedContainerPath
(something like:"/home/riyad/podman/storage/overlay/02a2eb10376916256ef680acfbdf9296b48f3b4941a41d08e478618c228d68a9/merged/vol1"
) does not exist inpodman/pkg/copy/item.go
Line 237 in 0cccba8
we have
statError != nil
(specifically"file does not exist"
).This leads us to fall through the conditions in L241 and L254 and enter the last block of code where we make sure the "parent" directory for
resolvedContainerPath
exists (but not the directory itself?). 🤷All this worked before 0f496e4.
Output of
podman version
:The text was updated successfully, but these errors were encountered: