Skip to content

Cannot do a head request for private registry #1525

@Pwuts

Description

@Pwuts

Describe the bug

I am having the exact same issue as described and discussed in #715, with the latest version of the image and the latest registry:2 image.

My registry is located at docker-registry.sub.domain.nl, image names are single part, so docker-registry.sub.domain.nl/imagename:latest.

Watchtower tries HEAD /v2/library/imagename/manifests/latest. This fails, after which it "falls back to regular pull" and requests HEAD /v2/imagename/manifests/latest, which succeeds.

Steps to reproduce

Have watchtower try to pull an image from a private registry.

Expected behavior

HEAD /v2/imagename/manifests/latest -> no unnecessary pulls

Screenshots

No response

Environment

  • Docker 20.10.11
  • containrrr/watchtower:latest (latest version)
  • registry:2 (latest version)

Your logs

msg="Trying to load authentication credentials." container=/container image="docker-registry.sub.domain.nl/imagename:latest"
msg="Loaded auth credentials for user deploy, on registry docker-registry.sub.domain.nl/imagename:latest, from file /config.json"
msg="Got image name: docker-registry.sub.domain.nl/imagename:latest"
msg="Credentials loaded"
msg="Checking if pull is needed" container=/container image="docker-registry.sub.domain.nl/imagename:latest"
msg="Building challenge URL" URL="https://docker-registry.sub.domain.nl/v2/"
msg="Got response to challenge request" header="Basic realm=\"Registry Realm\"" status="401 Unauthorized"
msg="Parsing image ref" host=docker-registry.sub.domain.nl image=imagename normalized="docker-registry.sub.domain.nl/imagename:latest" tag=latest
msg="Doing a HEAD request to fetch a digest" url="https://docker-registry.sub.domain.nl/v2/library/login/manifests/latest"
msg="Could not do a head request for \"docker-registry.sub.domain.nl/imagename:latest\", falling back to regular pull." container=/container image="docker-registry.sub.domain.nl/imagename:latest"
msg="Reason: registry responded to head request with \"404 Not Found\", auth: \"not present\"" container=/container image="docker-registry.sub.domain.nl/imagename:latest"
msg="Pulling image" container=/container image="docker-registry.sub.domain.nl/imagename:latest"
msg="No new images found for /container"

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions