Dependency Proxy returns an HTML 404 page for certain images

Summary

One of our customers encountered an issue when trying to use Dependency Proxy to pull an ubuntu image.

When pulling certain images, it will return an HTML 404 error page. For example, trying to pull ubuntu:18.04 will fail but alpine:latest will succeed.

I was able to reproduce this on my end on GitLab.com

Steps to reproduce

  1. Setup Dependency Proxy.
  2. Try to pull the ubuntu:18.04 or ubuntu:latest image.

Example Project

https://gitlab.com/codeclimate-dep-proxy-test

What is the current bug behavior?

docker pull fails with an HTML 404 error.

What is the expected correct behavior?

docker pull succeeds.

Relevant logs and/or screenshots

Example of docker pull that fails:

root@ip-172-31-24-229:~# docker pull gitlab.com/codeclimate-dep-proxy-test/dependency_proxy/containers/ubuntu:latest
Error response from daemon: error parsing HTTP 404 response body: invalid character '<' looking for beginning of value: "<!DOCTYPE html>\n<html>\n<head>\n  <meta content=\"width=device-width, initial-scale=1, maximum-scale=1\" name=\"viewport\">\n  <title>The page you're looking for could not be found (404)</title>\n  <style>\n    body {\n      color: #666;\n      text-align: center;\n      font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n      margin: auto;\n      font-size: 14px;\n    }\n\n    h1 {\n      font-size: 56px;\n      line-height: 100px;\n      font-weight: 400;\n      color: #456;\n    }\n\n    h2 {\n      font-size: 24px;\n      color: #666;\n      line-height: 1.5em;\n    }\n\n    h3 {\n      color: #456;\n      font-size: 20px;\n      font-weight: 400;\n      line-height: 28px;\n    }\n\n    hr {\n      max-width: 800px;\n      margin: 18px auto;\n      border: 0;\n      border-top: 1px solid #EEE;\n      border-bottom: 1px solid white;\n    }\n\n    img {\n      max-width: 40vw;\n      display: block;\n      margin: 40px auto;\n    }\n\n    a {\n      line-height: 100px;\n      font-weight: 400;\n      color: #4A8BEE;\n      font-size: 18px;\n      text-decoration: none;\n    }\n\n    .container {\n      margin: auto 20px;\n    }\n\n    .go-back {\n      display: none;\n    }\n\n  </style>\n</head>\n\n<body>\n  <a href=\"/\">\n    <img src='data:image/svg+xml;base64,PHN2ZyB3aWR0aD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A2LjI5NyAwIDAgMCAyLjA5IDcuMjc4bC4wMTIuMDEuMDMuMDIyIDUuMTYgMy44NjcgNC43NDUtMy41ODQtNy40NDQtNS42MzJaIgogICAgICAgIGZpbGw9IiNGQzZEMjYiLz4KPC9zdmc+Cg==' alt=\"GitLab\"/>\n  </a>\n  <h1>\n    404\n  </h1>\n  <div class=\"container\">\n    <h3>The page could not be found or you don't have permission to view it.</h3>\n    <hr />\n    <p>The resource that you are attempting to access does not exist or you don't have the necessary permissions to view it.</p>\n    <p>Make sure the address is correct and that the page hasn't moved.</p>\n    <p>Please contact your GitLab administrator if you think this is a mistake.</p>\n    <a href=\"javascript:history.back()\" class=\"js-go-back go-back\">Go back</a>\n  </div>\n  <script>\n    (function () {\n      var goBack = document.querySelector('.js-go-back');\n\n      if (history.length > 1) {\n        goBack.style.display = 'inline';\n      }\n    })();\n  </script>\n</body>\n</html>\n"

Example of docker pull that succeeds:

root@ip-172-31-24-229:~# docker pull gitlab.com/codeclimate-dep-proxy-test/dependency_proxy/containers/alpine:latest
latest: Pulling from codeclimate-dep-proxy-test/dependency_proxy/containers/alpine
Digest: sha256:93d5a28ff72d288d69b5997b8ba47396d2cbb62a72b5d87cd3351094b5d578a0
Status: Downloaded newer image for gitlab.com/codeclimate-dep-proxy-test/dependency_proxy/containers/alpine:latest
gitlab.com/codeclimate-dep-proxy-test/dependency_proxy/containers/alpine:latest

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Assignee Loading
Time tracking Loading