Moving Library Album Loses File

Good day,

I ran into an odd series of events.

[3]:11 Trance :: Aly & Fila feat. Jwaydan - We Control the Sunlight - We Control the Sunlight (original mix) :: [3]:11:-- ::: No comments.
  comments: [3]:11:-- ::: No comments. -> Progressive, Uplifting, Vocal, Driving
  rating: 3 -> 4
Really modify, move and write tags? (Yes/no/select) yes

error reading /mnt/c/Users/Michael/Documents/Downloads/complete/DANCE/01-aly_and_fila_feat_jwaydan_-_we_control_the_sunlight_(original_mix).mp3: [Errno 2] No such file or directory: b'/mnt/c/Users/Michael/Documents/Downloads/complete/DANCE/01-aly_and_fila_feat_jwaydan_-_we_control_the_sunlight_(original_mix).mp3'

So beets thinks the file is located on my “C:” drive but it was actually located in my beets library already on my “E:” drive. The “C:” drive path was where the file originated when I imported it though. Was there something I could have done at this point to force beets to update its database and see the file’s actual location?

I decided I would try to re-import the album which was located in my beets library on the “E:” drive to try to force beets to rewrite everything and fix itself. However that led to the following.

(.beets-venv) [michael:~]$ beet imp /mnt/e/beets/library/Aly\ \&\ Fila\ feat.\ Jwaydan/We\ Control\ the\ Sunlight/

/mnt/e/beets/library/Aly & Fila feat. Jwaydan/We Control the Sunlight (2 items)
Correcting tags from:
  Aly & Fila Feat Jwaydan - We Control The Sunlight
To:
  Aly & Fila feat. Jwaydan - We Control the Sunlight
URL:
  https://musicbrainz.org/release/5bfba7d1-de91-4830-8c15-8a3b84bb33e8
(Similarity: 100.0%) (Digital Media, 2011, XW, Future Sound of Egypt, FSOE035)
* We Control The Sunlight (Original Mix) -> We Control the Sunlight (original mix)
This album is already in the library!
could not get filesize: [Errno 2] No such file or directory: b'/mnt/c/Users/Michael/Documents/Downloads/complete/DANCE/01-aly_and_fila_feat_jwaydan_-_we_control_the_sunlight_(original_mix).mp3'
Old: 2 items, MP3, 319kbps, 17:21, 20.3 MiB
New: 2 items, MP3, 319kbps, 17:21, 39.8 MiB
[S]kip new, Keep both, Remove old, Merge all? R
Error: No such file or directory while moving /mnt/e/beets/library/Aly & Fila feat. Jwaydan/We Control the Sunlight/02 Aly & Fila feat. Jwaydan - We Control the Sunlight (Alex M.O.R.P.H. remix) [We Control the Sunlight].mp3 to /home/michael/music/library/Aly & Fila feat. Jwaydan/We Control the Sunlight/02 Aly & Fila feat. Jwaydan - We Control the Sunlight (Alex M.O.R.P.H. remix) [We Control the Sunlight].mp3

Beets was still looking for the file in the old “C:” drive when I explicitly tried to re-import. Then because the import matched to a different album or something which has a . in the title while my first import did not; that caused the directory to change and after the first song was moved into the new directory the old directory disappeared and then the error occurred. Beets lost the other audio file.

I do not know if the issue was removing the old album caused the old directory to be removed before all the songs were migrated to the new directory or if beets was still looking in the “C:” drive for one of the files and then when it errored there it continued with the process which involved removing the old directory and subsequently the file I was trying to fix in the first place. I have a backup so no worries; this is just more of an issue I want to avoid in the future.

There are a few options in the FAQ:

That’s pretty weird about the files on the E: drive being deleted! To be honest, I still don’t see a good reason for why that would have happened. Maybe some files were located there according to the beets database?

Yes, the file was in the beets database and was incorrect. So when re-importing the two files it appears beets used the file path locations it had in the database since it identified I was importing files from my library. Where perhaps it should have used the path at which I was explicitly importing instead and should have ignored the database information since we were re-importing after all.

I’d like to hear if I have my understanding here correct or if I missed something.

And thanks always for being with the community and our unending questions and issues. :slight_smile:

Aha! Is there any chance you’re running into this extremely nasty bug? It’s an old one that really needs some attention… https://github.com/beetbox/beets/issues/702