regclient / regclient

Docker and OCI Registry Client in Go and tooling using those libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Issue] Proxy connection timeout with the new v0.5.4

arfevrier opened this issue · comments

Hello, it seems that it is no longer possible to export an image behind a proxy with the new v0.5.4 version.

Current Behavior

Image export with the new version v0.5.4 is not using proxy settings.

Expected Behavior

Image export should use the env variable "http_proxy" or "https_proxy" as working is v0.5.3.

Steps To Reproduce

  1. Env settings:
  1. This commandes have been used:
$ curl -L https://github.com/regclient/regclient/releases/download/v0.5.4/regctl-linux-amd64 > regctl && chmod 755 regctl
$ ./regctl image export docker.io/gitlab/gitlab-runner-helper:x86_64-v16.6.0 docker_gitlab-runner.tar --platform linux/amd64 -v debug

Result:

arnaud@3922:~$ curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-amd64 > regctl && chmod 755 regctl
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 9252k  100 9252k    0     0  3043k      0  0:00:03  0:00:03 --:--:-- 4493k
arnaud@3922:~$ ./regctl image export docker.io/gitlab/gitlab-runner-helper:x86_64-v16.6.0 docker_gitlab-runner.tar --platform linux/amd64 -v debug
DEBU[0000] Loading docker config                         api= blobChunk=0 blobMax=0 helper= hostname=***********************.com mirrors="[]" name=***********************.local pathPrefix= repoAuth=false tls=enabled user=...
DEBU[0000] Loading docker config                         api= blobChunk=0 blobMax=0 helper= hostname=***********************.com mirrors="[]" name=***********************.local pathPrefix= repoAuth=false tls=enabled user=...
DEBU[0000] regclient initialized                         VCSRef=48a20981b2db4f72fdcafb16af46e3bf6d8f86d5 VCSTag=v0.5.4
DEBU[0000] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=false
DEBU[0030] Request failed                                URL="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" err="Get \"https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0\": dial tcp 34.226.69.105:443: i/o timeout"
WARN[0030] Sleeping for backoff                          Host=docker.io Seconds=1.999993097
DEBU[0032] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=false
DEBU[0062] Request failed                                URL="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" err="Get \"https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0\": dial tcp 3.219.239.5:443: i/o timeout"
WARN[0062] Sleeping for backoff                          Host=docker.io Seconds=3.99999481
DEBU[0066] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=false
DEBU[0096] Request failed                                URL="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" err="Get \"https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0\": dial tcp 34.226.69.105:443: i/o timeout"
failed to get manifest docker.io/gitlab/gitlab-runner-helper:x86_64-v16.6.0: Get "https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0": dial tcp 34.226.69.105:443: i/o timeout

Version

arnaud@3922:~$ ./regctl version
VCSTag:     v0.5.4
VCSRef:     48a20981b2db4f72fdcafb16af46e3bf6d8f86d5
VCSCommit:  48a20981b2db4f72fdcafb16af46e3bf6d8f86d5
VCSState:   clean
VCSDate:    2023-11-09T20:47:01Z
Platform:   linux/amd64
GoVer:      go1.21.4
GoCompiler: gc

Same in version v0.5.3:

The proxy is used in version v0.5.3, download complete:

arnaud@3922:~$ ./regctl version
VCSTag:     v0.5.3
VCSRef:     63bcd1a551acbb357d6a6aea0c50fb193aa77da9
VCSCommit:  63bcd1a551acbb357d6a6aea0c50fb193aa77da9
VCSState:   clean
VCSDate:    2023-10-06T20:40:08Z
Platform:   linux/amd64
GoVer:      go1.21.1
GoCompiler: gc

arnaud@3922:~$ ./regctl image export docker.io/gitlab/gitlab-runner-helper:x86_64-v16.6.0 docker_gitlab-runner.tar --platform linux/amd64 -v debug
DEBU[0000] Loading docker config                         api= blobChunk=0 blobMax=0 helper= hostname=****.local mirrors="[]" name=****.local pathPrefix= repoAuth=false tls=enabled user=other
DEBU[0000] Loading docker config                         api= blobChunk=0 blobMax=0 helper= hostname=****.local mirrors="[]" name=****.local pathPrefix= repoAuth=false tls=enabled user=other
DEBU[0000] regclient initialized                         VCSRef=63bcd1a551acbb357d6a6aea0c50fb193aa77da9 VCSTag=v0.5.3
DEBU[0000] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=false
DEBU[0000] Auth request parsed                           challenge="[{bearer map[realm:https://auth.docker.io/token scope:repository:gitlab/gitlab-runner-helper:pull service:registry.docker.io]}]"
DEBU[0001] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=true
DEBU[0001] Image export                                  ref="docker.io/gitlab/gitlab-runner-helper:x86_64-v16.6.0"
DEBU[0001] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/manifests/x86_64-v16.6.0" withAuth=true
DEBU[0001] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/blobs/sha256:186c9dbc3adb81db22ac69572c0eeda2f566e85d02257a35b8957d892157b796" withAuth=true
DEBU[0002] http req                                      method=GET url="https://registry-1.docker.io/v2/gitlab/gitlab-runner-helper/blobs/sha256:aed45e34cbf41ef992616f4a8d9dddb30171cb06780e2d35ac16af16e2ee35d7" withAuth=true

Environment

  • regctl-linux-amd64
  • Internet through proxy.
  • "Add regclient.Ping method" on Release v0.5.4 > Here the machine cannot ping the registry!

Anything else

Thanks for the report. This looks like a regression from #584. Fixing it will be quick, and I can manually test it. Adding some kind of test to ensure this doesn't happen again may be the challenge.

This should be taken care of with #615. If it looks good to you, let me know and I'll get a new release pushed out with that included. If you don't want to build it locally, the binaries can be downloaded directly from CI: https://github.com/regclient/regclient/actions/runs/6972449849

This should be taken care of with #615. If it looks good to you, let me know and I'll get a new release pushed out with that included. If you don't want to build it locally, the binaries can be downloaded directly from CI: https://github.com/regclient/regclient/actions/runs/6972449849

Hello, I confirm the release on run 6972449849 is working.
Thank you for this great tool and quick update 😄!

Thanks for the confirmation. v0.5.5 is out with the fix. Thanks again for the report and apologies for that breaking change!