Picard "could not load album" with local replica, requires login

I am starting to use Picard with a local replica MusicBrainz server. The first thing I tried was to load a CD TOC from a CD in my hand, then load the album info into Picard from the local server.

How to reproduce:

  1. Set up a local replica MusicBrainz server using musicbrainz-docker, with data replication
  2. Configure Picard 2.13.3 – Preferences – General – Server address: localhost, port: 5000, “ submit data to the configured server” is unchecked.
  3. Configure Picard – Preferences – Genre – “ Use genres from MusicBrainz” is unchecked, and “ Only use my genres” is unchecked and disabled.
  4. Configure Picard – Preferences – Ratings – “ Enable track ratings” is unchecked.
  5. Insert physical medium CD 13 of release/b8135d into CD Drive.
  6. Using Picard, perform a CD lookup, two incorrect releases found
  7. Press [Submit disc ID] button. Musicbrainz.org web page appears. Find the correct release and position 13/122 of that release. Save the CD TOC to that medium. The Release page appears.
  8. Press the green “Tagger” button on the Release page. In Picard, in the right-hand pane, a message “[loading album information]” appears.

Observed behaviour

  1. Picard displays an alert dialogue, reading,

[?] Picard needs authorization to access your personal data on the MusicBrainz server. would you like to log in now? [No] [Yes]

  1. If I click the “[Yes]” button, a web page appears, with the URL “http://localhost:5000/oauth2/authorize?response_type=code…”, and a message,

Forbidden request

Sorry, you are unable to perform that action on a mirror server.

In order to log in or make changes to the database you must visit the main server at https://musicbrainz.org/.

Then the right-hand pane changes as below.
3. If I click the “[No]” button, the dialogue disappears, and the right-hand pane, the message “[loading album information]” changes to “[could not load album b8135d0a-f234-4e40-944a-c15fa41d73ec]”.

Expected behaviour:

  1. Picard does not ask to log in to a non-standard server.
  2. Picard loads the album information for release/b8135d from the local server.

Discussion:

In the thread, How do i authorize picard to local musicbrainz, the resolution was to uncheck Picard’s “ Only use my genres” and “ Enable track ratings”. They are unchecked for me.

In the thread, Picard asking for authorization when trying to load one specific release, the obstacle appeared to be that the target release had been merged into a Release with a different MBID, and Picard was not following the transition. However, a fix for that was added to Picard in 2019. In this case, there is one Release merge edit in this Release’s history, edit #59316403, but it is merging this MBID into the same MBID.

In the Picard log, I see the following error messages,

I: 17:35:30,238 browser/browser.log_message:172: “GET /openalbum?id=b8135d0a-f234-4e40-944a-c15fa41d73ec HTTP/1.1” 200 -
E: 17:35:30,432 webservice._handle_reply:535: Network request error for http://localhost:5000/oauth2/token → Error transferring http://localhost:5000/oauth2/token - server replied: Bad Request (QT code 302, HTTP code 400)
E: 17:35:30,433 oauth.on_refresh_access_token_finished:301: OAuth: access_token refresh failed: b’{“error_description”:“Invalid protocol, only HTTPS is allowed”,“error”:“invalid_request”}’
E: 17:35:33,735 webservice._handle_reply:535: Network request error for http://localhost:5000/ws/2/release/b8135d0a-f234-4e40-944a-c15fa41d73ec?inc=aliases%2Bannotation%2Bartist-credits%2Bartist-rels%2Bartists%2Bcollections%2Bdiscids%2Bisrcs%2Blabels%2Bmedia%2Brecording-level-rels%2Brecording-rels%2Brecordings%2Brelease-group-level-rels%2Brelease-groups%2Brelease-rels%2Bseries-rels%2Burl-rels%2Buser-collections%2Bwork-level-rels%2Bwork-rels → Host requires authentication (QT code 204, HTTP code 401)
E: 17:35:33,736 ui/item.error_append:108: <Album b8135d0a-f234-4e40-944a-c15fa41d73ec ‘’>: Host requires authentication

I notice that the request includes “%2Buser-collections”. If I delete that string from the URL, then my local server returns an expected XML file. Is Picard asking for user collections information? Is there a way to prevent it from doing so?

Looking at Picard’s source code, it seems that the only place user-collections is mentioned is at picard/album.py#L686-L688. The code reads,

        if self.tagger.webservice.oauth_manager.is_authorized():
            require_authentication = True
            inc |= {'user-collections'}

I tried logging Picard out of MusicBrainz, by going to Picard – Preferences – General – MusicBrainz Account and clicking the [Log out] button. Then I was able to return the MusicBrainz.org Release page for release/b8135d, press the green “Tagger” button there, and have the Expected Behaviour take place.

So, I am fine with having Picard not logged in to my Replica server, but I would like it to be logged in to the musicbrainz.org server so that I can upload CD TOCs and acoustic fingerprints. I will try those operations next, and see what happens.

Is Picard able to distinguish between the login status of the “Server address” in the Preferences, and the login status of the “primary database on musicbrainz.org”?

It appears that I am able to upload CD TOCs with Picard being logged out of MusicBrainz.

In the Picard documentation for the General page of Preferences, it says,

Username

Your MusicBrainz website username, used to submit acoustic fingerprints, retrieve and save items to your collections, and retrieve personal folksonomy tags.

I see Preferences options to disable personal folksonomy tags, but not options to retrieve and save items to my collections. Is there a way to disable Picard’s attention to my collections? I do not use that feature.

Being logged in to the main server is not actually useful. The only data that could be written back via API are ratings and collections. And both features won’t work if Picard is not able to get this personal data when fetching data. Hence logging out is actually the correct solution.

Picard could probably automatically log the user out when servers get switched. Also yes, we could make the collection feature optional as well.

Thank you for your reply.

Yes, that occurred to me also. I have created issue PICARD-3137 Log out from server when user changes server address to track this idea.

I have created PICARD-3138 Make user-collections retrieval optional, similar to genres and ratings to track this idea.

1 Like