Skip to content

fetchart weird file not found error #5717

@j-venerable

Description

@j-venerable

Running fetchart will throw an error when fetching album art for a specific album. The error occurs regardless of the album art source (tried bandcamp and itunes)

Problem

Running this command in verbose (-vv) mode:

$ beet -vv fetchart

Led to this problem:

fetchart: trying source bandcamp for album Cédric Dind-Lavoie - Archives
bandcamp: downloading image: https://f4.bcbits.com/img/a1152109936_10.jpg
bandcamp: downloaded art to: /var/folders/cm/xwg3d_hx6ps1jk3430bt8tx80000gp/T/beets/beetsplug_fetchart/wf_nzrir.jpg
fetchart: using remote image /var/folders/cm/xwg3d_hx6ps1jk3430bt8tx80000gp/T/beets/beetsplug_fetchart/wf_nzrir.jpg
Traceback (most recent call last):
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beets/util/__init__.py", line 529, in move
    os.replace(syspath(path), syspath(dest))
    ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/cm/xwg3d_hx6ps1jk3430bt8tx80000gp/T/beets/beetsplug_fetchart/wf_nzrir.jpg' -> '/Users/username/Music/Library/Cedric Dind-Lavoie/Archives/cover.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/username/.local/bin/beet", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beets/ui/__init__.py", line 1870, in main
    _raw_main(args)
    ~~~~~~~~~^^^^^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beets/ui/__init__.py", line 1849, in _raw_main
    subcommand.func(lib, suboptions, subargs)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beetsplug/fetchart.py", line 1369, in func
    self.batch_fetch_art(
    ~~~~~~~~~~~~~~~~~~~~^
        lib, lib.albums(ui.decargs(args)), opts.force, opts.quiet
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beetsplug/fetchart.py", line 1440, in batch_fetch_art
    self._set_art(album, candidate)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beetsplug/fetchart.py", line 1327, in _set_art
    album.set_art(candidate.path, delete)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beets/library.py", line 1489, in set_art
    util.move(path, artdest)
    ~~~~~~~~~^^^^^^^^^^^^^^^
  File "/Users/username/.local/pipx/venvs/beets/lib/python3.13/site-packages/beets/util/__init__.py", line 534, in move
    tmp = tempfile.NamedTemporaryFile(
        suffix=syspath(b".beets", prefix=False),
    ...<2 lines>...
        delete=False,
    )
  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tempfile.py", line 582, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
                    newline=newline, encoding=encoding, errors=errors,
                    opener=opener)
  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tempfile.py", line 579, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
               ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.2/Frameworks/Python.framework/Versions/3.13/lib/python3.13/tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/username/Music/Library/Cedric Dind-Lavoie/Archives/.cover.jpg.m4wlic9j.beets'

Here's a link to the music files that trigger the bug (if relevant):
https://cornedebrume.bandcamp.com/album/archives-c-dric-dind-lavoie

Setup

  • OS: MacOS 15.4 (24E248)
  • Python version: 3.13.2
  • beets version: 2.2.0
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

directory: ~/Music/Beets
# --------------- Main ---------------

library: ~/Music/musiclibrary.db

import:
    move: yes
    log: ~/Music/beets_import.log

# --------------- Plugins ---------------

plugins: inline convert web fetchart scrub bareasc badfiles bandcamp fromfilename chroma discogs deezer edit
asciify_paths: no
convert:
    quiet: yes
    delete_originals: yes
    auto: yes
    never_convert_lossy_files: yes
    format: opus
    formats:
        opus:
            command: ffmpeg -i $source -y -vn -acodec libopus -b:a 192k $dest
            extension: opus
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    dest:
    pretend: no
    link: no
    hardlink: no
    threads: 8
    id3v23: inherit
    max_bitrate:
    auto_keep: no
    tmpdir:
    embed: yes
    paths: {}
    no_convert: ''
    copy_album_art: no
    album_art_maxwidth: 0
    playlist:
fetchart:
    sources: bandcamp filesystem coverart itunes amazon albumart
    auto: yes
    minwidth: 500
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    store_source: no
    high_resolution: no
    deinterlace: no
    cover_format:
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    lastfm_key: REDACTED
bandcamp:
    art: yes
    split_artist_title: yes
    include_digital_only_tracks: yes
    search_max: 2
    exclude_extra_fields: []
    genre:
        capitalize: no
        maximum: 0
        mode: progressive
        always_include: []
    comments_separator: '

        ---

        '
    truncate_comments: no
edit:
    albumfields: album albumartist
    itemfields: track title artist album
    ignore_fields: id path
scrub:
    auto: yes
web:
    host: 127.0.0.1
    port: 8337
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    include_paths: no
    readonly: yes
deezer:
    source_weight: 0.5
pathfields: {}
item_fields: {}
album_fields: {}
bareasc:
    prefix: '#'
chroma:
    auto: yes
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
    separator: ', '
    index_tracks: no
    append_style_genre: no

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions