Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'title' during import [fromfilename plugin] #5297

Open
guerda opened this issue Jun 10, 2024 · 1 comment
Open

KeyError: 'title' during import [fromfilename plugin] #5297

guerda opened this issue Jun 10, 2024 · 1 comment

Comments

@guerda
Copy link

guerda commented Jun 10, 2024

Problem

During a rather large import, after selecting a specific (to skip), beets just fails with a KeyError. From the stacktrace, it seems it comes from the fromfilename plugin:

$ beet -vv import
user configuration: /home/pi/.config/beets/config.yaml
data directory: /home/pi/.config/beets
plugin paths:
fetchart: google: Disabling art source due to missing key
fetchart: lastfm: Disabling art source due to missing key
Sending event: pluginload
library database: /home/pi/.beets/musiclibrary.db
library directory: /media/audio
Sending event: library_opened
Sending event: import_begin
ignoring b'.mediaartlocal' due to ignore rule b'.*'
ignoring b'.DS_Store' due to ignore rule b'.*'
[...]
Sending event: import_task_created
Sending event: import_task_choice
Traceback (most recent call last):
  File "/home/pi/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.10/site-packages/beets/ui/__init__.py", line 1865, in main
    _raw_main(args)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/ui/__init__.py", line 1852, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/ui/commands.py", line 1395, in import_func
    import_files(lib, paths, query)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/ui/commands.py", line 1326, in import_files
    session.run()
  File "/home/pi/.local/lib/python3.10/site-packages/beets/importer.py", line 360, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/util/pipeline.py", line 447, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/pi/.local/lib/python3.10/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/util/pipeline.py", line 195, in coro
    func(*(args + (task,)))
  File "/home/pi/.local/lib/python3.10/site-packages/beets/importer.py", line 1490, in lookup_candidates
    plugins.send("import_task_start", session=session, task=task)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/plugins.py", line 507, in send
    result = handler(**arguments)
  File "/home/pi/.local/lib/python3.10/site-packages/beets/plugins.py", line 143, in wrapper
    return func(*args, **kwargs)
  File "/home/pi/.local/lib/python3.10/site-packages/beetsplug/fromfilename.py", line 165, in filename_task
    apply_matches(d, self._log)
  File "/home/pi/.local/lib/python3.10/site-packages/beetsplug/fromfilename.py", line 124, in apply_matches
    item.title = str(d[item][title_field])
KeyError: 'title'

Here's a link to the music files that trigger the bug (if relevant):

Setup

  • OS: raspberry pi OS
  • Python version: 3.10
  • beets version: 2.0
  • Turning off plugins made problem go away (yes/no): yes

My configuration (output of beet config) is:

terminal_encoding: utf-8
directory: /media/audio
library: ~/.beets/musiclibrary.db
match:
  preferred:
    countries: ['DE', 'US', 'GB|UK']
    media: ['CD', 'Digital Media|File']
    original_year: yes
duplicate_action: keep

import:
  copy: no
  write: yes
  move: yes
plugins: inline convert web chroma replaygain duplicates fromfilename fetchart
replaygain:
  backend: command
  auto: no
web:
  host: 0.0.0.0

acoustid:
  apikey: ltYFb9EEwR

fetchart:
  auto: yes
  cautious: yes

https://github.com/beetbox/beets/blob/master/beetsplug/fromfilename.py#L124 offending line

Unfortunately, I cannot pinpoint the offending MP3 file (neither from the logs nor from the progress during the import).

@guerda
Copy link
Author

guerda commented Jun 10, 2024

Could be a duplicate of #5218

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant