Skip to content

[BUG] Hard Linking Fails Inside linuxserver/beets Container on CIFS Volume (LXC Host) #136

@Kreakdude

Description

@Kreakdude

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Beets fails to create hard links between files located on the same Docker volume mapped from a CIFS/Samba share. The error reported by Beets is: "Error: Not supported during link of paths". This occurs despite manual verification that hard links are supported by the underlying CIFS mount on the host, and that the Docker container itself can successfully execute ln commands to create hard links within the same mounted volume. Beets attempts to import as if hard links are not supported, preventing the desired workflow (avoiding file duplication).

Expected Behavior

Beets should successfully create hard links from the source directory (e.g., /media/downloads/beets/) to the destination library directory (e.g., /media/audiobooks/beets/) when link: yes is configured. This operation should not result in a "Not supported" error, as the underlying filesystem and container environment support hard links for this volume.

Steps To Reproduce

  1. Host Setup:
    • Proxmox VE running an Ubuntu LXC Container (CT).
    • A CIFS/SMB share (e.g., //192.168.86.32/public) is mounted on the Ubuntu CT host (e.g., at /mnt/samba/public).
  2. Docker Volume Creation:
    • A Docker named volume (e.g., samba) is created on the Ubuntu CT host, mapping to the CIFS mount point (e.g., /var/lib/docker/volumes/samba/_data/ points to /mnt/samba/public or similar, or the volume itself is configured to use the CIFS mount as its driver).
  3. Beets Container Deployment:
    • The linuxserver/beets:latest container is deployed with this samba named volume mapped to /media inside the container.
  4. Beets Configuration:
    • In config.yaml, ensure link: yes and copy: no are set under the import: section.
    • Ensure directory: /media/audiobooks/beets and library: /config/library.db are set appropriately.
  5. Prepare Test Files:
    • Place an audio file (e.g., GS Youngblood - The Masculine in Relationship.m4b) into a source directory within the mounted volume (e.g., /media/downloads/beets/).
  6. Initiate Import:
    • Access the Beets container shell: docker exec -it beets /bin/bash
    • Run the import command: beet import /media/downloads/beets/
  7. Respond to Prompt:
    • At the interactive prompt (e.g., ➜ # selection (default 1), Skip, Use as-is, Enter search, enter Id, aBort, eDit, edit Candidates?), enter U (Use as-is).

Expected result: Beets should create a hard link and successfully import the file.
Actual result: Beets returns "Error: Not supported during link of paths".

Environment

* **Host OS:** Proxmox VE (User's specific Ubuntu CT version here, e.g., Ubuntu 22.04 LTS)
* **Docker Management:** Docker Compose, managed via Portainer
* **Beets Container Image:** `linuxserver/beets:latest`
* **Beets Version (inside container):** `2.3.1`
* **Python Version (inside container):** `3.12.11`
* **Beets Plugins enabled:** `badfiles, bpd, edit, embedart, fuzzy, lastgenre, scrub, web`
* **Storage:** SMB/CIFS share (`//192.168.86.32/public`) mounted on the Ubuntu CT host, then accessed by Docker as a named volume.

**Beets `config.yaml` snippet (relevant parts at time of hardlink attempt):**

library: /config/library.db
directory: /media/audiobooks/beets

import:
  write: yes
  copy: no
  link: yes
  # ... other import options like resume: no, singletons: yes, etc.

CPU architecture

x86-64

Docker creation

version: "3.3" # Or your specific Docker Compose version
services:
  beets:
    image: linuxserver/beets:latest
    container_name: beets
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles # Please use your correct timezone
    volumes:
      - samba:/media # This is the crucial volume mapping
      - /path/to/your/beets/config:/config # Adjust this to your host config path
    restart: unless-stopped

volumes:
  samba:
    external: true
    name: samba # This volume should be pre-created/managed by Docker to map to your CIFS mount on the host.

Container logs

Key Diagnostic Results:

df -T Inside Container: Confirmed /media is seen as a single cifs filesystem:

Filesystem              Type     1K-blocks         Used  Available Use% Mounted on
//192.168.86.32/public  cifs    9689131756 5022300628 4666831128  52% /media
Manual ln Test on Ubuntu CT Host: Successfully created a hard link between two files on the CIFS mount. ls -i confirmed identical inodes.

Manual ln Test Inside Beets Container: Executing ln source_file destination_file inside the container (as root) returned no error, but ls -i showed different inode numbers for the source and destination, indicating it silently failed to create a hard link (and effectively copied the file).

Other Containers: Other linuxserver images (e.g., radarr, sonarr, readarr) successfully perform hard links on this exact same underlying samba Docker volume.

Permissions: Container user abc (PUID/PGID 1000) has rwxr-xr-x permissions on the /media directories.

The primary error (Error: Not supported during link of paths) is displayed directly in the console output during the beet import process. There are no additional specific log lines in the standard container logs (accessible via docker logs beets) that provide further details about the hard link failure beyond this console message.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions