Closed chiamarc closed 4 years ago
Hi! This is very worrisome, and I think it's an instance of #702—an extremely nasty and hard-to-solve bug. Can you take a look and check whether it looks like the same issue?
Yes, this was obviously happening on an album that had already been imported (and had probably produced duplicates somehow due to various choices I made earlier). The read error is weird though because the files were there and not changed while beets was importing, unless maybe the multithreading had something to do with it. Is Beets designed to permanently delete files? If so, this bug may be mitigated somewhat by being able to recover from this situation; a kind of undo last operation would be helpful, where you write the changes temporarily somewhere and swap out on a "commit". Either that or sending to Recycle Bin, which I imagine would be much easier.
It seems from the description of #702 that you know the situations in which this occurs and so it is reproducible. The question is how do you solve it? I can try to run it on a couple scenarios and report back but I don't have a lot of bandwidth right now.
OK, so this is quite vexing. Right now I'm importing into a brand new database. Here was the sequence of operations (in a single session, no previous imports):
D:\Audio\Music\Daft Punk\Around The World (CD Maxi-Single) (4 items)
Correcting tags from:
Daft Punk - Around The World (CD Maxi-Single)
To:
Daft Punk - Around the World
URL:
https://musicbrainz.org/release/b8243e29-2672-4b60-8ae0-7f3e793a8a41
(Similarity: 94.0%) (album) (CD, 1997, GB)
* Around The World (Radio Edit) ->
Around the World (radio edit)
* Around The World (LP Version) ->
Around the World (LP version)
* Teachers (Extended Mix) ->
Teachers (extended mix)
* Around The World (Motorbass Vice Mix) ->
Around the World (Motorbass Vice mix)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort? a
D:\Audio\Music\Daft Punk\Around The World (CD Maxi-Single, Promo) (5 items)
Correcting tags from:
Daft Punk - Around The World (CD Maxi-Single, Promo)
To:
Daft Punk - Around the World
URL:
https://musicbrainz.org/release/1c0eaaf9-0852-4232-8dc1-e53597a9b441
(Similarity: 95.2%) (tracks, album) (CD, 1996, US, Virgin Records America)
* Around The World (Radio Edit) ->
Around the World (radio edit)
* Around The World (Tee's Frozen Sun Mix) ->
Around the World (Tee's Frozen Sun mix)
* Around The World (Motorbass Vice Mix) ->
Around the World (Motorbass Vice mix)
* Around The World (Daft Punk Edit) ->
Around the World (Daft Punk edit)
* Around The World (Call Out Research Hook) ->
Call Out Research Hook (title)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort?
This album is already in the library!
Old: 4 items, MP3, 320kbps, 23:42, 54.6 MiB
New: 5 items, MP3, 320kbps, 22:05, 51.0 MiB
[S]kip new, Keep both, Remove old? r
Both paths are now gone! This bug has to be fixed somehow or I will need to stop using Beets.
I really like Beets so I'm willing to help debug in any way I can. I'm familiar with Python but by no means a developer. I cut my teeth on gdb way back in the day so I'm no stranger to debugging but I'll probably need some help.
Please let me know how I can assist.
Whoa; that sounds like a different and even more mysterious problem. It sounds like just importing two "copies" of the same album back-to-back and choosing R removed both copies. That won't do at all.
Is this reliably reproducible? Can you check whether the same thing happens when you use the default import settings (i.e., copy
is true and move
is false) vs. your current settings?
OK, I have to find a similar situation...it might take me a bit.
I can confirm that the default settings of copy:true and move:false produces a new directory containing the correct filenames and tags but doesn't remove the original directory or files. This is acceptable, if inconvenient.
That's also strange—so in that case, the "remove" option just behaves like a no-op? So both modes seem to do something wrong.
How about the other question: with move
mode enabled, is the data loss (both albums are deleted) reproducible?
Okay, I can confirm that songs were completely deleted doing a two-stage import (first a full non-interactive import, then an interactive one to fix metadata). Using version 1.4.5 installed via pip on a mac.
@andrewbenedictwallace Can you please provide instructions to reproduce the problem?
I'll work on reproducing when I get a chance but I think it happened when I tried to fix an issue by moving files around outside of beets.
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Problem
Ran a previous non-tagging import with
beet import -A D:\Audio\Music
completed successfully. Some time later I ran a new import with
beet import D:\Audio\Music
Many albums were matched 100% and of course there were many albums already in the library.
At some point, I chose to "Remove old" of an Ace of Base album with unmatched tracks (there were duplicates in that directory somehow):
A few seconds later I received the following errors (I had seen this kind before but just ignored them):
The result was that ALL but two of the tracks in that folder have been deleted (before my very eyes actually). I have no idea how that unicode string got there for those files. Nothing was changed from under beets (e.g., files deleted) after the import had already begun. I will say that the D: drive is a mounted Stablebit DrivePool (a poor person's file-level RAID solution) that might be returning unexpected path values to Python. But if that is the case, why does the error only occur on some albums?
This may have been a fluke but it would be nice to have beets "delete" by moving to Recycle Bin or an equivalent folder of choice on Linux.
Setup
My configuration (output of
beet config
) is: