beets icon indicating copy to clipboard operation
beets copied to clipboard

Certain albums are not searched on musicbrainz with any plugin enabled?

Open 0xE0-rng opened this issue 1 year ago • 19 comments

Hi! Thanks for the cool tool! I was a user a few years ago and just got into it again. Unfortunatly with some small issue :/

Problem

I am sure it has to do with my setup, but I cannot find the issue. With a minimal config, some Albums are just not searched on musicbrainz. One example is https://musicbrainz.org/release/34547462-bb50-435d-a8ba-eae72430875b or https://musicbrainz.org/release/f72d8759-1d81-4902-9cb1-403937271c51 This happens with any plugins enabled, however if I disable the plugins it works as expected.

root@b6692f89a99d:/downloads# beet -vv import RÜFÜS\ -\ Inhale\ _\ Exhale\ Remixed\,\ Vol.\ 1/
user configuration: /config/config.yaml
data directory: /config
plugin paths: []
Loading plugins: convert
Sending event: pluginload
library database: /config/musiclibrary.blb
library directory: /data/newMusic
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /downloads/RÜFÜS - Inhale _ Exhale Remixed, Vol. 1
Tagging RÜFÜS - Inhale / Exhale Remixed, Vol. 1
No album ID found.
Search terms: RÜFÜS - Inhale / Exhale Remixed, Vol. 1
Album might be VA: False
Evaluating 0 candidates.

/downloads/RÜFÜS - Inhale _ Exhale Remixed, Vol. 1 (15 items)
Sending event: import_task_before_choice
Sending event: before_choose_candidate
No matching release found for 15 tracks.
For help, see: https://beets.readthedocs.org/en/latest/faq.html#nomatch
➜ [S]kip, Use as-is, as Tracks, Group albums, Enter search, enter Id, aBort? B
Sending event: import
Sending event: cli_exit

As soon as I disabled the one plugin from the config this happens:

root@b6692f89a99d:/downloads# beet -vv import RÜFÜS\ -\ Inhale\ _\ Exhale\ Remixed\,\ Vol.\ 1/
user configuration: /config/config.yaml
data directory: /config
plugin paths: []
Loading plugins: musicbrainz
Sending event: pluginload
library database: /config/musiclibrary.blb
library directory: /data/newMusic
Sending event: library_opened
Sending event: import_begin
Sending event: import_task_created
Sending event: import_task_start
Looking up: /downloads/RÜFÜS - Inhale _ Exhale Remixed, Vol. 1
Tagging RÜFÜS - Inhale / Exhale Remixed, Vol. 1
No album ID found.
Search terms: RÜFÜS - Inhale / Exhale Remixed, Vol. 1
Album might be VA: False
musicbrainz: Searching for MusicBrainz releases with: {'release': 'inhale / exhale remixed, vol. 1', 'alias': 'inhale / exhale remixed, vol. 1', 'tracks': '15', 'artist': 'rüfüs'}
musicbrainz: Requesting MusicBrainz release 39a21a65-9bae-4116-9a7e-b323a16f970e
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
Sending event: mb_track_extract
[...]

which then finds the correct release

Setup

I am running beets in docker using this docker compose: https://hub.docker.com/r/linuxserver/beets

root@b6692f89a99d:/downloads# beet --version
beets version 2.5.1
Python version 3.12.12
plugins: convert, discogs, embedart, fetchart, zero

OS: Linux b6692f89a99d 6.6.44-production+truenas #1 SMP PREEMPT_DYNAMIC Fri Jul 11 12:56:00 UTC 2025 x86_64 GNU/Linux Turning off plugins made problem go away (yes/no): yes

My configuration (output of beet config) is: ( if I comment out the lyrics plugin or any other the album is not found anymore)

# plugins: fetchart chroma embedart convert scrub replaygain lastgenre lyrics zero discogs
plugins: lyrics
directory: /data/newMusic
library: /config/musiclibrary.blb

0xE0-rng avatar Oct 23 '25 00:10 0xE0-rng

You have to enable the musicbrainz plugin. See docs here.

arsaboo avatar Oct 23 '25 00:10 arsaboo

@arsaboo was there a mention in this in a changelog somewhere? I got hit by this too, it always worked out of the box, but I assume some point recently musicbrainz was removed from the defaults or something?

Nevermind, see the 2.4.0 release notes mentioning it now.

Gillingham avatar Oct 23 '25 00:10 Gillingham

Yeah...we could have done a better job communicating the change. The changelog is a good place... unfortunately, most users skip it.

arsaboo avatar Oct 23 '25 01:10 arsaboo

I guess that makes sense and will play around with it tomorrow.
Still I am not sure why it fails just for some albums? Why does the majority of albums get tagged correctly (using musicbrainz?) ? I always assumed musicbrainz is beets source of truth, but following this logic there must be another source? Where does beets then pull the metadata from?

Anyway, not to be over critical but in my opinion this behavior is not really intuitive. Beets with disabled Plugins uses the musicbrains plugin, otherwise you have to enable it. This is not communicted (maybe a warning in the console?) and seems like a breaking change for most users.

0xE0-rng avatar Oct 23 '25 01:10 0xE0-rng

I think what's happening, is that when no plugins are specified, beets uses a default plugin configuration that includes musicbrainz. Once any plugin is specified, the new user plugin list takes precedence. Since discogs is on your plugin list, it still has a database to pull information from.

I agree, the behavior is not intuitive, and there's definitely work to be done to make it more user friendly. I do think a wider discussion is to be had if Musicbrainz should still be treated as the source of truth for beets, especially since it's easily overridden now, but it was certainly weird change to have happened in a minor release.

I think we might have had a PR to add a warning if no metadata plugin is enabled but I can't find it at the moment.

henry-oberholtzer avatar Oct 24 '25 01:10 henry-oberholtzer

It was especially confusing since beets still prompted me for entering the Id, so I tried pasting the album MB ID, the release ID, rinse, repeat etc for awhile before I found this issue. If no metadata provider is declared, what does prompting for an ID even do?

Gillingham avatar Oct 24 '25 01:10 Gillingham

Thanks for the feedback guys, see #6127 as a potential solution to this. It enables musicbrainz by default and supplies a deprecation warning. However, there is one issue with this: how can we tell the difference between

  1. users not having migrated to the new system, where they haven't yet added musicbrainz to the plugins list
  2. users not wanting to use musicbrainz where they explicitly do not add it to the plugins list

We don't to warn users about the need to add musicbrainz to the plugins list when they explicitly don't want to use it. For now, I made the disabled_plugins list available, which can be used to explicitly disable musicbrainz.

Do you have any other suggestions, what would be the best way to deal with this?

snejus avatar Oct 25 '25 13:10 snejus

I think for handling missing metadata plugins, we should throw an error, and ask the user if they'd like to use musicbrainz.

I'm not sure how possible it is for us to modify the user's config file, but if possible we could just add it to the list of enabled plugins and then the warning shouldn't appear again, unless the user intentionally switches for just discogs, or spotify, or similar.

henry-oberholtzer avatar Oct 25 '25 21:10 henry-oberholtzer

Take my configuration as an example:

plugins:
  # - bpd
  # - substitute
  # - fish
  - autobpm
  # - acousticbrainz
  # - absubmit
  # - aura
  # - bpd
  # - embyupdate
  - bareasc
  - bandcamp
  - bench
  # - convert
  - deezer
  - chroma
  # - describe
  - discogs
  # - duplicates
  - edit
  - embedart
  - fetchart
  # - fromfilename
  - importreplace
  # - importfeeds
  - info
  - inline
  - lastimport
  - lastgenre
  - lyrics
  - missing
  # - musicbrainz
  - mbcollection
  - mbsync
  - mpdstats
  - mpdupdate
  - random
  - scrub
  - spotify
  - replaygain
  - types
  - unimported
  # - ytimport

What behaviour should I expect?

snejus avatar Oct 25 '25 21:10 snejus

In my understanding, we'd be able to parse that there's at least one metadata plugin, and so there would not be an error thrown.

But it does raise a good point that it might not be clear to new users what sources are being used if they've specified others and assume musicbrainz is still enabled, so I guess that's where deprecation warnings come in.

Makes me think, is the right move is to move musicbrainz back into a constant default plugin that has to be explicitly disabled, or is that too much of a flip flop?

henry-oberholtzer avatar Oct 25 '25 21:10 henry-oberholtzer

In my understanding, we'd be able to parse that there's at least one metadata plugin, and so there would not be an error thrown.

This way, @0xE0-rng and @Gillingham configurations above will be fine and they won't receive warnings since they have other data source plugins enabled.

snejus avatar Oct 25 '25 22:10 snejus

I think for handling missing metadata plugins, we should throw an error, and ask the user if they'd like to use musicbrainz.

I'm not sure how possible it is for us to modify the user's config file, but if possible we could just add it to the list of enabled plugins and then the warning shouldn't appear again, unless the user intentionally switches for just discogs, or spotify, or similar.

This is very similar to the behaviour that we currently have, where musicbrainz is enabled by default:

# config_default.yaml
...
plugins: [musicbrainz]

Regarding

we should throw an error, and ask the user if they'd like to use musicbrainz.

I'm not sure if we can perform such a check reliably - we can check for internal data sources, however I often enable bandcamp only - I don't want to be seeing warnings in such case.

To be honest, I am leaning towards keeping the current behaviour where we don't throw errors (or warnings) about musicbrainz not being enabled, since this issue seems to have been limited to just a couple of users.

snejus avatar Oct 25 '25 23:10 snejus

Did not follow this closely but how about we just check if atleast one metadata plugin is present on runtime? If not, we could show a warning which can be disabled with a config option.

-> Users get notified if something might be wrong -> Advanced users have the ability to disable the warning

semohr avatar Oct 26 '25 09:10 semohr

That's a great and simple solution.

We could also solve the issue of this ticket with an extra, similar warning if Musicbrainz is not enabled.

henry-oberholtzer avatar Oct 26 '25 13:10 henry-oberholtzer

Did not follow this closely but how about we just check if atleast one metadata plugin is present on runtime? If not, we could show a warning which can be disabled with a config option.

-> Users get notified if something might be wrong -> Advanced users have the ability to disable the warning

This does not solve the issue for users under this issue who had other metadata sources enabled but expected musicbrainz to be loaded too, as before.

snejus avatar Oct 26 '25 14:10 snejus

I think that's why we could have a second warning that can be disabled, perhaps only until the next major version change.

henry-oberholtzer avatar Oct 26 '25 16:10 henry-oberholtzer

Hi there, I'm new here so sorry if I suggest something wrong.

I was thinking, how feasible is it to ask for user input and modify their config files based on that input ?

For example, upon execution, if beets detects the old musicbrainz.enable line, ask the user something along "Hey there, we noticed your config file uses a deprecated version of the Musicbrainz plugin. Would you like to switch to the updated Musicbrainz plugin ? yes/no"

yes : modify config file with plugins.append('musicbrainz') and remove musicbrainz.enable no : user input again -> "would you like to disable future warnings ?"

Tell me if that's stupid !

zonzille avatar Nov 04 '25 12:11 zonzille

I don't think we want to modify the config files. Maybe we can show a log/warning.

arsaboo avatar Nov 04 '25 14:11 arsaboo

I would say that the problem on this is more that the version was bump to 2.4.0 instead of 3.0.0 as it was breaking. That's normally trigger us a bell to check if there is some change on the new major version instead of just updating it without really care about it

LEX0RE avatar Nov 19 '25 02:11 LEX0RE