• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting "Too many open files in system error" during library scan

     
    • 0 Vote(s) - 0 Average

    "Too many open files in system error" during library scan

    Some media missing after scan, many errors in logs, SMB mounted store
    awkward-gopher
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2025 Jan
    Reputation: 0
    Country:United States
    #4
    2025-01-31, 04:19 PM
    Well, I did something absolutely wacky, and it worked.

    Here's how it breaks down: SMB support on Mac OS is just really unstable. I couldn't actually get it working using that. Instead, I baked a new container. I'll provide the dockerfile and entrypoint for reference if anyone is interested. But, with these changes, it mounts the SMB mount *within* the container, instead of mounting it in Mac OS and accessing it via a docker volume.

    Here's how it works:

    Added a new Dockerfile:

    Code:
    FROM jellyfin/jellyfin:latest

    # Install CIFS utilities for mounting SMB shares
    RUN apt-get update && \
        apt-get install -y cifs-utils && \
        apt-get clean

    # Copy custom entrypoint script
    COPY entrypoint.sh /entrypoint.sh
    RUN chmod +x /entrypoint.sh

    # Override entrypoint
    ENTRYPOINT ["/entrypoint.sh"]

    And the entrypoint
    Code:
    #!/bin/bash

    set -e

    # Ensure required env vars are set
    if [[ -z "$SMB_SERVER" || -z "$SMB_SHARE" || -z "$SMB_USER" || -z "$SMB_PASS" ]]; then
    echo "Missing SMB environment variables! Exiting."
    exit 1
    fi

    # Define mount point
    MOUNT_POINT="/data"

    # Create mount directory if it doesn’t exist
    mkdir -p "$MOUNT_POINT"

    # Attempt to mount SMB share
    echo "Mounting SMB share: //$SMB_SERVER/$SMB_SHARE at $MOUNT_POINT..."
    mount -t cifs "//$SMB_SERVER/$SMB_SHARE" "$MOUNT_POINT" \
    -o username="$SMB_USER",password="$SMB_PASS",vers=3.0,uid=1000,gid=1000,iocharset=utf8,rw

    # Ensure mount is successful
    if ! mountpoint -q "$MOUNT_POINT"; then
    echo "Failed to mount SMB share! Exiting."
    exit 1
    fi

    echo "SMB share mounted successfully."

    # Run the default Jellyfin entrypoint
    exec /jellyfin/jellyfin

    And an update to the compose service
    Code:
      jellyfin:
        container_name: jellyfin
        build:
          context: .
          dockerfile: Dockerfile
        privileged: true
        cap_add:
          - SYS_ADMIN
          - DAC_READ_SEARCH
        devices:
          - /dev/fuse
        tmpfs:
          - /run
          - /tmp
        network_mode: host
        restart: unless-stopped
        volumes:
          - ./jellyfin-config:/config
        ports:
          - "8096:8096"
        environment:
          PUID: 1000
          PGID: 1000
          TZ: America/Los_Angeles
          SMB_SERVER: my-server-name
          SMB_SHARE: jellyfin
          SMB_USER: username
          SMB_PASS: password

    By doing this, everything works and I'm able to scan the library. I think it might be a bit snappier as well. But that's not measured, just a feeling.
    1
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    "Too many open files in system error" during library scan - by awkward-gopher - 2025-01-29, 03:07 PM
    RE: "Too many open files in system error" during library scan - by TheDreadPirate - 2025-01-29, 04:13 PM
    RE: "Too many open files in system error" during library scan - by awkward-gopher - 2025-01-30, 05:04 AM
    RE: "Too many open files in system error" during library scan - by awkward-gopher - 2025-01-31, 04:19 PM
    RE: "Too many open files in system error" during library scan - by gnattu - 2025-01-31, 07:48 PM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode