Skip to content

nightly-5ae86d13-ls3

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 01 Nov 12:15
· 20 commits to nightly since this release

CI

Test report · Build status

LinuxServer changes

No changes

Upstream changes

Source: beetbox/beets@5ae86d1

Log failed metadata searches without a traceback at error level (#7119)

Description

Fixes #6960.

When MusicBrainz is down or unreachable, beet import prints a 50-line
urllib3/requests traceback for every search. _search_api in
beets/metadata_plugins.py catches the error but logs it at error level
with exc_info=True.

Search failures caused by requests (ConnectionError, Timeout,
retries exhausted, HTTP errors) now log the one-line message at error
level, for example Error searching MusicBrainz: HTTPSConnectionPool(host='musicbrainz.org', port=443): Max retries exceeded ..., and keep the traceback at debug level. That is how
maybe_handle_plugin_error in the same module already logs plugin
failures. raise_on_error still re-raises, and errors that are not from
requests keep the full traceback, since those are more likely bugs.

The thread suggested catching connection errors in RequestHandler
instead. I kept the change in _search_api because every search-based
metadata source goes through it, including plugins that do not use
RequestHandler, and the plugins' other error handling stays as it is.
Happy to move it if you prefer that layer.

The new test in test/test_metadata_plugins.py makes
get_search_response raise ConnectionError and checks that the error
record has the message and no traceback. It fails without the change.

Tests: pytest test/test_metadata_plugins.py test/plugins/test_musicbrainz.py, 73 passed (72 before the new test).

This change was prepared with an AI coding assistant (Claude Code,
claude-sonnet-5-5) and reviewed before submission.

To Do

  • Documentation.
  • Changelog.
  • Tests.