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

"beet update" fails #2863

Closed
gramster opened this issue Apr 2, 2018 · 6 comments
Closed

"beet update" fails #2863

gramster opened this issue Apr 2, 2018 · 6 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@gramster
Copy link

gramster commented Apr 2, 2018

Problem

I'm trying to run "beet update" but it fails, apparently while trying to move a non-existent file onto itself.

Sending event: before_item_moved
Sending event: item_moved
moving album art /volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg to /volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg
Traceback (most recent call last):
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/beets/util/__init__.py", line 477, in move
    os.rename(path, dest)
FileNotFoundError: [Errno 2] No such file or directory: b'/volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg' -> b'/volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/site-packages/beets/util/__init__.py", line 481, in move
    shutil.copyfile(path, dest)
  File "/volume1/@appstore/py3k/usr/local/lib/python3.5/shutil.py", line 114, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: b'/volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg'

Error: No such file or directory while moving /volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg to /volume1/music/beet/Compilations/What Women Want_ Music From the Motion Picture/cover.1.jpg

Setup

  • OS: Synology Linux Diskstation 3.10.102 #15254 SMP Fri Jan 26 06:43:30 CST 2018 x86_64 GNU/Linux synology_avoton_1517+
  • Python version: 3.5.1
  • beets version: 1.4.6
  • Turning off plugins made problem go away (yes/no):

My configuration (output of beet config) is:

library: /volume1/music/library.db
fetchart:
    auto: yes
    cautious: yes
    cover_names: cover folder
    google_engine: 001442825323518660753:hrh5ch1gjzm
    enforce_ratio: no
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    store_source: no
    maxwidth: 0
    fanarttv_key: REDACTED
    google_key: REDACTED
    minwidth: 0
scrub:
    auto: yes
directory: /volume1/music/beet

import:
    move: yes
embedart:
    auto: yes
    maxwidth: 0
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
threaded: yes
lastgenre:
    fallback: ''
    source: artist
    min_weight: 10
    whitelist: yes
    prefer_specific: no
    canonical: no
    count: 1
    separator: ', '
    auto: yes
    force: yes
plugins:
- discogs
- fetchart
- embedart
- lastgenre
- scrub
- missing
- duplicates
- mbsync
scrub:
    auto: yes
duplicates:
    copy: ''
    keys: []
    checksum: ''
    merge: no
    move: ''
    count: no
    full: no
    album: no
    delete: no
    tag: ''
    strict: no
    format: ''
    tiebreak: {}
    path: no
missing:
    album: no
    total: no
    count: no
discogs:
    user_token: REDACTED
    apikey: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    apisecret: REDACTED
(paste here)
@sampsyo
Copy link
Member

sampsyo commented Apr 2, 2018

Interesting! It looks like there are two problems:

  1. A file that beets was tracking got deleted, and update doesn't currently know how to clean up art files when they're deleted. See beet update: Do not stop when files (including album art) cannot be moved #2419, add file check to move command #2036, and beet move IOError #2768 (comment), for example.
  2. The error looks strange because we're moving a file onto itself. The bit of code that's causing this problem is supposed to be guarded by a check that we're not moving a file into the same location it came from (see the nearby call to samefile). However, that check fails if the file doesn't exist. We should probably add an extra check for path equality (just p1 == p2) to avoid weird situations like this.

Does that sound right? If so, we can quickly fix the second thing, at least.

@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Apr 2, 2018
@gramster
Copy link
Author

gramster commented Apr 4, 2018

I think it would be obviously good to fix both things :-) A quick fix of thing 2 would be a good start.

If I turn off art files in the config will beets at least just ignore them? That may be a way to at least get past this and eventually I can use Picard or something to fix the art files.

@gramster
Copy link
Author

gramster commented Apr 4, 2018

BTW I had a similar error-out when doing a merge:

Error: No such file or directory while moving /volume1/music/beet/Paul A. Schwartz/Aria 2_ New Horizon/cover.1.jpg to /volume1/music/beet/Paul A. Schwartz/Aria 2_ New Horizon/cover.1.jpg

Very annoying when these things cause beets to exit, because resuming imports doesn't seem to work well and I have to redo a lot of work.

@sampsyo sampsyo closed this as completed in a829fa3 Apr 4, 2018
@sampsyo
Copy link
Member

sampsyo commented Apr 4, 2018

Cool; I pushed a quick fix for the equal-path problem.

If you're interested in the broader problem of file errors that abort operations, please take a look at a few related issues—this has been discussed in some detail (and we could definitely use some help sorting it out).

@nicolahinssen
Copy link

I still have this exact issue on the latest source build.

@retrography
Copy link

The same issue here. I have had it since I started using beets, and it is definitely still there in the last version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

4 participants