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

reflink: auto makes convert plugin crash on btrfs #5484

Open
TheLastGimbus opened this issue Oct 26, 2024 · 1 comment
Open

reflink: auto makes convert plugin crash on btrfs #5484

TheLastGimbus opened this issue Oct 26, 2024 · 1 comment

Comments

@TheLastGimbus
Copy link

TheLastGimbus commented Oct 26, 2024

Problem

There seems to be problem with reflink and convert because it uses /tmp where it's not necessary the same actual btrfs filesystem

I wanted to convert all my files to .opus on import. I have btrfs, so of course i wanted to use reflink goodies

Documentation said that reflink: auto will use reflink if filesystem supports it. However, i have a feeling like there is some global flag ala:

if options['reflink'] == 'auto' and fs in ['btrfs', ...]:
    useReflinks = True  # now it will *always* do cp --reflink=always ...

because when all my imported files where done encoding:

...
convert: Finished encoding /home/matiii/Downloads/1-800-OŚWIECENIE/23 Niedziela.opus
convert: Finished encoding /home/matiii/Downloads/1-800-OŚWIECENIE/25 Main Stage Freestyle.opus
Error: OS/filesystem does not support reflinks. during link of paths /tmp/tmpofeiyiwv.opus, /home/matiii/Music/beets/Taco Hemingway/1‐800‐OŚWIECENIE/01 #1 – WIELKOMIEJSKA BEZSENNOŚĆ.opus
matiii@matiii $

This will also happen if i manually do:

cp --reflink /tmp/tmpofeiyiwv.opus /home/matiii/Music/beets/Taco\ Hemingway/1‐800‐OŚWIECENIE/bez.opus
cp: failed to clone '/home/matiii/Music/beets/Taco Hemingway/1‐800‐OŚWIECENIE/bez.opus' from '/tmp/tmpofeiyiwv.opus': Invalid cross-device link
# or:
cp --reflink=always ... # same error

seems like my /tmp/ may be in-ram or something (i didn't customize it in fstab or anything 🤷)

When i do:

cp --reflink=auto /tmp/tmpofeiyiwv.opus /home/matiii/Music/beets/Taco\ Hemingway/1‐800‐OŚWIECENIE/bez.opus
matiii@matiii $ # works well!

Setup

  • OS: Arch Linux x86_64 - 6.11.3-arch1-1
  • Python version: 3.12.7
  • beets version: 1.6.1 2.0.0 apparently
  • Turning off plugins made problem go away (yes/no): ummm... technically yeah xD

My configuration (output of beet config) is:

import:
  write: yes
  move: no
  reflink: auto
  autotag: yes

...

convert:
  auto: yes
  max_bitrate: 96
  format: opus
@TheLastGimbus
Copy link
Author

TheLastGimbus commented Oct 26, 2024

this fascinated me enought to start digging, so i git pulled, ran it, and... it worked... god damn it... i hate it when stuff works...

Then, investigating further, i found that i'm not actually using 1.6.1, but 2.0.0 perfeclty before versions strings were corrected

There is an issue about it on arch gitlab: https://gitlab.archlinux.org/archlinux/packaging/packages/beets/-/issues/4

Solution proposed is to make v2.0.1... which would be nice, because it would also merge patches from 33ab22d which fixed my issue

but idk if right now you guys are stabilizing everything for next release 🤷

Waiting for it, cheers 🥂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant