Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Docker Registry
  3. Cannot install apps from docker-registry because authentication fails

Cannot install apps from docker-registry because authentication fails

Scheduled Pinned Locked Moved Solved Docker Registry
dockerregistryauthentication
24 Posts 8 Posters 3.3k Views 8 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • nottheendN nottheend

    Few years after the original bug got fixed, I am encountering the same error for my selfhosted private registry:

    Docker Error - Unable to pull image mydomain.com/myusername/myapp:1.0.0 Please check the network or if the image needs authentication. statusCode 500
    

    In the logs are 10 not successful pull attempts visible.

    The Docker registry is hosted on the same Cloudron server, it is Docker Registry App from official App Store.

    In the settings if my Cloudron instance, I configured a Private Docker Registry with the same Credentials I used to successfully push the Docker build from local. I changed from Docker to Other just to be sure, with the same credentials.
    After building the build, I can successfullypush it with the very same credentials to the private Docker Hub.

    Is there any way how to come closer to the probable authentication error?

    nottheendN Offline
    nottheendN Offline
    nottheend
    wrote on last edited by
    #21

    @nottheend have created a new topic since it is most likely not this bug:
    https://forum.cloudron.io/topic/12216/docker-error-unable-to-pull-image-on-same-instance

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jk
      wrote last edited by
      #22

      Hi, I have encountered this bug once more, with the following user agents:

      • Podman: libpod/<version>
      • Skopeo: skopeo/<version>

      @girish Would it be possible to add those as well? That would be much appreciated.

      In src/proxyAuth.js

      // someday this can be more sophisticated and check for a real browser
      function isBrowser(req) {
          const userAgent = req.get('user-agent');
          if (!userAgent) return false;
      
          // https://github.com/docker/engine/blob/master/dockerversion/useragent.go#L18
          return !userAgent.toLowerCase().includes('docker') && !userAgent.toLowerCase().includes('container') && !userAgent.toLowerCase().includes('libpod') && !userAgent.toLowerCase().includes('skopeo');
      }
      

      In src/nginxconfig.ejs

          location @proxy-auth-login {
              if ($http_user_agent ~* "docker") {
                  return 401;
              }
              if ($http_user_agent ~* "container") {
                  return 401;
              }
              if ($http_user_agent ~* "libpod") {
                  return 401;
              }
              if ($http_user_agent ~* "skopeo") {
                  return 401;
              }
      
              return 302 /login?redirect=$request_uri;
          }
      
      girishG 1 Reply Last reply
      1
      • J jk

        Hi, I have encountered this bug once more, with the following user agents:

        • Podman: libpod/<version>
        • Skopeo: skopeo/<version>

        @girish Would it be possible to add those as well? That would be much appreciated.

        In src/proxyAuth.js

        // someday this can be more sophisticated and check for a real browser
        function isBrowser(req) {
            const userAgent = req.get('user-agent');
            if (!userAgent) return false;
        
            // https://github.com/docker/engine/blob/master/dockerversion/useragent.go#L18
            return !userAgent.toLowerCase().includes('docker') && !userAgent.toLowerCase().includes('container') && !userAgent.toLowerCase().includes('libpod') && !userAgent.toLowerCase().includes('skopeo');
        }
        

        In src/nginxconfig.ejs

            location @proxy-auth-login {
                if ($http_user_agent ~* "docker") {
                    return 401;
                }
                if ($http_user_agent ~* "container") {
                    return 401;
                }
                if ($http_user_agent ~* "libpod") {
                    return 401;
                }
                if ($http_user_agent ~* "skopeo") {
                    return 401;
                }
        
                return 302 /login?redirect=$request_uri;
            }
        
        girishG Offline
        girishG Offline
        girish
        Staff
        wrote last edited by
        #23

        @jk fixed in https://git.cloudron.io/platform/box/-/commit/2b30f5591cddabe6b2a0db1fc23bf151c86274b7 . thanks!

        1 Reply Last reply
        1
        • J Offline
          J Offline
          jk
          wrote last edited by
          #24

          Thanks a lot!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Bookmarks
          • Search