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 load -i Path-With-Caps label : invalid reference format: repository name must be lowercase #7337

Closed
edsantiago opened this issue Aug 17, 2020 · 12 comments · Fixed by #8112
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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. stale-issue

Comments

@edsantiago
Copy link
Member

edsantiago commented Aug 17, 2020

Only when --format=oci-archive:

$ podman pull alpine
$ podman save --format oci-archive alpine:latest >| /tmp/FOO.tar
$ podman load -i /tmp/FOO.tar foo                                                                                                              bats (2)
Error: error pulling "foo": unable to pull dir:/tmp/FOO.tar: error determining pull goal for image "dir:/tmp/FOO.tar": error parsing dest reference name "localhost/tmp/FOO.tar": error parsing named reference "localhost/tmp/FOO.tar": invalid reference format: repository name must be lowercase

Only the exact sequence above fails. The following are fine:

  • podman save without --format oci-archive
  • podman load -i /tmp/FOO.tar without foo (label)
  • podman save to an all-lower-case path

EDIT: meant to add that this also fails if any directory component has caps: /tmp/FOO/bar.tar

master @ 47108e2

@edsantiago edsantiago added the kind/bug Categorizes issue or PR as related to a bug. label Aug 17, 2020
@rhatdan
Copy link
Member

rhatdan commented Aug 17, 2020

@QiWang19 PTAL

@zhangguanzhang
Copy link
Collaborator

on Centos8 and use the code of master to compile, it works ok

[root@centos8 ~]# ./podman/bin/podman images
REPOSITORY               TAG     IMAGE ID      CREATED      SIZE
docker.io/library/nginx  alpine  736a7d71fd38  5 weeks ago  23.1 MB
[root@centos8 ~]# ./podman/bin/podman save --format oci-archive docker.io/library/nginx:alpine > /tmp/FOO.tar
[root@centos8 ~]# ./podman/bin/podman rmi docker.io/library/nginx:alpine
Untagged: docker.io/library/nginx:alpine
Deleted: 736a7d71fd384010a9a6b3ed7fda1aad73f510fb596d08c783ccdba21b6bf3f5
[root@centos8 ~]# ./podman/bin/podman load -i /tmp/FOO.tar
Getting image source signatures
Copying blob 3eee30c545e4 done  
Copying blob 01a49528d795 done  
Copying blob 88a5e8859cbc done  
Copying blob aace0d553d4a done  
Copying blob 77ca9fc22518 done  
Copying config 736a7d71fd done  
Writing manifest to image destination
Storing signatures
Loaded image(s): docker.io/library/nginx:alpine
[root@centos8 ~]# ./podman/bin/podman images
REPOSITORY               TAG     IMAGE ID      CREATED      SIZE
docker.io/library/nginx  alpine  736a7d71fd38  5 weeks ago  23.1 MB

@edsantiago
Copy link
Member Author

#  ./podman/bin/podman load -i /tmp/FOO.tar

That is not the test. If you copy-paste from my report, you will see that the test includes a label:

# ... /FOO.tar foo   <---- the "foo" is important

If you try that, I believe it will fail.

@zhangguanzhang
Copy link
Collaborator

zhangguanzhang commented Aug 18, 2020

#  ./podman/bin/podman load -i /tmp/FOO.tar

That is not the test. If you copy-paste from my report, you will see that the test includes a label:

# ... /FOO.tar foo   <---- the "foo" is important

If you try that, I believe it will fail.

I found the case, so

 ... /FOO.tar foo <--- after this , the image's name will be foo?

@QiWang19
Copy link
Contributor

To match the behavior of docker-archive format, the $ podman load -i /tmp/FOO.tar foo loaded image should be localhost/foo

@zhangguanzhang
Copy link
Collaborator

zhangguanzhang commented Aug 18, 2020

To match the behavior of docker-archive format, the $ podman load -i /tmp/FOO.tar foo loaded image should be localhost/foo

$ podman load -i /tmp/FOO.tar foo        

after this , the image's name will be localhost/foo?

@QiWang19
Copy link
Contributor

after this , the image's name will be localhost/foo?

yes

@zhangguanzhang
Copy link
Collaborator

zhangguanzhang commented Aug 18, 2020

[root@centos8 podman]# make BUILDTAGS="containers_image_openpgp systemd exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper selinux seccomp " podman
go build -mod=vendor  -gcflags 'all=-trimpath=/root/podman' -asmflags 'all=-trimpath=/root/podman' -ldflags '-X github.com/containers/podman/libpod/define.gitCommit=8caed305741c8c9e34ec767c9054e3c5e0d33576-dirty -X github.com/containers/podman/libpod/define.buildInfo=1597767979 -X github.com/containers/podman/libpod/config._installPrefix=/usr/local -X github.com/containers/podman/libpod/config._etcDir=/etc ' -tags "containers_image_openpgp systemd exclude_graphdriver_btrfs btrfs_noversion exclude_graphdriver_devicemapper selinux seccomp " -o bin/podman ./cmd/podman
[root@centos8 podman]# ./bin/podman images
REPOSITORY               TAG     IMAGE ID      CREATED      SIZE
docker.io/library/nginx  alpine  736a7d71fd38  5 weeks ago  23.1 MB
[root@centos8 podman]# ./bin/podman save --format oci-archive docker.io/library/nginx:alpine > /tmp/FOO.tar
[root@centos8 podman]# podman rmi 736
Untagged: docker.io/library/nginx:alpine
Deleted: 736a7d71fd384010a9a6b3ed7fda1aad73f510fb596d08c783ccdba21b6bf3f5
[root@centos8 podman]# podman images
REPOSITORY  TAG     IMAGE ID  CREATED  SIZE

now load the image

[root@centos8 podman]# ./bin/podman load -i /tmp/FOO.tar foo
Getting image source signatures
Copying blob 3eee30c545e4 done  
Copying blob 01a49528d795 done  
Copying blob 88a5e8859cbc done  
Copying blob aace0d553d4a done  
Copying blob 77ca9fc22518 done  
Copying config 736a7d71fd done  
Writing manifest to image destination
Storing signatures
Loaded image(s): localhost/foo
[root@centos8 podman]# ./bin/podman load -i /tmp/FOO.tar test.com/foo
Getting image source signatures
Copying blob 3eee30c545e4 skipped: already exists  
Copying blob 01a49528d795 skipped: already exists  
Copying blob 88a5e8859cbc skipped: already exists  
Copying blob aace0d553d4a skipped: already exists  
Copying blob 77ca9fc22518 [--------------------------------------] 0.0b / 0.0b
Copying config 736a7d71fd done  
Writing manifest to image destination
Storing signatures
Loaded image(s): test.com/foo
[root@centos8 podman]# ./bin/podman load -i /tmp/FOO.tar 
Getting image source signatures
Copying blob 3eee30c545e4 skipped: already exists  
Copying blob 01a49528d795 skipped: already exists  
Copying blob 88a5e8859cbc skipped: already exists  
Copying blob aace0d553d4a skipped: already exists  
Copying blob 77ca9fc22518 [--------------------------------------] 0.0b / 0.0b
Copying config 736a7d71fd done  
Writing manifest to image destination
Storing signatures
Loaded image(s): docker.io/library/nginx:alpine
[root@centos8 podman]# ./bin/podman images
REPOSITORY               TAG     IMAGE ID      CREATED      SIZE
docker.io/library/nginx  alpine  736a7d71fd38  5 weeks ago  23.1 MB
test.com/foo             latest  736a7d71fd38  5 weeks ago  23.1 MB
localhost/foo            latest  736a7d71fd38  5 weeks ago  23.1 MB

In addition to modifying some code of podman, also need to modify some code of containers/image,

[root@centos8 podman]# git diff --raw
:100644 100644 a95cd1d7a 000000000 M    libpod/runtime_img.go
:100644 100644 a99b63158 000000000 M    vendor/github.com/containers/image/v5/oci/layout/oci_transport.go

I will try to submit changes tomorrow

edsantiago added a commit to edsantiago/libpod that referenced this issue Aug 19, 2020
info, images, run, networking tests: remove some skip_if_remote()s
that were added in the varlink days. All of these tests now seem
to work with APIv2.

help test: check that first output line from 'podman --help'
is the program description (regression check for containers#7273).

load test: clean up stray images, rewrite test to make it conform
to existing convention. In the process, discover and file containers#7337

exec test (and networking): file containers#7360, and add FIXME comment
to skip()s suggesting evaluating those tests once that is fixed.

pod test: now that containers#6328 is fixed, use 'podman pod inspect --format'
instead of relying on jq

Various other tests: add an explanation of why test is disabled
so we can more easily distinguish "this will never be meaningful
under remote" vs "hey, doesn't work for now, but maybe someday".

Signed-off-by: Ed Santiago <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Sep 11, 2020

The PR for this one seems to have stalled.

@QiWang19 QiWang19 removed their assignment Sep 17, 2020
@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@zhangguanzhang zhangguanzhang removed their assignment Oct 18, 2020
@rhatdan
Copy link
Member

rhatdan commented Oct 21, 2020

@QiWang19 @edsantiago Can we close this issue now?

@edsantiago
Copy link
Member Author

I would strongly prefer to keep this open until it is fixed. At the very absolute minimum:

  1. If this is not supported, give a useful message
  2. Please do not give different messages depending on whether there is an UPPER-CASE letter in the directory path or not
$ ./bin/podman load -i /tmp/FOO/alpine.tar foo
Error: error pulling "foo": unable to pull oci:/tmp/FOO/alpine.tar:localhost/foo: error determining pull goal for image "oci:/tmp/FOO/alpine.tar:localhost/foo": error parsing dest reference name "localhost/tmp/FOO/alpine.tar": error parsing named reference "localhost/tmp/FOO/alpine.tar": invalid reference format: repository name must be lowercase

$ ./bin/podman load -i /tmp/foo/alpine.tar foo
  open /tmp/foo/alpine.tar/manifest.json: not a directory
  open /tmp/foo/alpine.tar/index.json: not a directory
  open /tmp/foo/alpine.tar/index.json: not a directory
Error: error pulling "foo": unable to pull oci:/tmp/foo/alpine.tar:localhost/foo: Error initializing source oci:/tmp/foo/alpine.tar:localhost/foo: open /tmp/foo/alpine.tar/index.json: not a directory

@QiWang19 QiWang19 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Oct 26, 2020
@QiWang19 QiWang19 self-assigned this Oct 26, 2020
QiWang19 added a commit to QiWang19/podman that referenced this issue Dec 2, 2020
Not pass the name argument to Load API. Specify in the document the usage of the optional argument is tagging an additional image.
Close containers#7337

Signed-off-by: Qi Wang <[email protected]>
edsantiago added a commit to edsantiago/libpod that referenced this issue Dec 2, 2020
Looks like containers#7337 was fixed (by containers#8112). Reenable a disabled
test for it; and make it actually work. Confirmed that
newly-added test fails on d456765 (the commit before containers#8112).

Signed-off-by: Ed Santiago <[email protected]>
@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
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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. stale-issue
Projects
None yet
4 participants