beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.92k stars 1.82k forks source link

beet move IOError #2768

Closed vissieGP closed 6 years ago

vissieGP commented 6 years ago

Hi. I'm trying to move my library to a new location. Old location: /export/zfs/Music/Sorted New Locasion: /export/zfs/Music/Sorted/Vissie

So I ran the following command: beet move -p -d /export/zfs/Music/Sorted/Vissie/ That worked. Then I run: beet move -d /export/zfs/Music/Sorted/Vissie/ This gave me this error: IOError: [Errno 2] No such file or directory: '/export/zfs/Music/Sorted//.mp3' I remembered that I had a file with issues that I fixed with ncmpcpp. So I was not too worried with this error.

  1. Should the pretend not have given the same error? Why did everything seem to be fine with the pretend, but gave a fatal python error with the actual command?
  2. Can the move not skip error and complete? This way it will not break have way into the process leaving one in the middle so to speak?

Seeing that I knew what was the issue (and as luck might have had it, that was the very first file that was moved!!) I continued. I ran: beet update.

That seemed to fix and update my database. At some point, I got the following error: IOError: [Errno 2] No such file or directory: '/export/zfs/Music/Sorted/Death Cab for Cutie/I Will Possess Your Heart/cover.1.jpg'

Not sure why, I just re-ran the update process. This time it finalized without any issues. I ran the same command again. Again, no error.

Thinking that I was good to go, I tried the move again, so I ran: beet move -p -d /export/zfs/Music/Sorted/Vissie/ No errors this time. I ran: beet move -d /export/zfs/Music/Sorted/Vissie/

This time it started to move my files, one by one. And sadly, I got this error: Sending event: database_change moving album art /export/zfs/Music/Sorted/Death Cab for Cutie/I Will Possess Your Heart/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/Death Cab for Cutie/I Will Possess Your Heart/cover.jpg Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/beets/util/init.py", line 471, in move shutil.copyfile(path, dest) File "/usr/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/export/zfs/Music/Sorted/Death Cab for Cutie/I Will Possess Your Heart/cover.1.jpg'

Error: No such file or directory while moving /export/zfs/Music/Sorted/Death Cab for Cutie/I Will Possess Your Heart/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/Death Cab for Cutie/I Will Possess Your Heart/cover.jpg

I had a look at the file system: [vissie][dlBeast]:~$ls /export/zfs/Music/Sorted/Death\ Cab\ for\ Cutie/I\ Will\ Possess\ Your\ Heart/ cover.2.jpg cover.jpg

I have now reran this command: beet move -d /export/zfs/Music/Sorted/Vissie/

It ran for a while..... Sending event: before_item_moved Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/beets/util/init.py", line 471, in move shutil.copyfile(path, dest) File "/usr/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/export/zfs/Music/Sorted/The Kinks/The Kinks - Lola.mp3'

Error: No such file or directory while moving /export/zfs/Music/Sorted/The Kinks/The Kinks - Lola.mp3 to /export/zfs/Music/Sorted/Vissie/The Kinks/The Kinks - Lola.1.mp3

I looked on the file system: [vissie][dlBeast]:~$ls /export/zfs/Music/Sorted/The\ Kinks/ The Kinks - Sunny Afternoon.mp3 The Kinks - You Really Got Me.mp3 [vissie][dlBeast]:~$ls /export/zfs/Music/Sorted/Vissie/The\ Kinks/ The Kinks - All Day and All of the Night.mp3 The Kinks - Lola.mp3

  1. I am starting to get the idea that the ".1" is the files is a "internal" beet issue. I mean there is no reason to have a .1 as part of the file/song name ( that was build up by beet as you would see from my config file). Should the beets update that I ran 3 times not have fixed any of these "file not found" issues?
  2. The file that is missing, is the file that was copied. You will see that file is already at the end destination. The move moved it....

So I ran: mv ./Vissie/The\ Kinks/The\ Kinks\ -\ Lola.mp3 ../Sorted/The\ Kinks/. beet move -d /export/zfs/Music/Sorted/Vissie/

The move them continued..... Error: moving album art /export/zfs/Music/Sorted/P!nk/Raise Your Glass/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/P!nk/Raise Your Glass/cover.jpg Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/beets/util/init.py", line 471, in move shutil.copyfile(path, dest) File "/usr/lib/python2.7/shutil.py", line 82, in copyfile with open(src, 'rb') as fsrc: IOError: [Errno 2] No such file or directory: '/export/zfs/Music/Sorted/P!nk/Raise Your Glass/cover.1.jpg'

Error: No such file or directory while moving /export/zfs/Music/Sorted/P!nk/Raise Your Glass/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/P!nk/Raise Your Glass/cover.jpg

Command: beet move -d /export/zfs/Music/Sorted/Vissie/

Seems to have finished now.... [vissie][dlBeast]:/export/zfs/Music$ls ./Sorted/ Death Cab for Cutie music_lib.db P!nk Vissie [vissie][dlBeast]:/export/zfs/Music$ls ./Sorted/Death\ Cab\ for\ Cutie/ I Will Possess Your Heart [vissie][dlBeast]:/export/zfs/Music$ls ./Sorted/Death\ Cab\ for\ Cutie/I\ Will\ Possess\ Your\ Heart/ cover.2.jpg cover.jpg [vissie][dlBeast]:/export/zfs/Music$ls ./Sorted/P!nk/ Raise Your Glass [vissie][dlBeast]:/export/zfs/Music$ls ./Sorted/P!nk/Raise\ Your\ Glass/ cover.2.jpg cover.jpg

I'm not worried about the cover art. I can now delete these 2 remaining folders.

All seems to be fine now! A bit of a hairy experience. I LOVE and swear by beets! That will not change. I am happy to get involved to make it better. Hence this bug report. Let me know where I can help. I'm happy to help. I'm a paid Python developer these days.

Setup

My configuration (output of beet config) is:

Beets configuration --------------------------------------------------------

directory: /export/zfs/Music/Sorted

library: /export/zfs/Music/Sorted/music_lib.db

plugins: chroma fromfilename fetchart embedart lyrics discogs absubmit acousticbrainz edit mbsync smartplaylist

import: move: yes log: /export/zfs/Music/beet.log write: yes

Paths ----------------------------------------------------------------------

#

Paths and filenames for music files

relative to music directory

paths: default: $albumartist/$album%aunique{}/$artist - $track - $title singleton: $albumartist/$artist - $title comp: $album%aunique{}/$artist - $track - $title

use mutliple threads during import

threaded: yes timeout: 5.0 verbose: yes

ui: color: yes list_format_item: %upper{$artist} - $album - $track. $title list_format_album: %upper{$albumartist} - $album time_format: '%Y-%m-%d %H:%M:%S' terminal_encoding: utf8 colors: text_success: green text_warning: yellow text_error: red text_highlight: red text_highlight_minor: lightgray action_default: turquoise action: blue

acoustid: apikey: xxxxxxxxxxxx

absubmit: auto: yes

edit: itemfields: acoustid_id album albumartist artist average_loudness bitrate channels comments disc disctotal format gender genre length path samplerate title track tracktotal year

Auto Tagger ----------------------------------------------------------------

match: strong_rec_thresh: 0.1 # match 90% or better for auto import medium_rec_thresh: 0.25 rec_gap_thresh: 0.25 max_rec: missing_tracks: medium unmatched_tracks: medium distance_weights: source: 2.0 artist: 3.0 album: 3.0 media: 1.0 mediums: 1.0 year: 1.0 country: 0.5 label: 0.5 catalognum: 0.5 albumdisambig: 0.5 album_id: 5.0 tracks: 2.0 missing_tracks: 0.9 unmatched_tracks: 0.6 track_title: 3.0 track_artist: 2.0 track_index: 1.0 track_length: 2.0 track_id: 5.0 preferred: countries: [] media: [] original_year: no ignored: [] track_length_grace: 10 track_length_max: 30

embedart: auto: yes compare_threshold: 50

smartplaylist: auto: yes

relative_to: /media/zfs/Music/Sorted

playlist_dir: /export/zfs/Music/mpd/playlists
playlists:
    - name: All.m3u
      query: ''

    - name: New.m3u
      query: 'added:2017-12-25..'
sampsyo commented 6 years ago

Hi! Yes, the move command currently stops when it finds files that were tracked by the database but have since been moved/deleted. That's a mistake—issue https://github.com/beetbox/beets/issues/1926 is about making the command "keep on trucking" when this happens so you don't have to manually clean things up. Does that address the problem here (hypothetically)?

vissieGP commented 6 years ago

HI! Thx for the quick reply. I guess it will lighten the impact and work.

Any idea about the ".1" that made its way into the DB?

Vissie

sampsyo commented 6 years ago

Beets uses a .1 suffix when it tries to copy a file to a destination but finds that there’s already a file with that name there. It avoids the conflict by changing the name slightly. So my best guess is that there used to be (untracked) files without the .1 suffix; the importer avoided the conflict; and then at some point along the way the un-suffixed files got deleted.

vissieGP commented 6 years ago

Hi. So this happened again. I deleted my DB, I moved my music to a temp folder. I started from scratch. At the end, I did a update. error: Error: No such file or directory while moving /export/zfs/Music/Sorted/Vissie/blink‐182/Greatest Hits/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/blink‐182/Greatest Hits/cover.1.jpg

Brand new DB, brand new location. With the import, the cover was downloaded. With the update beets is looking for a file that was never there.

Any idea how I can now get rid of the error? My update fails with that ever time.

Vissie

vissieGP commented 6 years ago

I found another one.... [vissie][dlBeast]:.../Music/Sorted/Vissie$beet --config ~/beets/Vissie_beets.yaml update Creedence Clearwater Revival - Greatest Hits - Travelin' Band initial_key: F -> bpm: 165.506256104 -> 0 Error: No such file or directory while moving /export/zfs/Music/Sorted/Vissie/Creedence Clearwater Revival/Greatest Hits/cover.1.jpg to /export/zfs/Music/Sorted/Vissie/Creedence Clearwater Revival/Greatest Hits/cover.1.jpg

So I copy a random cover.jpg and cover.1.jpg to that folder. Run update. cover.1.jpg gets renamed to cover.2.jpg, and the error comes back.

Not sure what it wants from me. Again, this was a clean import.

Vissie

sampsyo commented 6 years ago

Strange! I'm not sure what to suggest. The .1 should not get appended when there isn't a conflicting file already on the filesystem.

Since this doesn't happen when I do an import, is there some way you can help me reproduce the problem? For example, is there any distinguishing situation about this particular album that might be causing the problem?

vissieGP commented 6 years ago

I'll try and reproduce this somehow. I did lots of testing and finally imported both my, and my wife's FIRST music folders. There is still plenty to go. I will do more imports and see if I can catch there is happens. If I have to guess at this early stage, I would guess that it has something to do with spaces in the file names. "Best of". But that is nothing more than just a guess.

I'll see if I can come up with any concrete examples.

Vissie

nicolahinssen commented 6 years ago

This problem really makes beets unusable for me. I've even tried to completely start over, but the issue returns after a few days.

Sending event: before_item_moved
Sending event: item_moved
moving album art /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.2.jpg
Sending event: database_change
Gareth Emery & Ian Standerwick feat. HALIENE - Saving Light (The Remixes) - Saving Light (INTERCOM remix)
Sending event: before_item_moved
Sending event: item_moved
moving album art /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg
Traceback (most recent call last):
  File "/home/nicola/beets/beets/util/__init__.py", line 477, in move
    os.rename(path, dest)
FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg' -> b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nicola/beets/beets/util/__init__.py", line 481, in move
    shutil.copyfile(path, dest)
  File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg'

Error: No such file or directory while moving /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg
beet -v update -a -m  5.09s user 4.44s system 88% cpu 10.718 total

It's strange that beets tries to replace the cover file twice. Here is my config:

library: library.db
directory: /srv/media/Music

plugins:
- beatport
- embyupdate
- chroma
- discogs
- fetchart
- embedart
- zero
- permissions
- info
- edit
- inline
- fromfilename
- scrub
- replaygain

import:
    write: yes
    copy: no
    move: yes
    resume: yes
    incremental: no
    quiet_fallback: asis
    none_rec_action: asis
    timid: no
    detail: yes
    log: beets.log
    autotag: yes
    default_action: apply
    group_albums: no
    duplicate_action: remove
va_name: Various Artists
asciify_paths: yes
chroma:
    auto: yes
acoustid:
    apikey: REDACTED

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: _
replaygain:
    auto: yes
    backend: gstreamer
    overwrite: no
    targetlevel: 89
    r128: [Opus]
permissions:
    file: 664
    dir: 775
emby:
    host: 192.168.178.13
    port: 8096
    username: Nicola
    apikey: REDACTED
    password:
zero:
    fields: disc disctotal track tracktotal original_year comments day month bpm
    disc: ^0$
    disctotal: ^0$
    track: ^0$
    tracktotal: ^0$
    original_year: ^0$
    day: ^00$
    month: ^00$
    bpm: ^0$
    update_database: yes
    auto: yes
    keep_fields: []

musicbrainz:
    searchlimit: 5

paths:
    comp: Various Artists/$album%aunique{}/%if{$multidisc,Disc $disc_nonpadded/}$track - $title
    default: $albumartist/$album%aunique{}/%if{$multidisc,Disc $disc_nonpadded/}$track - $title
    singleton: Non-Album/$artist/$title
item_fields:
    multidisc: 1 if disctotal > 1 else 0
    disc_nonpadded: disc
fetchart:
    cover_names: cover front art album folder
    minwidth: 300
    enforce_ratio: 15px
    sources: filesystem fanarttv coverart itunes amazon albumart wikipedia google
    google_key: REDACTED
    fanarttv_key: REDACTED
    auto: yes
    maxwidth: 0
    cautious: no
    google_engine: REDACTED
    store_source: no
embedart:
    maxwidth: 600
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no

match:
    strong_rec_thresh: 0.15
    medium_rec_thresh: 0.25
    required: artist

ui:
    color: yes
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
pathfields: {}
album_fields: {}
beatport:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: beatport_token.json
    source_weight: 0.5
edit:
    albumfields: album albumartist
    itemfields: track title artist album
    ignore_fields: id path
scrub:
    auto: yes
sampsyo commented 6 years ago

Is there something we can do to reproduce the problem reliably, @nicolahinssen?

nicolahinssen commented 6 years ago

I don't know. When I manually resolve the problem (by making sure cover.jpg, cover.1.jpg and cover.2.jpg exist, may not work all the time), the problem arises at another album. Here is some info about the album that's giving me the problem right now.

Album database entry

{
    "added": "1516474141.33547",
    "album": "Saving Light (The Remixes)",
    "albumartist": "Gareth Emery & Ian Standerwick feat. HALIENE",
    "albumartist_credit": "Gareth Emery & Standerwick feat. HALIENE",
    "albumartist_sort": "Emery, Gareth & Standerwick, Ian feat. HALIENE",
    "albumdisambig": "",
    "albumstatus": "Official",
    "albumtype": "ep",
    "artpath": "/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg",
    "asin": "",
    "catalognum": "MCEP120",
    "comp": "0",
    "country": "XW",
    "day": "18",
    "disctotal": "1",
    "genre": "Trance",
    "id": "1212",
    "label": "Monstercat",
    "language": "eng",
    "mb_albumartistid": "73549455-66cb-4570-b0bf-caf3d8d631fe",
    "mb_albumid": "d98741a0-ee3b-404a-beb1-cd125ab94947",
    "mb_releasegroupid": "81738b6d-2b41-49fb-86f8-566e50166543",
    "month": "8",
    "original_day": "18",
    "original_month": "8",
    "original_year": "2017",
    "r128_album_gain": "0",
    "rg_album_gain": "-10.24",
    "rg_album_peak": "1.0",
    "script": "Latn",
    "year": "2017"
}

First track of the album database entry

{
    "acoustid_fingerprint": "AQADtAyVJMokRUEOzzP849iP_oKm5Au-HNSII-13PCqeK-iDUTmPZz92UUIKXZqOnExJ_PiJGx8OXkH-4NrB9IQfQhxrnMHxDD-ew8dD-MRn3AvyMYafHTyu8PCOPFIO8YG5ID_O0EiHDyYh6QysZsiJhwf14qBupGqOw88O_Qcf-Dx4WIY5HuJD48Wzg3rwMIdvHNTIwM9xjRB__IKf4i9EPngeWMePTKfxwO-RPvA76Av6oCQ8huBx_Dn8QGfwwGfgMXjhMbTwDD7xPZDY6HiIB-Jz0FsCPjr8IM8I68GdHWeMfIPP48NxKSc8VuB7OMaPH3pC8MNxGt5xGV9kqId_VNsS0ETh4zUOH36OH36HR7ng414gcjyeB8bD4qPxHXrg5whfMDNxIX-OZ4d4PIQ_mDt-iCdIcfCJ9_BDPC9E4SHh_Xh2eA_8QR_O7AJOeB1OfOHgF2-GH2ck_MdL8Dh3HH5oHBcH_wPlEE-WFanK4zV8HH6R5_BX6IOPc8fxQTYewk5owVwNP9AFP_gSvDnEMxMc5ziOHz8P_8OFHz4eWYLIw89xMhbEBycDP0M7ov9wWC8-Dw_xBX5xHz7OHI5rPEE6dvAznHgP6uwE56AsBS9zXCfY4pyK60OPkJIu6DnyLh0On_D4gd-DH2FKfGGgRzmaHJVOXMGhK0HOLCj1HY5y4-gv_Mc6EXkXQ53yIv_R70VzFT8uXsGPHPdyNB96XEd4w93xm_BxuEc_ccRj4bJi4PnwpegZuGrwH2FXjD-k5Q_-IDp6NGeH03g-tN2Rlin64vhxB3KPH02VKCTCF1ePP8VJ_Bn6w_PRE7_RH9um4wf1HvuF_NAZ5B88UbFQnfh4XBFx9Dz8IzyeocfRHzjCK7iRkkvRH8eTSwu-F-WTRUP6o46MmDpu_DcUejkyMxa-40kuNBfCQw9iSqtw6cIlo6mKXLE1JN_xP-gnfDu-5Wh2WuhxJI-WxwjFM_B8HH4GpkmKvE-hnUGkPHnwczieI18PLXXQ-UP-4Ee_w5Gi4DHCsyjR7EmBv8Gbo-mioz8ubjh-lEefYF-W47XxhPihHU1yCbxz_MQTjgj3ogl1gs8UgT_6IcyHv4KW63hWgnJ09KGL-5Byo3lOPHpwhETzIv4eo6kuaNyDH_2PF4e7XISUJxZCqRmmfBdenGh2HLtxhCJ6SJqIfgU_NEfP4MeVbBRKOSea41KOPiqmHKNuOHnx5VLw6Lh-aIefBT3yfIjJx-gN_4TWfXj2CGdc4SLR52h-qE6OPMazzQnOrcOPolkf_DFyqhAYP_iSazB59N_xPEIukcHTgNeO8DmaRF-En4d-7DjRynDXQ0yM6rhy9H1wPpieQY2PH_klNJNyoX-xj8VPOFtyxHkelPeg5SF-XNkHzXnhN8hJPM-xH09z1EpMfC7yPoGas8iv4ePQ1wjz4_uh_3gYDrHz4ckv9AUTDnmOnoKWHM9RRURzUaiVoynlQzdqhSHCXMIHIudwBeOi5cYVQzu-w99xHKNupI0RmjqeB8d_tGimD9eyYY94NKGUB5cJLbtxHWFi5iiLH3eKPcS_Z2g07mAoRWh4lFOs4KPSozrCXId-5LmMKxHO7GirIN0h5TmD-MlxfPrw4USY6Bo0H9eDmHvw40c3G44R8od0CUcoLxnx5Oj0RrhREX6L8IIu5EGf8MI33Mf1oBKP6xua9EdoPDfURTVsXbjE4zz4TaioKNDi6FCYo9lphA8940dPNGNt_MDTIT9-QbtwTPqMV-tQHxcLrSpKPcYviMd0HSd0H2_04Uwe4Ti6_MR3_PB5qFSZoxem4xP64zmRr6heWD2Rk5HwQ-NxhR3CFz_u4CIPU-B_nDCDUEVySTl45WgupUPvBLEkKAyTI0wdGr09XF9i_HjcoT-S5R_yH-eEy_jxrZOCX0d4wpwElT92YeuRw-te9MLXF29G_EJaDY8faMniiOg3Ct_xo8mPs8vxH2ceVJJk6MXD49NGIWpkozqaHwEvQ6MuPPRwvUJ8dA-edfhR6kip5ODNwYfeS9ieIT_6IzYpYa4CTTnc5cgOU-GL64geHGJ4Il9Q80NneDwx1cdvPMjiPdASl8GPsxL65HitwseXBap57MYehNNxPZzwR0atoHGPh8OlF32O5jiXFkdfHumYHc-EHxt6HM_RDi-O4wTu4zgh_rjgcESOnzh8CvOk4ziOgOxx7fiRVTp8AeGP8sH3w9RRHr2LH-_RHy80dkTq5bjkYYr24frxD80QeoOeMUUePMeOHze4LQtypoX-SUIf-PjxHscJc4QYTcdD-MYPH1aWDO0OPQOTPUce5GGMF2cID192iFuKw_Aj4Tn8DFqVHAxJ-MGPx3g18IR30NLhXIXHMMgP6qgqeThR3uiFPkaY89CTWQjx7XiKb7rw4skAMoR1BBAJBAXEQYABAYoIYQRTzCgEgSLAAUAsM4AZyoATBACGBAEGSUIcUEwAp5QFQgBABGAEMAaQUMoBJIRxBDkAmDFMCQYEAEIwZ4AAiAHGgEGESaCIQIoAwowAhhEgiAHCGGCdIA4AJBjHwDgEGEBCMMOMIxIA4YABDCAGmDMCMAKYYEQwIIQgwDEDBCVECEGcIRSAIYgCTDGgjFLAAOsUcIAJA4gRzQBAgJHOKCaAIoAAYpxx1AChFFEKMGKEEYAJQwARhgEEDRECEkGoAKUAIIBIBAgkjBDEAEMNEA4B4IhFiANirAIGAIYocwIYAoFS5gOnDBAUSKqYQEIoRABAxljjLHHICgYBU4AYRYhwhCFhjTJLGICEBAYhIIBURCAgkDGCMCQUBgoAhRhyQAhGChBCA0MEEEAhpYQgTjAmiCECEQUAAUAAoTEADCElCGCKMGEYg1QggBAzAhgAiDEeAGGQMUIYogQSQDDiJAUIIYGcAYIhRAg1AEFEiALCGIOIEEwAJAQwjggAijBAOqGIEIAJhQAQQAChiCOMYQQAQMAIoAkyAApiEBAKEYGAQgoQ5wQSjAiiDALCGAKAAIoAwZgSiisFjTCAKyigEEIAcKiAABQjiEKIUCKcYggZAASwghhBACWKEAAFIIAKRAxgzBgmFCaEUIaABYAQABBgQiFkGBCCEEMJEoQAh4RjTAsEBCvCAeUAWcYSAQQCVgthkFMAAEUMY5AwhAjwEmliAEIAAVCIEUBZhYRDSgEgDFAMEgOEAAIoogmwCCggBFCEMAWkQAAIRwgThgJDlCIASAcsIAAhAoQ0SAsKkDXWCCEAAkogxwBC3ACNABDMCEKQoAg5AIQGiDnFHDdPGKsQoCQxMwS5QAFnmBJGEGQAgwwAYTRghCEgAJMAKQsdIgAYJSgRiBLFAAAMISEUYsIQBwQBBjlFBbHKOCOYwgoIAwQFhDI",
    "acoustid_id": "269731f8-6fb7-4d4f-a06e-67defb3f5d44",
    "added": "1516474141.34693",
    "album": "Saving Light (The Remixes)",
    "album_id": "1212",
    "albumartist": "Gareth Emery & Ian Standerwick feat. HALIENE",
    "albumartist_credit": "Gareth Emery & Standerwick feat. HALIENE",
    "albumartist_sort": "Emery, Gareth & Standerwick, Ian feat. HALIENE",
    "albumdisambig": "",
    "albumstatus": "Official",
    "albumtype": "ep",
    "arranger": "",
    "artist": "Gareth Emery & Ian Standerwick feat. HALIENE",
    "artist_credit": "Gareth Emery & Standerwick feat. HALIENE",
    "artist_sort": "Emery, Gareth & Standerwick, Ian feat. HALIENE",
    "asin": "",
    "bitdepth": "0",
    "bitrate": "320000",
    "bpm": "130",
    "catalognum": "MCEP120",
    "channels": "2",
    "comments": "",
    "comp": "0",
    "composer": "",
    "composer_sort": "",
    "country": "XW",
    "day": "18",
    "disc": "1",
    "disctitle": "",
    "disctotal": "1",
    "encoder": "",
    "format": "MP3",
    "genre": "Trance",
    "grouping": "",
    "id": "10432",
    "initial_key": "",
    "label": "Monstercat",
    "language": "eng",
    "length": "179.121632653061",
    "lyricist": "",
    "lyrics": "",
    "mb_albumartistid": "73549455-66cb-4570-b0bf-caf3d8d631fe",
    "mb_albumid": "d98741a0-ee3b-404a-beb1-cd125ab94947",
    "mb_artistid": "73549455-66cb-4570-b0bf-caf3d8d631fe",
    "mb_releasegroupid": "81738b6d-2b41-49fb-86f8-566e50166543",
    "mb_trackid": "5155cf59-5dee-433b-bac7-97a06d8a253d",
    "media": "Digital Media",
    "month": "8",
    "mtime": "1516474158.0",
    "original_day": "18",
    "original_month": "8",
    "original_year": "2017",
    "path": "/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/01 - Saving Light (NWYR remix).mp3",
    "r128_album_gain": "0",
    "r128_track_gain": "0",
    "rg_album_gain": "-10.24",
    "rg_album_peak": "1.0",
    "rg_track_gain": "-10.48",
    "rg_track_peak": "1.0",
    "samplerate": "44100",
    "script": "Latn",
    "title": "Saving Light (NWYR remix)",
    "track": "1",
    "tracktotal": "6",
    "year": "2017"
}

Mediainfo of first track on the album

General
Complete name                     : Z:\Music\Gareth Emery & Ian Standerwick feat. HALIENE\Saving Light (The Remixes)\01 - Saving Light (NWYR remix).mp3
Format                            : MPEG Audio
File size                         : 6.93 MiB
Duration                          : 2 min 59 s
Overall bit rate mode             : Constant
Overall bit rate                  : 320 kb/s
Album                             : Saving Light (The Remixes)
Album/Performer                   : Gareth Emery & Ian Standerwick feat. HALIENE
Part/Position                     : 1
Part/Total                        : 1
Track name                        : Saving Light (NWYR remix)
Track name/Position               : 1
Track name/Total                  : 6
Performer                         : Gareth Emery & Ian Standerwick feat. HALIENE
Performer/Sorted by               : Emery, Gareth & Standerwick, Ian feat. HALIENE
Thanks to                         : arranger
Publisher                         : Monstercat
Genre                             : Trance
Original/Released date            : UTC 2017-08- 8
Recorded date                     : UTC 2017-08- 8
Writing library                   : LAME3.99.5
BPM                               : 130
Cover                             : Yes
Cover type                        : Cover (front)
Cover MIME                        : image/jpeg
Script                            : a
Media Type                        : Digital Media
R128_ALBUM_GAIN                   : 0
R128_TRACK_GAIN                   : 0
CATALOGNUMBER                     : MCEP120
MusicBrainz Album Type            : ep
REPLAYGAIN_ALBUM_PEAK             : 1.000000
REPLAYGAIN_TRACK_PEAK             : 1.000000
REPLAYGAIN_ALBUM_GAIN             : -10.24 dB
REPLAYGAIN_TRACK_GAIN             : -10.48 dB
MusicBrainz Album Status          : Official
MusicBrainz Album Release Country : XW
Acoustid Id                       : 269731f8-6fb7-4d4f-a06e-67defb3f5d44
Artist Credit                     : Gareth Emery & Standerwick feat. HALIENE
MusicBrainz Album Id              : d98741a0-ee3b-404a-beb1-cd125ab94947
MusicBrainz Artist Id             : 73549455-66cb-4570-b0bf-caf3d8d631fe
Album Artist Credit               : Gareth Emery & Standerwick feat. HALIENE
ALBUMARTISTSORT                   : Emery, Gareth & Standerwick, Ian feat. HALIENE
MusicBrainz Album Artist Id       : 73549455-66cb-4570-b0bf-caf3d8d631fe
MusicBrainz Release Group Id      : 81738b6d-2b41-49fb-86f8-566e50166543
Acoustid Fingerprint              : ---cut---

Audio
Format                            : MPEG Audio
Format version                    : Version 1
Format profile                    : Layer 3
Format settings                   : Joint stereo
Duration                          : 2 min 59 s
Bit rate mode                     : Constant
Bit rate                          : 320 kb/s
Channel(s)                        : 2 channels
Sampling rate                     : 44.1 kHz
Frame rate                        : 38.281 FPS (1152 SPF)
Compression mode                  : Lossy
Stream size                       : 6.83 MiB (99%)
Writing library                   : LAME3.99.5
Language                          : English

Raw id3v2.4 tags of first track on album

mid3v2 --list-raw /srv/media/Music/Gareth\ Emery\ \&\ Ian\ Standerwick\ feat.\ HALIENE/Saving\ Light\ \(The\ Remixes\)/01\ -\ Saving\ Light\ \(NWYR\ remix\).mp3                                      Raw IDv2 tag info for /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/01 - Saving Light (NWYR remix).mp3                                                                                   TIT2(encoding=<Encoding.UTF8: 3>, text=['Saving Light (NWYR remix)'])                                                                                                                                                               TPE1(encoding=<Encoding.UTF8: 3>, text=['Gareth Emery & Ian Standerwick feat. HALIENE'])                                                                                                                                            TRCK(encoding=<Encoding.UTF8: 3>, text=['1/6'])                                                                                                                                                                                     TALB(encoding=<Encoding.UTF8: 3>, text=['Saving Light (The Remixes)'])                                                                                                                                                              TPOS(encoding=<Encoding.UTF8: 3>, text=['1/1'])                                                                                                                                                                                     TDRC(encoding=<Encoding.UTF8: 3>, text=['2017-08-18'])                                                                                                                                                                              TCON(encoding=<Encoding.UTF8: 3>, text=['Trance'])                                                                                                                                                                                  TCMP(encoding=<Encoding.UTF8: 3>, text=['0'])                                                                                                                                                                                       TBPM(encoding=<Encoding.UTF8: 3>, text=['130'])                                                                                                                                                                                     TLAN(encoding=<Encoding.UTF8: 3>, text=['eng'])                                                                                                                                                                                     USLT(encoding=<Encoding.UTF8: 3>, lang='XXX', desc='', text='')                                                                                                                                                                     TIPL(encoding=<Encoding.UTF8: 3>, people=[['arranger', '']])                                                                                                                                                                        TDOR(encoding=<Encoding.UTF8: 3>, text=['2017-08-18'])                                                                                                                                                                              TPUB(encoding=<Encoding.UTF8: 3>, text=['Monstercat'])                                                                                                                                                                              TXXX(encoding=<Encoding.UTF8: 3>, desc='Script', text=['Latn'])                                                                                                                                                                     TMED(encoding=<Encoding.UTF8: 3>, text=['Digital Media'])                                                                                                                                                                           TXXX(encoding=<Encoding.UTF8: 3>, desc='R128_ALBUM_GAIN', text=['0'])                                                                                                                                                               TXXX(encoding=<Encoding.UTF8: 3>, desc='R128_TRACK_GAIN', text=['0'])                                                                                                                                                               TXXX(encoding=<Encoding.UTF8: 3>, desc='CATALOGNUMBER', text=['MCEP120'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Album Type', text=['ep'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='REPLAYGAIN_ALBUM_PEAK', text=['1.000000'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='REPLAYGAIN_TRACK_PEAK', text=['1.000000'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='REPLAYGAIN_ALBUM_GAIN', text=['-10.24 dB'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='REPLAYGAIN_TRACK_GAIN', text=['-10.48 dB'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Album Status', text=['Official'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Album Release Country', text=['XW'])
TPE2(encoding=<Encoding.UTF8: 3>, text=['Gareth Emery & Ian Standerwick feat. HALIENE'])
TSOP(encoding=<Encoding.UTF8: 3>, text=['Emery, Gareth & Standerwick, Ian feat. HALIENE'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='Acoustid Id', text=['269731f8-6fb7-4d4f-a06e-67defb3f5d44'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='Artist Credit', text=['Gareth Emery & Standerwick feat. HALIENE'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Album Id', text=['d98741a0-ee3b-404a-beb1-cd125ab94947'])
UFID(owner='http://musicbrainz.org', data=b'5155cf59-5dee-433b-bac7-97a06d8a253d')
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Artist Id', text=['73549455-66cb-4570-b0bf-caf3d8d631fe'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='Album Artist Credit', text=['Gareth Emery & Standerwick feat. HALIENE'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='ALBUMARTISTSORT', text=['Emery, Gareth & Standerwick, Ian feat. HALIENE'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Album Artist Id', text=['73549455-66cb-4570-b0bf-caf3d8d631fe'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='MusicBrainz Release Group Id', text=['81738b6d-2b41-49fb-86f8-566e50166543'])
COMM(encoding=<Encoding.UTF8: 3>, lang='eng', desc='iTunNORM', text=[' 00002BA1 00002BA1 00006D12 00006D12 00000000 00000000 00008000 00008000 00000000 00000000'])
TXXX(encoding=<Encoding.UTF8: 3>, desc='Acoustid Fingerprint', text=[' ---cut--- ']

Beets config.yaml

library: library.db
directory: /srv/media/Music

plugins:
- beatport
- embyupdate
- chroma
- discogs
- fetchart
- embedart
- zero
- permissions
- info
- edit
- inline
- fromfilename
- scrub
- replaygain

import:
    write: yes
    copy: no
    move: yes
    resume: yes
    incremental: no
    quiet_fallback: asis
    none_rec_action: asis
    timid: no
    detail: yes
    log: beets.log
    autotag: yes
    default_action: apply
    group_albums: no
    duplicate_action: remove
va_name: Various Artists
asciify_paths: yes
chroma:
    auto: yes
acoustid:
    apikey: REDACTED

replace:
    '[\\/]': _
    ^\.: _
    '[\x00-\x1f]': _
    '[<>:"\?\*\|]': _
    \.$: _
    \s+$: ''
    ^\s+: ''
    ^-: _
replaygain:
    auto: yes
    backend: gstreamer
    overwrite: no
    targetlevel: 89
    r128: [Opus]
permissions:
    file: 664
    dir: 775
emby:
    host: 192.168.178.13
    port: 8096
    username: Nicola
    apikey: REDACTED
    password:
zero:
    fields: disc disctotal track tracktotal original_year comments day month bpm
    disc: ^0$
    disctotal: ^0$
    track: ^0$
    tracktotal: ^0$
    original_year: ^0$
    day: ^00$
    month: ^00$
    bpm: ^0$
    update_database: yes
    auto: yes
    keep_fields: []

musicbrainz:
    searchlimit: 5

paths:
    comp: Various Artists/$album%aunique{}/%if{$multidisc,Disc $disc_nonpadded/}$track - $title
    default: $albumartist/$album%aunique{}/%if{$multidisc,Disc $disc_nonpadded/}$track - $title
    singleton: Non-Album/$artist/$title
item_fields:
    multidisc: 1 if disctotal > 1 else 0
    disc_nonpadded: disc
fetchart:
    cover_names: cover front art album folder
    minwidth: 300
    enforce_ratio: 15px
    sources: filesystem fanarttv coverart itunes amazon albumart wikipedia google
    google_key: REDACTED
    fanarttv_key: REDACTED
    auto: yes
    maxwidth: 0
    cautious: no
    google_engine: REDACTED
    store_source: no
embedart:
    maxwidth: 600
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no

match:
    strong_rec_thresh: 0.15
    medium_rec_thresh: 0.25
    required: artist

ui:
    color: yes
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
pathfields: {}
album_fields: {}
beatport:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: beatport_token.json
    source_weight: 0.5
edit:
    albumfields: album albumartist
    itemfields: track title artist album
    ignore_fields: id path
scrub:
    auto: yes

Folder structure before running 'beet update'

ls -al /srv/media/Music/Gareth\ Emery\ \&\ Ian\ Standerwick\ feat.\ HALIENE/Saving\ Light\ \(The\ Remixes\)
total 66544
drwxrwxr-x 2 nicola nicola     4096 Jan 26 14:16  .
drwxrwxr-x 3 nicola nicola     4096 Jan 11 20:55  ..
-rw-rw-r-- 1 nicola nicola  7263781 Jan 20 19:49 '01 - Saving Light (NWYR remix).mp3'
-rw-rw-r-- 1 nicola nicola 13982534 Jan 20 19:49 '02 - Saving Light (Notaker remix).mp3'
-rw-rw-r-- 1 nicola nicola 12069874 Jan 20 19:49 '03 - Saving Light (INTERCOM remix).mp3'
-rw-rw-r-- 1 nicola nicola 11115850 Jan 20 19:49 '04 - Saving Light (Hixxy remix).mp3'
-rw-rw-r-- 1 nicola nicola 15915649 Jan 20 19:49 '05 - Saving Light (Ruben de Ronde remix).mp3'
-rw-rw-r-- 1 nicola nicola  7596619 Jan 20 19:49 '06 - Saving Light (Decoy! remix).mp3'
-rw-rw-r-- 1 nicola nicola    89092 Jan 20 19:49  cover.1.jpg
-rw-rw-r-- 1 nicola nicola    89092 Jan 20 19:49  cover.jpg

Exception after using 'beet -vvv update -a -m'

skipping /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/01 - Saving Light (NWYR remix).mp3 because mtime is up to date (1516474158.0)
skipping /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/02 - Saving Light (Notaker remix).mp3 because mtime is up to date (1516474159.0)
skipping /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/03 - Saving Light (INTERCOM remix).mp3 because mtime is up to date (1516474159.0)
Gareth Emery & Ian Standerwick feat. HALIENE - Saving Light (The Remixes) - Saving Light (Hixxy remix)
  acoustid_fingerprint: ---cut---
Sending event: before_item_moved
Sending event: item_moved
moving album art /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.2.jpg
Sending event: database_change
Gareth Emery & Ian Standerwick feat. HALIENE - Saving Light (The Remixes) - Saving Light (Ruben de Ronde remix)
  acoustid_fingerprint: ---cut---
Sending event: before_item_moved
Sending event: item_moved
moving album art /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg
Traceback (most recent call last):
  File "/home/nicola/beets/beets/util/__init__.py", line 477, in move
    os.rename(path, dest)
FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg' -> b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/nicola/beets/beets/util/__init__.py", line 481, in move
    shutil.copyfile(path, dest)
  File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg'

Error: No such file or directory while moving /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg to /srv/media/Music/Gareth Emery & Ian Standerwick feat. HALIENE/Saving Light (The Remixes)/cover.1.jpg
beet -vvv update -a -m  5.53s user 5.34s system 69% cpu 15.722 total

Folder structure after running 'beet update'

ls -al /srv/media/Music/Gareth\ Emery\ \&\ Ian\ Standerwick\ feat.\ HALIENE/Saving\ Light\ \(The\ Remixes\)                                                          :(
total 66544
drwxrwxr-x 2 nicola nicola     4096 Jan 26 14:21  .
drwxrwxr-x 3 nicola nicola     4096 Jan 11 20:55  ..
-rw-rw-r-- 1 nicola nicola  7263781 Jan 20 19:49 '01 - Saving Light (NWYR remix).mp3'
-rw-rw-r-- 1 nicola nicola 13982534 Jan 20 19:49 '02 - Saving Light (Notaker remix).mp3'
-rw-rw-r-- 1 nicola nicola 12069874 Jan 20 19:49 '03 - Saving Light (INTERCOM remix).mp3'
-rw-rw-r-- 1 nicola nicola 11115850 Jan 20 19:49 '04 - Saving Light (Hixxy remix).mp3'
-rw-rw-r-- 1 nicola nicola 15915649 Jan 20 19:49 '05 - Saving Light (Ruben de Ronde remix).mp3'
-rw-rw-r-- 1 nicola nicola  7596619 Jan 20 19:49 '06 - Saving Light (Decoy! remix).mp3'
-rw-rw-r-- 1 nicola nicola    89092 Jan 20 19:49  cover.2.jpg
-rw-rw-r-- 1 nicola nicola    89092 Jan 20 19:49  cover.jpg

Tell me if you need something else!

sampsyo commented 6 years ago

OK, thanks! I don’t know how to investigate further without being able to reproduce the conditions that led to the dangling file references. If you find a way to “force” the problem to reoccur, please let us know.

nicolahinssen commented 6 years ago

Allright. I will clear the beets database completely and perform a fresh import. I'll log the full verbose output to a logfile so it's possible to grep the relevant parts when the error occurs. Also I'll make sure that there are only cover.jpg files in my library when starting the import, so no cover.1.jpg etc.

sampsyo commented 6 years ago

OK, thanks! I hope that will help—but I should also clarify that sometimes even seeing a verbose log from your machine on your music doesn’t reveal how to make the same problem occur on my machine (with different platform-specific quirks and different input music). It’s worth a try, probably!

nicolahinssen commented 6 years ago

I've done some extensive testing and logging, but the most verbose logging option is, like you said, actually not verbose enough. The beet update -a -m command failed again, with a different album.

      Counterstrike, Dub Elements & Thrasher - 15 Years Of PRSPCT (2002 - 2017) - Renegades
        acoustid_fingerprint: --- cut ---
      Sending event: before_item_moved
      Sending event: item_moved
--->  moving album art /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg to /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.2.jpg
      Sending event: database_change
      Deathmachine, Detest & I:gor - 15 Years Of PRSPCT (2002 - 2017) - 3 The Hard Way
        acoustid_fingerprint: --- cut ---
      Sending event: before_item_moved
      Sending event: item_moved
--->  moving album art /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg to /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg
      Traceback (most recent call last):
        File "/home/nicola/beets/beets/util/__init__.py", line 477, in move
          os.rename(path, dest)
      FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg' -> b'/srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/nicola/beets/beets/util/__init__.py", line 481, in move
          shutil.copyfile(path, dest)
        File "/usr/lib/python3.6/shutil.py", line 120, in copyfile
          with open(src, 'rb') as fsrc:
      FileNotFoundError: [Errno 2] No such file or directory: b'/srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg'

      Error: No such file or directory while moving /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg to /srv/media/Music/Various Artists/15 Years Of PRSPCT (2002 - 2017)/cover.1.jpg

First the cover.1.jpg is moved to cover.2.jpg, then it tries to move cover.1.jpg to cover.1.jpg, which obviously is impossible. Cover.2.jpg is also corrupted. All the cover.1.jpg images in my library are completely fine, so the move to the 2.jpg file failed.

It looks like two plugins are occasionally conflicting, but that's just guessing. I'll research it further.

sampsyo commented 6 years ago

Oh wow, that's strange! It looks like the command is trying to move album art on top of itself, and then conflicting with the file that already exists there? Sorry this is so frustrating, but it's also quite mysterious…

I'm not 100% sure about the plugin conflict theory, but it's possible. Is there any chance that paring down your plugin list makes a difference?

nicolahinssen commented 6 years ago

I've done that, no difference. But then I specified fields to the update command (-F albumartist, -F year, etc.) and the update completed successfully.

I've written an automation script that runs after a music file has been downloaded, that's always running. The end of that script is:

beet -v import -q "$temppath/$name"

Now in my beets.log file I noticed the following remarkable. The album where the crash occurs is listed as:

duplicate-replace /srv/rtorrent/config/rtorrent/tmp/VA-15_Years_Of_PRSPCT-2002-2017-(PRSPCTLP009CD)-CD-FLAC-2017-SPL

So I looked in my automation script logfile, and this is what I find:

30/01/18 11:45:07 |  Music  | COMPLETED Processing VA-15_Years_Of_PRSPCT-2002-2017-(PRSPCTLP009CD)-CD-2017-SPL
30/01/18 11:51:24 |  Music  | COMPLETED Processing VA-15_Years_Of_PRSPCT-2002-2017-(PRSPCTLP009CD)-CD-FLAC-2017-SPL

This means that the original MP3 album has been replaced with the FLAC version.

Let's take a look at the album that was previously giving me problems (Gareth Emery & Ian Standerwick feat. HALIENE - Saving Light (The Remixes)). This album is also listed as duplicate-replace. Unfortunately my script log file doesn't go back that far, but I guess that a specific replaced file in a album (possibly cover.jpg) causes these problems.

sampsyo commented 6 years ago

I see! So it's a reasonable inference that the old music files got removed, but somehow the image file stuck around long enough to confuse the database. Does that seem reasonable?

nicolahinssen commented 6 years ago

Seems reasonable for sure! This needs some testing with a debugger. The issue can be reopened I suppose :)

sampsyo commented 6 years ago

Actually, I think the original report is too broad to be useful—it's more of a symptom than a disease. So would you mind opening a new ticket with as many specific details as you can? For example, you could test the hypothesis above—re-import just those two albums again—and see if you can trigger the problem reliably. If we have a setup that can cause the problem every time, we have a shot at actually understanding what's wrong.