Skip to content

Cannot pull from istag referencing image in another repository of internal registry #7792

Closed

Description

@miminar

Reproducer:

$ docker tag docker.io/hello-world 172.30.104.152:5000/tmp/hello-world:latest
$ docker push 172.30.104.152:5000/tmp/hello-world:latest
The push refers to a repository [172.30.104.152:5000/tmp/hello-world] (len: 1)
0a6ba66e537a: Pushed 
b901d36b6f2f: Pushed 
latest: digest: sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1 size: 2748

$ oc tag -n tmp hello-world@sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1 mybase:latest
Tag mybase:latest set to hello-world@sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1.

*$ oc describe -n tmp istag
Name:           sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Created:        2 minutes ago
Labels:         <none>
Annotations:    openshift.io/image.managed=true
Docker Image:   172.30.104.152:5000/tmp/hello-world@sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Image Name:     sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Image Size:     633 B (first layer 601 B, last binary layer 32 B)
Image Created:  4 months ago
Author:         <none>
Arch:           amd64
Command:        /hello
Working Dir:    <none>
User:           <none>
Exposes Ports:  <none>
Docker Labels:  <none>


Name:           sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Created:        2 minutes ago
Labels:         <none>
Annotations:    openshift.io/image.managed=true
Docker Image:   172.30.104.152:5000/tmp/hello-world@sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Image Name:     sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Image Size:     633 B (first layer 601 B, last binary layer 32 B)
Image Created:  4 months ago
Author:         <none>
Arch:           amd64
Command:        /hello
Working Dir:    <none>
User:           <none>
Exposes Ports:  <none>
Docker Labels:  <none>

$ # note the first pull is successful because all the blobs are already downloaded in Docker daemon's storage
$ docker pull 172.30.104.152:5000/tmp/mybase:latest                                                                                                                                                                                           
Trying to pull repository 172.30.104.152:5000/tmp/mybase ... latest: Pulling from tmp/mybase
Digest: sha256:bb5c16ecd58633d4088140acb6ee386c5c3b09a8f03c517a288093415f0c09d1
Status: Downloaded newer image for 172.30.104.152:5000/tmp/mybase:latest

$ docker rmi -f 0a6ba66e537a
Untagged: 172.30.104.152:5000/tmp/hello-world:latest
Untagged: 172.30.104.152:5000/tmp/mybase:latest
Untagged: docker.io/hello-world:latest
Deleted: 0a6ba66e537a53a5ea94f7c6a99c534c6adb12e3ed09326d4bf3b38f7c3ba4e7
Deleted: b901d36b6f2fd759c362819c595301ca981622654e7ea8a1aac893fbd2740b4c
$ # the second pull needs to repull all the blobs and fails
$ docker pull 172.30.104.152:5000/tmp/mybase:latest
Trying to pull repository 172.30.104.152:5000/tmp/mybase ... latest: Pulling from tmp/mybase
b901d36b6f2f: Pulling fs layer 
0a6ba66e537a: Pulling fs layer 
not found
Error: image tmp/mybase:latest not found

Tested with Docker 1.8.2 and 1.9.1. Test to confirm this is in #7790.

See also #7128 (comment) and #7763 (comment) for more background.

Activity

  1. 0xmichalis commented on Mar 10, 2016

    @0xmichalis
    Contributor

    Do we want to somehow link the invalid istag location in the registry to the valid one?

  2. miminar commented on Mar 10, 2016

    @miminar
    Author

    Update: outdated! , see #7792 (comment)

    @legionus can you please verify you can pull with older Docker version (like 1.6)? So we know it's not a regression in the registry but a way, how docker works nowadays. This used to work in past ages.

    If this is indeed caused by a change in Docker's behaviour, then it's a hard one. The solution is to create layer links in the repository referenced by IST, ISI or docker image for all the layers referenced in image manifest.

    We could either:

    1. implement a controller in origin server that would re-push all the ImageStreamTags, ImageStreamImages and DockerImages referencing internally managed images.
      • slow
      • requires docker daemon to first pull and then push
    2. do the same in the registry in some kind of a controller
      • fast
      • would just create links in repositories to existing blobs
    3. do the same lazily in the registry
      • on demand
      • no controller
      • when handling GET request on a manifest whose namespace/name doesn't match requested

    In all three cases we'd have to annotate the tag references to avoid subsequent reads of registry storage. My favorite is 3.

    Update: I didn't mention the most obvious solution to this - resolve the repository in pullthroughblobstore if not found locally. We'd have to list all the ISTs, ISIs and DockerImages of the is corresponding to the repository to see what where else do we point to and redirect the request to the right blobstore. But this would be an efficiency killer.

  3. legionus commented on Mar 14, 2016

    @legionus
    Contributor

    @legionus can you please verify you can pull with older Docker version (like 1.6)? So we know it's not a regression in the registry but a way, how docker works nowadays. This used to work in past ages.

    @miminar It seems to regression. Take a look at the screencast:

    https://gist.github.com/legionus/47b5ff3435a5daa16bb9

  4. miminar commented on Mar 15, 2016

    @miminar
    Author

    @legionus Commented on the gist. It's necessary to remove all the references to the image you're about to pull from the ist.

  5. legionus commented on Mar 15, 2016

    @legionus
    Contributor

    @miminar I've tested origin (v1.1.4-12-g77757b8) with docker (9d26a07/1.6.0, e949a81/1.10.3). Both are unable to pull from istag referencing image.

  6. 0xmichalis commented on Mar 16, 2016

    @0xmichalis
    Contributor

    Talked with @legionus offline and we realized a possible solution would be that when our registry detects a "not found" response, it could query the apiserver for the missing image (oc get is), look into its tags, find the real link, and serve that. @miminar WDYT?

  7. 32 remaining items

  8. pweil- commented on Mar 24, 2016

    @pweil-

    Summary of today's conversations:

    1. This carries too much risk to get in to 3.2 with the proposed solution - we shouldn't block
    2. We should still consider this a p0 item and must be in the next patch release
    3. The solution for this should not require carrying patches - we need to propose changes upstream if they must be made
  9. pweil- commented on Apr 11, 2016

    @pweil-

    @miminar @legionus - please make sure this gets a "known issues" mention in the release notes since we are not merging this for 3.2.

  10. added a commit that references this issue on May 9, 2016
  11. legionus commented on Jun 26, 2016

    @legionus
    Contributor

    Since the #8938 is merged this issue must be solved.

  12. smarterclayton commented on Jun 26, 2016

    @smarterclayton
    Contributor

    Can we create an extended test to verify this continues to work? Or add it
    to e2e?

    On Jun 26, 2016, at 5:04 PM, Alexey Gladkov [email protected]
    wrote:

    Since the #8938 #8938 is merged
    this issue must be solved.

    —
    You are receiving this because you were mentioned.
    Reply to this email directly, view it on GitHub
    #7792 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe/ABG_p_-2NU_A20acLg5qtfMQ7UET3pfCks5qPulzgaJpZM4HpVm0
    .

  13. legionus commented on Jun 26, 2016

    @legionus
    Contributor

    @smarterclayton Yes. In fact @soltysh already did it. I will create PR on Monday.

  14. soltysh commented on Jun 27, 2016

    @soltysh
    Contributor

    Yeah, just copy that one commit and open a PR and we'll be good :)

  15. pweil- commented on Jul 6, 2016

    @pweil-

    bump, is the test for this merged? Can we close?

  16. legionus commented on Jul 6, 2016

    @legionus
    Contributor

    I think yes

  17. pweil- commented on Jul 6, 2016

    @pweil-

    tests are submitted in #9580, the root issue has been merged. Closing.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions