Skip to content

Cannot get manifest after garbage-collect. #2270

Open

Description

@bluven

I first deleted manifest using API, then run gc, but after re-pushing the same image, i failed to get manifest, "manifest unknown" is reported.

What interested me is, if i restart registry and re-push image, i could get manifest again.

I don't know what happened, what should I do to fix this.

Here is a project to show what i did.

Activity

  1. m-masataka commented on May 16, 2017

    @m-masataka
    Contributor

    @bluven I can't reproduce your issue.
    Can you find the manifests directory ./data/docker/registry/v2/repositories/lib/nginx/_manifests/?

  2. bluven commented on Jun 9, 2017

    @bluven
    Author

    @m-masataka Sorry, almost forgot this issue.

    I used script command to record my execution, here is the record.

    I can see ./data/docker/registry/v2/repositories/lib/nginx/_manifests/, what weird is no blob infomation are found after re-pushing, and the size of data dir is only 200~350kb. I'm pretty sure i re-pushed the image.

    Cannot figure out what happened.

  3. m-masataka commented on Jun 15, 2017

    @m-masataka
    Contributor

    @bluven
    I think this problem is caused by API cache.
    I reproduced your issue by following command.

    #./push_nginx.sh
    ...
    #./delete.sh
    ...
    #./gc.sh
    ...
    # tree ./data/docker/registry/v2/
    data/docker/registry/v2/
    ├── blobs
    │   └── sha256
    │       ├── 5b
    │       ├── 7c
    │       ├── 87
    │       ├── a3
    │       ├── ac
    │       └── c8
    └── repositories
        └── lib
            └── nginx
                ├── _layers
                │   └── sha256
                │       ├── 5bd125039dd82b83ba7d59cf24e3990ec90e5a6d325fca9e4f6102dcbcbefa3d
                │       │   └── link
                │       ├── 8728ce3f8dfb1930b7c5c23f9ef001ae50f0691163d36b26c68a9fed1778314b
                │       │   └── link
                │       ├── a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4
                │       │   └── link
                │       ├── acd826d66c97e283489f7c2ecd12c63929894d601b28815cc6846a0d075b04e5
                │       │   └── link
                │       └── c8c29d842c09d6c61f537843808e01c0af4079e9e74079616f57dfcfa91d4e25
                │           └── link
                ├── _manifests
                │   ├── revisions
                │   │   └── sha256
                │   │       └── 7c367f67f73d7ac2c38cf8a77da9145807ef34e61db16ba28125d8a0c90d9383
                │   └── tags
                └── _uploads
    
    # docker push localhost:5000/lib/nginx:1.9
    The push refers to a repository [localhost:5000/lib/nginx]
    5f70bf18a086: Layer already exists
    49027b789c92: Layer already exists
    20f8e7504ae5: Layer already exists
    4dcab49015d4: Layer already exists
    1.9: digest: sha256:7c367f67f73d7ac2c38cf8a77da9145807ef34e61db16ba28125d8a0c90d9383 size: 1978
    

    In the registry logs. We get response 200, when we call blobs that registry doesn't have.
    This is not correct behavior.

    # docker logs registrygarbagecollect_registry_1
    172.17.0.1 - - [15/Jun/2017:02:37:02 +0000] "HEAD /v2/lib/nginx/blobs/sha256:c8c29d842c09d6c61f537843808e01c0af4079e9e74079616f57dfcfa91d4e25 HTTP/1.1" 200 0 "" "docker/17.05.0-ce go/go1.7.5 git-commit/89658be kernel/4.4.0-1013-aws os/linux arch/amd64 UpstreamClient(Docker-Client/17.05.0-ce \\(linux\\))"
    

    I think this is caused by golang API cache function.
    And you can delete this cache by restart the registry.

    # docker restart registrygarbagecollect_registry_1
    

    Now this behavior repaired in master branch.

  4. bluven commented on Jul 12, 2017

    @bluven
    Author

    @m-masataka Which release? I tried registry:2.6.1, still failed.

  5. vidarl commented on Sep 13, 2017

    @vidarl
    Contributor

    This issue remains also in 2.6.2, and I see no commit in master after 55ea440 that seems to be related to this bug. So my take is that this is not fixed.

  6. vidarl commented on Sep 14, 2017

    @vidarl
    Contributor

    Correction. Fixing this bug is scheduled for 2.7.0
    But you have to use redis as cache backend
    #2094 (comment)

    I would say this issue is a duplicate of #2094

  7. vladkras commented on Dec 29, 2017

    @vladkras

    I would say this issue is a duplicate of #2094

    it is

    restarting registry
    docker restart <registry_container>
    and pushing image with same tag again helped

    also I missed one tag before I came to this issue but I don't know how to reproduce it

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions