Imported album changes gid to root
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
When I import an album into my library with beets the written directory and files change group ownership from 1027:100 (source) to 1027:0 (destination). IMO the file/dir owner should not be altered.
I suspected the permissions plugin but it seems to also happen when ran without plugins.
### Problem
Running this command in verbose (`-vv`) mode:
```
% id
uid=1027(jb) gid=100(users) groups=100(users),4(adm),10(wheel),190(systemd-journal) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[beets_import.log](https://github.com/user-attachments/files/19373578/beets_import.log)
% stat ~inc/music/Tate.McRae-So.Close.To.What.2025.\[16Bit\]
File: /data/truenas/scratch/inc/music/Tate.McRae-So.Close.To.What.2025.[16Bit]
Size: 3 Blocks: 49 IO Block: 131072 directory
Device: 0,103 Inode: 407805 Links: 2
Access: (0750/drwxr-x---) Uid: ( 1027/ jb) Gid: ( 100/ users)
[...]
% beet -vv import ~inc/music
[...]
% stat ~mp3/Tate\ McRae\ -\ So\ Close\ to\ What\ \(2025\)
File: /data/truenas/music/Tate McRae - So Close to What (2025)
Size: 18 Blocks: 78 IO Block: 131072 directory
Device: 0,104 Inode: 102532 Links: 2
Access: (0750/drwxr-x---) Uid: ( 1027/ jb) Gid: ( 0/ root)
```
### Setup
* OS: Fedora 41
* Python version: 3.13.2
* beets version: 1.6.1
* Turning off plugins made problem go away (yes/no): no
My configuration (output of `beet config`) is:
```
# --------------- Plugins ---------------
plugins:
- fetchart
- duplicates
- convert
- scrub
- zero
- replaygain
- lastgenre
- chroma
- inline
- missing
- permissions
- bareasc
- importadded
- hook
directory: /data/truenas/music
art_filename: cover
# --------------- Performance ---------------
threaded: yes
original_date: no
# --------------- Tagging ---------------
per_disc_numbering: no
importadded:
preserve_mtimes: no
preserve_write_mtimes: no
scrub:
auto: yes
zero:
auto: yes
fields: month day comments
keep_fields: []
update_database: no
permissions:
file: '0644'
dir: '0750'
chroma:
auto: yes
duplicates:
album: yes
checksum: ''
copy: ''
count: no
delete: no
format: ''
full: no
keys: []
merge: no
move: ''
path: no
tiebreak: {}
strict: no
tag: ''
missing:
count: yes
total: no
album: no
convert:
auto: no
ffmpeg: /usr/bin/ffmpeg
opts: -ab 320k -ac 2 -ar 48000
max_bitrate: 320
threads: 1
dest:
pretend: no
link: no
hardlink: no
format: mp3
id3v23: inherit
formats:
aac:
command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
extension: m4a
alac:
command: ffmpeg -i $source -y -vn -acodec alac $dest
extension: m4a
flac: ffmpeg -i $source -y -vn -acodec flac $dest
mp3: ffmpeg -i $source -y -vn -aq 2 $dest
opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
auto_keep: no
tmpdir:
quiet: no
embed: yes
paths: {}
no_convert: ''
never_convert_lossy_files: no
copy_album_art: no
album_art_maxwidth: 0
delete_originals: no
playlist:
paths:
default: $albumartist - $album%aunique{} ($year)/$track. $artist - $title
singleton: Non-Album/$artist - $title
comp: $album%aunique{} ($year)/$track. $artist - $title
import:
write: yes
copy: no
move: yes
resume: ask
duplicate_verbose_prompt: yes
incremental: no
from_scratch: yes
quiet_fallback: skip
timid: no
languages: en jp es
log: ~/.config/beets/beet.log
match:
preferred:
media: [Digital Media|File, CD]
original_year: yes
lastgenre:
auto: yes
whitelist: yes
min_weight: 10
count: 1
fallback:
canonical: no
source: album
force: yes
separator: ', '
prefer_specific: no
title_case: yes
embedart:
auto: no
fetchart:
auto: yes
enforce_ratio: 2%
maxwidth: 750
quality: 0
minwidth: 0
max_filesize: 0
cautious: no
cover_names:
- cover
- front
- art
- album
- folder
sources:
- filesystem
- coverart
- itunes
- amazon
- albumart
- cover_art_url
store_source: no
high_resolution: no
deinterlace: no
cover_format:
google_key: REDACTED
google_engine: 001442825323518660753:hrh5ch1gjzm
fanarttv_key: REDACTED
lastfm_key: REDACTED
replaygain:
auto: yes
backend: gstreamer
overwrite: yes
threads: 4
parallel_on_import: no
per_disc: no
peak: 'true'
targetlevel: 89
r128: [Opus]
r128_targetlevel: 84
bareasc:
prefix: '#'
```
Contributor guide
Research direction
Start by reproducing the ownership change with the documented `beet -vv import ~inc/music` command and compare the provided `stat` output before and after import. Inspect the import path and permissions-plugin behavior involved in moving files. Done means imported directories and files retain the source group ownership without plugins or with the reported configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100