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

[BUG] Permissions issue on /recordings folder #240

Closed
1 task done
dahlbergc opened this issue Sep 26, 2023 · 2 comments
Closed
1 task done

[BUG] Permissions issue on /recordings folder #240

dahlbergc opened this issue Sep 26, 2023 · 2 comments

Comments

@dahlbergc
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm using environment PUID:GUID values of 1000:1000 in my docker-compose. When browsing the folder permissions in the image I see the following folders are owned by that user.

root@a2482ac1edd3:/# ls / -lah | grep abc
drwxr-xr-x   1 abc  abc    2 Sep 23 06:32 app
drwxrwxrwx  22 abc  abc   34 Sep 26 07:25 config
drwxr-xr-x   1 abc  abc    3 Sep 26 12:55 defaults

Unfortunately, the /recordings folder is still owned by root which is the default location for TVHeadnend recordings. I'm attempting to map this directory to a folder on my NAS, but no matter what I try, I keep receiving folder permission errors in TVHeadend when I attempt to record anything.

root@a2482ac1edd3:/# ls / -lah | grep recordings
drwxr-xr-x   2 root root   2 Sep 26 12:47 recordings

Would it be possible to set the ownership of the /recordings folder to the PUID:GUID configured in docker?

recordings

Expected Behavior

User abc in the image should be able to write files to the /recordings directory

Steps To Reproduce

  1. Set unique PUID and GUID environment values in docker

  2. Attempt to write to the /recordings folder as the abc user.
    docker exec tvheadend su -s /bin/bash abc -c 'touch /recordings/test.txt'

Environment

- OS: Debian GNU/Linux 11 (bullseye)

CPU architecture

x86-64

Docker creation

version: "3"
services:
  tvheadend:
    image: lscr.io/linuxserver/tvheadend
    container_name: tvheadend
    networks:
      - proxy
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Los_Angeles
      - DOCKER_MODS=linuxserver/mods:universal-cron
      - UMASK=002
    ports:
      - 9981:9981
      - 9982:9982
    devices:
      - /dev/dri
    volumes:
      - ${DOCKER_DIR}/tvheadend/data:/config
      - ${MEDIA_DIR}/dvr:/recordings
    labels: 
      - com.centurylinklabs.watchtower.enable=true
      - "traefik.enable=true"      
      - "traefik.http.routers.tvheadend.entrypoints=https"
      - "traefik.http.routers.tvheadend.middlewares=trusted@file"
      - "traefik.http.routers.tvheadend.rule=Host(`tv.${DOMAIN}`)"
      - "traefik.http.routers.tvheadend.tls.certresolver=cloudflare"
      - "traefik.http.routers.tvheadend.service=tvheadend"
      - "traefik.http.services.tvheadend.loadbalancer.server.port=9981"
    restart: unless-stopped

networks:
  proxy:
    external: true

Container logs

