Uploaded image for project: 'Picard'
  1. Picard
  2. PICARD-1451

Redirects of authenticated requests fail with 401 error

      Loading my collection some album load requests fail reliable with 401 responses. Example:

       

      E: 15:16:37,532 /usr/lib/python3.7/site-packages/picard/webservice/_init_._handle_reply:383: Network request error for https://musicbrainz.org:443/ws/2/release/4c54ee58-86df-3ba5-aaad-6b284293141b?inc=release-groups+media+recordings+artist-credits+artists+aliases+labels+isrcs+collections+user-collections+artist-rels+release-rels+url-rels+recording-rels+work-rels+recording-level-rels+work-level-rels: Host requires authentication (QT code 204, HTTP code 401)

      E: 15:16:37,534 /usr/lib/python3.7/site-packages/picard/album.error_append:222: Host requires authentication

       

      The same URL works fine with browser. Also other albums work reliable with the same settings.

       

      I currently don't understand what is happening, could also be a server issue. Needs to be investigated.

          [PICARD-1451] Redirects of authenticated requests fail with 401 error

          I think I know what is happening: The affected requests are all result of a redirect (due to MBID merging or such). While we authenticate the first redirect we don't authenticate the second one. We have to make sure to carry over the authentication in case of redirects.

          Philipp Wolfer added a comment - I think I know what is happening: The affected requests are all result of a redirect (due to MBID merging or such). While we authenticate the first redirect we don't authenticate the second one. We have to make sure to carry over the authentication in case of redirects.

          Some more debug output with the actual reply headers and body:

          Headers:

          b'Date' b'Mon, 07 Jan 2019 17:38:41 GMT'
          b'Content-Type' b'application/json; charset=utf-8'
          b'Content-Length' b'189'
          b'Connection' b'keep-alive'
          b'Keep-Alive' b'timeout=15'
          b'X-RateLimit-Limit' b'1200'
          b'X-RateLimit-Remaining' b'975'
          b'X-RateLimit-Reset' b'1546882722'
          b'Server' b'Plack::Handler::Starlet'
          b'ETag' b'"cdfc2b552e4e0bae0a3f51dcc39aa5a4"'
          b'WWW-Authenticate' b'Digest realm="musicbrainz.org", charset=UTF-8, qop="auth,auth-int", nonce="**", opaque="**", algorithm="MD5", Bearer realm="musicbrainz.org", charset=UTF-8'
          b'Access-Control-Allow-Origin' b'*'

           

          Body:

          b'{"error":"Your credentials could not be verified. Either you supplied the wrong credentials (e.g., bad password), or your client doesn\'t understand how to supply the credentials required."}'

           

          Probably a server issue? It works fine with most albums. But some just always return this error for me, and some I could actually reload without error.

          Philipp Wolfer added a comment - Some more debug output with the actual reply headers and body: Headers: b'Date' b'Mon, 07 Jan 2019 17:38:41 GMT' b'Content-Type' b'application/json; charset=utf-8' b'Content-Length' b'189' b'Connection' b'keep-alive' b'Keep-Alive' b'timeout=15' b'X-RateLimit-Limit' b'1200' b'X-RateLimit-Remaining' b'975' b'X-RateLimit-Reset' b'1546882722' b'Server' b'Plack::Handler::Starlet' b'ETag' b'"cdfc2b552e4e0bae0a3f51dcc39aa5a4"' b'WWW-Authenticate' b'Digest realm="musicbrainz.org", charset=UTF-8, qop="auth,auth-int", nonce="** ", opaque=" **", algorithm="MD5", Bearer realm="musicbrainz.org", charset=UTF-8' b'Access-Control-Allow-Origin' b'*'   Body: b'{"error":"Your credentials could not be verified. Either you supplied the wrong credentials (e.g., bad password), or your client doesn\'t understand how to supply the credentials required."}'   Probably a server issue? It works fine with most albums. But some just always return this error for me, and some I could actually reload without error.

            outsidecontext Philipp Wolfer
            outsidecontext Philipp Wolfer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2.1.1