Project

General

Profile

Permissions issue when recording programs

Added by Mike Brown over 5 years ago

version 4.2.8, Ubuntu server version 18.10, HDHR3, installed via ubuntu repo.

Live tv works fine.

I have a RAID array type 10 that has been chmod 777 on the directory and parent directory. Receive the following error. Some online doumentation refer to user TVH I do not have this user.

Jun 9 14:20:44 server tvheadend1652: dvr: entry e91c5ec58e7b3cb5ae189c0942e978e4 "Three's Company" on "CBS6ANT" starting at 2019-06-09 13:59:30, scheduled for recor$
Jun 9 14:20:44 server tvheadend1652: dvr: "Three's Company" on "CBS6ANT" recorder starting
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.038 [ INFO] dvr: entry e91c5ec58e7b3cb5ae189c0942e978e4 "Three's Company" on "CBS6ANT" starting$
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.038 [ INFO] dvr: "Three's Company" on "CBS6ANT" recorder starting
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.038 [ INFO] dvr: About to set stop timer for "Three's Company" on "CBS6ANT" at start 1560088800$
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.038 [ INFO] mpegts: 539.028MHz in HDHR - tuning on HDHomeRun ATSC-T Tuner #0 (192.168.2.150)
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.038 [ INFO] tvhdhomerun: tuning to auto:539028615
Jun 9 14:20:44 server tvheadend1652: dvr: About to set stop timer for "Three's Company" on "CBS6ANT" at start 1560088800 and original stop 1560090600 and overall st$
Jun 9 14:20:44 server tvheadend1652: mpegts: 539.028MHz in HDHR - tuning on HDHomeRun ATSC-T Tuner #0 (192.168.2.150)
Jun 9 14:20:44 server tvheadend1652: tvhdhomerun: tuning to auto:539028615
Jun 9 14:20:44 server tvheadend1652: subscription: 0022: "DVR: Three's Company" subscribing on channel "CBS6ANT", weight: 300, adapter: "HDHomeRun ATSC-T Tuner #0 ($
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.039 [ INFO] subscription: 0022: "DVR: Three's Company" subscribing on channel "CBS6ANT", weight$
Jun 9 14:20:44 server tvheadend1652: pass: /media/md0/recordings/Three's Company.ts: Unable to create file, open failed -- Permission denied
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.127 [ ERROR] pass: /media/md0/recordings/Three's Company.ts: Unable to create file, open failed $
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.127 [ ERROR] dvr: Recording error: "/media/md0/recordings/Three's Company.ts": Unable to open fi$
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.127 [ INFO] subscription: 0022: "DVR: Three's Company" unsubscribing from "CBS6ANT"
Jun 9 14:20:44 server tvheadend1652: dvr: Recording error: "/media/md0/recordings/Three's Company.ts": Unable to open file
Jun 9 14:20:44 server tvheadend1652: subscription: 0022: "DVR: Three's Company" unsubscribing from "CBS6ANT"
Jun 9 14:20:44 server tvheadend1652: dvr: unable to stat file '/media/md0/recordings/Three's Company.ts'
Jun 9 14:20:44 server tvheadend1652: dvr: "Three's Company" on "CBS6ANT": End of program: File not created
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.128 [ ERROR] dvr: unable to stat file '/media/md0/recordings/Three's Company.ts'
Jun 9 14:20:44 server tvheadend.tvheadend1652: 2019-06-09 14:20:44.128 [ INFO] dvr: "Three's Company" on "CBS6ANT": End of program: File not created
Jun 9 14:20:44 server kernel: [ 4672.100459] audit: type=1400 audit(1560090044.124:104): apparmor="DENIED" operation="mknod" profile="snap.tvheadend.tvheadend" name=2$

Any help appreciated.


Replies (8)

RE: Permissions issue when recording programs - Added by Dave H over 5 years ago

Please show the output of:

ls -ld /media/md0/recordings

Also is anything listed by:

sudo aa-status | grep tvh

RE: Permissions issue when recording programs - Added by Mike Brown over 5 years ago

ls -ld /media/md0/recordings
drwxrwxrwx 2 root root 4096 Jun 8 19:37 /media/md0/recordings

sudo aa-status | grep tvh
snap-update-ns.tvheadend
snap.tvheadend.hook.install
snap.tvheadend.oscam
snap.tvheadend.tvheadend
snap.tvheadend.oscam (1622)
snap.tvheadend.oscam (2361)
snap.tvheadend.tvheadend (1652)

RE: Permissions issue when recording programs - Added by saen acro over 5 years ago

Do you need to use SNAP packages?
SNAP isolation need extra parameters to have write permissions.

RE: Permissions issue when recording programs - Added by Noone Toknow over 3 years ago

Hi there,
not to be grave digger ... but this is exactly the problem I am facing right now ...
Had to install TvHeadend via snap as it seems to be the only option on my Ubuntu 20.04 LTS on Pi 4. Live TV works fine, Recording to internal SD cards works fine. However, changing the default recording path from /root/snap/tvheadend/140 to my external HDD (Raid 1) mounted on /mnt/UsbDataRaid/Media/TVRecodings (via symbolic link on TVRecordings folder) results in the log entry:

2021-06-04T10:18:48Z tvheadend1997: pass: /root/snap/tvheadend/TVRecordings/drehscheibe.ts: Unable to create file, open failed -- Permission denied
2021-06-04T10:18:48Z tvheadend.tvheadend1997: 2021-06-04 12:18:48.672 [ ERROR] pass: /root/snap/tvheadend/TVRecordings/drehscheibe.ts: Unable to create file, open failed -- Permission denied
2021-06-04T10:18:48Z tvheadend1997: dvr: Recording error: "/root/snap/tvheadend/TVRecordings/drehscheibe.ts": Unable to open file
2021-06-04T10:18:48Z tvheadend.tvheadend1997: 2021-06-04 12:18:48.672 [ ERROR] dvr: Recording error: "/root/snap/tvheadend/TVRecordings/drehscheibe.ts": Unable to open file
2021-06-04T10:18:48Z tvheadend1997: subscription: 0007: "DVR: drehscheibe" unsubscribing from "ZDF HD"
2021-06-04T10:18:48Z tvheadend.tvheadend1997: 2021-06-04 12:18:48.672 [ INFO] subscription: 0007: "DVR: drehscheibe" unsubscribing from "ZDF HD"
2021-06-04T10:18:48Z tvheadend1997: dvr: unable to stat file '/root/snap/tvheadend/TVRecordings/drehscheibe.ts'
2021-06-04T10:18:48Z tvheadend.tvheadend1997: 2021-06-04 12:18:48.672 [ ERROR] dvr: unable to stat file '/root/snap/tvheadend/TVRecordings/drehscheibe.ts'
2021-06-04T10:18:48Z tvheadend1997: dvr: "drehscheibe" on "ZDF HD": End of program: File not created
2021-06-04T10:18:48Z tvheadend.tvheadend1997: 2021-06-04 12:18:48.672 [ INFO] dvr: "drehscheibe" on "ZDF HD": End of program: File not created

root@myserver:~/snap/tvheadend# ls -ld /mnt/UsbDataRaid/Media/TVRecordings/
drwxrwxrwx 2 root root 4096 Jun 4 12:17 /mnt/UsbDataRaid/Media/TVRecordings/

root@myserver:~/snap/tvheadend# sudo aa-status | grep tvh
snap-update-ns.tvheadend
snap.tvheadend.hook.configure
snap.tvheadend.hook.install
snap.tvheadend.oscam
snap.tvheadend.oscam-config
snap.tvheadend.oscam-webui
snap.tvheadend.reset-permissions
snap.tvheadend.tvheadend
snap.tvheadend.tvheadend-webui
/snap/tvheadend/140/usr/local/bin/oscam (1996) snap.tvheadend.oscam
/snap/tvheadend/140/usr/local/bin/oscam (2356) snap.tvheadend.oscam
/snap/tvheadend/140/usr/bin/tvheadend (1997) snap.tvheadend.tvheadend

I also tried using symbolic link from /root/snap/tvheadend to my external drive => no success ...

@saen acro: what special write permissions in snap isolation were you talking about please?

Will appreciate any help! Thanks!

RE: Permissions issue when recording programs - Added by saen acro over 3 years ago

Create folder in base example /DVR and allow permission 0666

RE: Permissions issue when recording programs - Added by Noone Toknow over 3 years ago

Thanks for the quick reply!

Sadly it did not work... "File missing".
Config details see screenshots attached.

Log says:

me@myserver:/$ sudo snap logs tvheadend
16:44:30, scheduled for recording by "192.168.1.31", retention "On file removal" removal "Forever" 
2021-06-04T14:55:53Z tvheadend[2060]: dvr: entry 4ac416dc7081be7c9e760ebc110ada46 "hessenschau" on "hr-fernsehen HD" starting at 2021-06-04 16:44:30, scheduled for recording by "192.168.1.31" 
2021-06-04T14:55:53Z tvheadend[2060]: dvr: "hessenschau" on "hr-fernsehen HD" recorder starting
2021-06-04T14:55:53Z tvheadend.tvheadend[2060]: 2021-06-04 16:55:53.551 [   INFO] dvr: entry 4ac416dc7081be7c9e760ebc110ada46 "hessenschau" on "hr-fernsehen HD" starting at 2021-06-04 16:44:30, scheduled for recording by "192.168.1.31" 
2021-06-04T14:55:53Z tvheadend.tvheadend[2060]: 2021-06-04 16:55:53.552 [   INFO] dvr: "hessenschau" on "hr-fernsehen HD" recorder starting
2021-06-04T14:55:53Z tvheadend.tvheadend[2060]: 2021-06-04 16:55:53.552 [  ERROR] dvr: the directory '/DVR/' is not accessible
2021-06-04T14:55:53Z tvheadend[2060]: dvr: the directory '/DVR/' is not accessible

RE: Permissions issue when recording programs - Added by saen acro over 3 years ago

That's why SNAP is CRAP
it have permission to write in

/snap/$SNAPPNAME

but if modified YAML config can connect to some other places/devices/etc.

snap interfaces

and be connected to them

explanation

That's why native is better and faster.
It's not so hard to build it manual

RE: Permissions issue when recording programs - Added by Noone Toknow over 3 years ago

Yeah I see that there is much overhead with snap ... Adding the connection did not work either, thus I uninstalled the snap version of tvheadend

Sadly I failed to compile it myself and posted a large update in the linked post. Could you maybe lend me a hand here?

https://tvheadend.org/boards/4/topics/24116?r=44670#message-44670

Thanks!

    (1-8/8)