-
Notifications
You must be signed in to change notification settings - Fork 178
Description
Hello,
I recently encountered a problem that occurs only randomly, when pushing images. Some layers are retrying, then suddenly ending with EOF. To note that these errors were not encountered in the past, when the proxy was not used.
Error example:
The push refers to repository [test-repo.com/test/test]
....
af0103c38359: Pushed
d0347c582a73: Pushed
222021755514: Layer already exists
67c624cf5c38: Pushed
2371e8a98212: Layer already exists
a27518e43e49: Layer already exists
5f7bfa7e154c: Layer already exists
910d7fd9e23e: Layer already exists
ea5003ab0221: Pushed
4230ff7f2288: Layer already exists
2c719774c1e1: Layer already exists
f94641f1fe1f: Layer already exists
ec62f19bb3aa: Layer already exists
8b2e1d3f2e5f: Pushed
864db58a2641: Retrying in 5 seconds
864db58a2641: Retrying in 4 seconds
864db58a2641: Retrying in 3 seconds
864db58a2641: Retrying in 2 seconds
864db58a2641: Retrying in 1 second
864db58a2641: Retrying in 10 seconds
864db58a2641: Retrying in 9 seconds
864db58a2641: Retrying in 8 seconds
864db58a2641: Retrying in 7 seconds
864db58a2641: Retrying in 6 seconds
864db58a2641: Retrying in 5 seconds
864db58a2641: Retrying in 4 seconds
864db58a2641: Retrying in 3 seconds
864db58a2641: Retrying in 2 seconds
864db58a2641: Retrying in 1 second
864db58a2641: Retrying in 15 seconds
864db58a2641: Retrying in 14 seconds
864db58a2641: Retrying in 13 seconds
864db58a2641: Retrying in 12 seconds
864db58a2641: Retrying in 11 seconds
864db58a2641: Retrying in 10 seconds
864db58a2641: Retrying in 9 seconds
864db58a2641: Retrying in 8 seconds
864db58a2641: Retrying in 7 seconds
864db58a2641: Retrying in 6 seconds
864db58a2641: Retrying in 5 seconds
864db58a2641: Retrying in 4 seconds
864db58a2641: Retrying in 3 seconds
864db58a2641: Retrying in 2 seconds
864db58a2641: Retrying in 1 second
864db58a2641: Retrying in 20 seconds
864db58a2641: Retrying in 19 seconds
864db58a2641: Retrying in 18 seconds
864db58a2641: Retrying in 17 seconds
864db58a2641: Retrying in 16 seconds
864db58a2641: Retrying in 15 seconds
864db58a2641: Retrying in 14 seconds
864db58a2641: Retrying in 13 seconds
864db58a2641: Retrying in 12 seconds
864db58a2641: Retrying in 11 seconds
864db58a2641: Retrying in 10 seconds
864db58a2641: Retrying in 9 seconds
864db58a2641: Retrying in 8 seconds
864db58a2641: Retrying in 7 seconds
864db58a2641: Retrying in 6 seconds
864db58a2641: Retrying in 5 seconds
864db58a2641: Retrying in 4 seconds
864db58a2641: Retrying in 3 seconds
864db58a2641: Retrying in 2 seconds
864db58a2641: Retrying in 1 second
EOF
I also found that some other users had this issue, when running behind a proxy. I ran the registry proxy in debug mode, but didn't find any obvious warning or errors in the proxy logs, besides the fact that i sometimes see a 401 response at the following get request, which i do not know if they are related tot the pushing issue:
Request:
GET https://127.0.0.1:444/v2/ HTTP/1.1
Host: | test-registry.test.com |
---|---|
User-Agent: | docker/19.03.8 go/go1.12.17 git-commit/afacb8b7f0 kernel/4.15.0-20-generic os/linux arch/amd64 UpstreamClient(Go-http-client/1.1) |
Accept-Encoding: | gzip |
Connection: | close |
Response:
HTTP/1.1 401 Unauthorized
Server: | nginx/1.18.0 |
---|---|
Date: | Fri, 04 Dec 2020 09:41:49 GMT |
Content-Type: | application/json; charset=utf-8 |
Content-Length: | 87 |
Connection: | close |
Docker-Distribution-Api-Version: | registry/2.0 |
Www-Authenticate: | Bearer realm="https://git.test.com/jwt/auth",service="container_registry" |
X-Content-Type-Options: | nosniff |
As info, i ran the debug with the following arguments:
docker run -d --restart always --name docker_registry_proxy-debug -it \
-e DEBUG=true \
-e DEBUG_HUB=true \
-e DEBUG_NGINX=true \
-p 0.0.0.0:8083:8081 \
-p 0.0.0.0:8084:8082 \
-p 0.0.0.0:3128:3128 \
-e ENABLE_MANIFEST_CACHE=true \
-e CACHE_MAX_SIZE=400g \
-e ALLOW_PUSH=true \
-e REGISTRIES="test-registry.test.com" \
-e AUTH_REGISTRIES="git.test.com/:test_user:test_pass" \
-e MANIFEST_CACHE_PRIMARY_TIME="60d" \
-e MANIFEST_CACHE_SECONDARY_TIME="60d" \
-e MANIFEST_CACHE_DEFAULT_TIME="30d" \
-v /mnt/docker-mirror-cache:/docker_mirror_cache \
-v /mnt/docker-mirror-cache/ca:/ca \
rpardini/docker-registry-proxy:0.6.1-debug
At a first glance it seems that the authorization header is not sent, but i also wonder why are these random request happening towards /v2/.
I also looked through the whole nginx config, and added proxy_set_header X-Forwarded-Proto: https; in both server configs, but didn't seem to help.
I'm still investigating the issue, but meanwhile i opened it because there certainly seems to be something wrong.
Thanks.