[mod-init] Attempting to run Docker Modification Logic
[mod-init] Adding linuxserver/mods:universal-cron to container
[mod-init] Downloading linuxserver/mods:universal-cron from lscr.io
[mod-init] Installing linuxserver/mods:universal-cron
[mod-init] linuxserver/mods:universal-cron applied to container
[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗ 
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝ 

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    816
───────────────────────────────────────

Setting permissions
**** cron package already installed, skipping ****
[custom-init] No custom files found, skipping...
2023-09-26 13:11:41.529 [   INFO] main: Log started
2023-09-26 13:11:41.529 [   INFO] config: Using configuration from '/config'
2023-09-26 13:11:41.530 [   INFO] http: Starting HTTP server 0.0.0.0:9981
2023-09-26 13:11:41.530 [   INFO] htsp: Starting HTSP server 0.0.0.0:9982
2023-09-26 13:11:41.561 [   INFO] config: loaded
2023-09-26 13:11:41.561 [   INFO] config: scanfile (re)initialization with path <none>
2023-09-26 13:11:41.562 [   INFO] transcode: 'video' context type registered
2023-09-26 13:11:41.562 [   INFO] transcode: 'audio' context type registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHH264Decoder' decoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHTHEORADecoder' decoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHAACDecoder' decoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHVORBISDecoder' decoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHOPUSDecoder' decoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHMPEG2VIDEOEncoder' encoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHH264Encoder' encoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHHEVCEncoder' encoder helper registered
2023-09-26 13:11:41.562 [   INFO] transcode: '&TVHAACEncoder' encoder helper registered
2023-09-26 13:11:41.562 [   INFO] codec: 'mpeg2video' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'mp2' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'aac' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'vorbis' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'flac' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libx264' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libx265' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libvpx' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libvpx-vp9' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libtheora' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libvorbis' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'libopus' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'h264_vaapi' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'hevc_vaapi' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'vp8_vaapi' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'vp9_vaapi' encoder registered
2023-09-26 13:11:41.562 [   INFO] codec: 'webtv-vorbis' codec profile created
2023-09-26 13:11:41.562 [   INFO] codec: 'webtv-vp8' codec profile created
2023-09-26 13:11:41.562 [   INFO] codec: 'webtv-aac' codec profile created
2023-09-26 13:11:41.562 [   INFO] codec: 'webtv-h264' codec profile created
2023-09-26 13:11:41.564 [   INFO] descrambler: adding CAID 2600/FFFF as ConstCW interval 10000ms pc 20 ep default (BISS)
2023-09-26 13:11:41.564 [   INFO] descrambler: adding CAID 0E00/FFFF as MultiPID interval 1000ms pc 2 ep default (PowerVu)
2023-09-26 13:11:41.580 [   INFO] iptv: Using 2 input thread(s)
2023-09-26 13:11:41.586 [   INFO] dvr: Creating new configuration ''
2023-09-26 13:11:41.586 [   INFO] epggrab: module uk_freesat created
2023-09-26 13:11:41.586 [   INFO] epggrab: module uk_freesat_eit created
2023-09-26 13:11:41.586 [   INFO] epggrab: module uk_freeview created
2023-09-26 13:11:41.586 [   INFO] epggrab: module nz_freeview2 created
2023-09-26 13:11:41.586 [   INFO] epggrab: module nz_freeview1 created
2023-09-26 13:11:41.586 [   INFO] epggrab: module viasat_baltic created
2023-09-26 13:11:41.586 [   INFO] epggrab: module Bulsatcom_39E created
2023-09-26 13:11:41.586 [   INFO] epggrab: module uk_cable_virgin created
2023-09-26 13:11:41.586 [   INFO] epggrab: module eit created
2023-09-26 13:11:41.586 [   INFO] epggrab: module psip created
2023-09-26 13:11:41.589 [   INFO] epggrab: module opentv-ausat created
2023-09-26 13:11:41.589 [   INFO] epggrab: module opentv-skyit created
2023-09-26 13:11:41.589 [   INFO] epggrab: module opentv-skynz created
2023-09-26 13:11:41.589 [   INFO] epggrab: module opentv-skyuk created
2023-09-26 13:11:41.589 [   INFO] epggrab: module xmltv created
2023-09-26 13:11:41.591 [   INFO] spawn: Executing "/usr/bin/tv_find_grabbers"
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_file created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_wg created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_url created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_zz_sdjson created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_it created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_zz_sdjson_sqlite created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_na_dtv created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_na_tvmedia created
2023-09-26 13:11:41.793 [   INFO] epggrab: module /usr/bin/tv_grab_combiner created
2023-09-26 13:11:41.794 [   INFO] xmltv: xmltv: external socket enabled
2023-09-26 13:11:41.798 [   INFO] epgdb: gzip format detected, inflating (ratio 22.9% deflated size 2278403)
2023-09-26 13:11:41.830 [   INFO] epgdb: parsing 9936385 bytes
2023-09-26 13:11:41.943 [   INFO] epgdb: loaded v3
2023-09-26 13:11:41.943 [   INFO] epgdb:   config     1
2023-09-26 13:11:41.944 [   INFO] epgdb:   broadcasts 9227
2023-09-26 13:11:41.944 [   INFO] dvr: Purging obsolete autorec entries for current schedule
2023-09-26 13:11:41.946 [ NOTICE] START: HTS Tvheadend version 4.3-2155~gfe4df311d started, running as PID:246 UID:1000 GID:816, CWD:/run/s6-rc:s6-rc-init:PaljmK/servicedirs/svc-tvheadend CNF:/config
2023-09-26 13:11:41.948 [   INFO] iptv: m3u parse: 0 new mux(es) in network 'IPTV' (total 130)
2023-09-26 13:11:41.950 [   INFO] iptv: m3u parse: 0 new mux(es) in network 'IPTV_Backups' (total 93)
2023-09-26 13:11:41.950 [   INFO] iptv: m3u parse: 0 new mux(es) in network 'LiveSports' (total 14)
2023-09-26 13:11:42.085 [   INFO] scanfile: DVB-S - loaded 1 regions with 116 networks
2023-09-26 13:11:42.085 [   INFO] scanfile: DVB-T - loaded 46 regions with 1134 networks
2023-09-26 13:11:42.085 [   INFO] scanfile: DVB-C - loaded 20 regions with 82 networks
2023-09-26 13:11:42.085 [   INFO] scanfile: ATSC-T - loaded 2 regions with 13 networks
2023-09-26 13:11:42.085 [   INFO] scanfile: ATSC-C - loaded 1 regions with 5 networks
2023-09-26 13:11:42.085 [   INFO] scanfile: ISDB-T - loaded 2 regions with 1297 networks
[ls.io-init] done.
2023-09-26 13:11:51.308 [   INFO] htsp: Got connection from 192.168.30.21
2023-09-26 13:11:51.308 [   INFO] htsp: 192.168.30.21: Welcomed client software: Kodi Media Center (HTSPv35)
2023-09-26 13:11:51.309 [   INFO] htsp: 192.168.30.21 [ Kodi Media Center ]: Identified as user ''
2023-09-26 13:11:56.387 [   INFO] htsp: Got connection from 192.168.30.20
2023-09-26 13:11:56.387 [   INFO] htsp: 192.168.30.20: Welcomed client software: Kodi Media Center (HTSPv35)
2023-09-26 13:11:56.390 [   INFO] htsp: 192.168.30.20 [ Kodi Media Center ]: Identified as user ''
2023-09-26 13:29:31.258 [   INFO] dvr: entry fffcd33728d9dd80e84f0840c8d2e158 "NFL Live" on "ESPN" starting at 2023-09-26 12:59:30, with broadcast id "<noid>", scheduled for recording by "192.168.30.21"
2023-09-26 13:29:31.259 [   INFO] dvr: "NFL Live" on "ESPN" recorder starting
2023-09-26 13:29:31.260 [   INFO] mpegts: helix.m3u - ESPN in IPTV - tuning on IPTV #1
2023-09-26 13:29:31.262 [   INFO] spawn: Executing "/usr/bin/ffmpeg"
2023-09-26 13:29:31.262 [   INFO] subscription: 0001: "DVR: NFL Live" subscribing on channel "ESPN", weight: 300, adapter: "IPTV #1", network: "IPTV", mux: "helix.m3u - ESPN", provider: "FFmpeg", service: "Service01", profile="pass", username=""
2023-09-26 13:29:33.228 [  ALERT] dvr: Unable to create dir "/recordings/NFL Live": Permission denied
2023-09-26 13:29:33.228 [  ERROR] dvr: Recording error: "NFL Live": Unable to create file
@j0nnymoe
Copy link
Member

Are you using remote mounts?

@dahlbergc
Copy link
Author

The mapped volumes in my docker-compose file are local folders on the same host as docker.

@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants