Unable to create dir Operation not permitted
Added by Dave Travers over 9 years ago
Hi all,
I have recently upgraded TVHeadend on Ubuntu from 4.1 to the latest build and now I'm having problems with recording.
An example from the logs is:-
2015-07-04 20:26:35.990 settings: Unable to create dir "/media/Time-Capsule/Shared/Media/Recordings/Coming up on 5 live sports extra": Operation not permitted
2015-07-04 20:26:35.990 dvr: Recording error: "Coming up on 5 live sports extra": Unable to create file
The strange thing is the folder IS created! If I ask something to record it fails, if I ask it to record again it works so obviously the Hts user has the permissions. If I SSH to the computer as Hts I have no problems creating folders or files in the Recordings directory.
If I ask to record one program twice in quick succession I get the following in the logs:-
2015-07-04 20:32:48.622 dvr: entry 8e19c9f6359878bc7ecd610e09b64612 "Coming up on 5 live sports extra" on "BBC R5SX" starting at 2015-07-04 16:59:30, scheduled for recording by "dave"
2015-07-04 20:32:48.622 dvr: "Coming up on 5 live sports extra" on "BBC R5SX" recorder starting
2015-07-04 20:32:48.622 mpegts: 706MHz in Freeview - tuning on TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0
2015-07-04 20:32:49.025 subscription: 0034: "DVR: Coming up on 5 live sports extra" subscribing on channel "BBC R5SX", weight: 300, adapter: "TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0", network: "Freeview", mux: "706MHz", service: "BBC R5SX", profile="pass"
2015-07-04 20:32:50.601 settings: Unable to create dir "/media/Time-Capsule/Shared/Media/Recordings/Coming up on 5 live sports extra": Operation not permitted
2015-07-04 20:32:50.601 dvr: Recording error: "Coming up on 5 live sports extra": Unable to create file
2015-07-04 20:32:50.601 subscription: 0034: "DVR: Coming up on 5 live sports extra" unsubscribing from "BBC R5SX"
2015-07-04 20:32:51.004 dvr: "Coming up on 5 live sports extra" on "BBC R5SX": End of program: File Not Created
2015-07-04 20:32:58.892 dvr: entry ceab2e34453fd7f22b8e674f93f3cc4f "Coming up on 5 live sports extra" on "BBC R5SX" starting at 2015-07-04 16:59:30, scheduled for recording by "dave"
2015-07-04 20:32:58.893 dvr: "Coming up on 5 live sports extra" on "BBC R5SX" recorder starting
2015-07-04 20:32:58.893 mpegts: 706MHz in Freeview - tuning on TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0
2015-07-04 20:32:59.296 subscription: 0038: "DVR: Coming up on 5 live sports extra" subscribing on channel "BBC R5SX", weight: 300, adapter: "TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0", network: "Freeview", mux: "706MHz", service: "BBC R5SX", profile="pass"
2015-07-04 20:33:00.845 pass: /media/Time-Capsule/Shared/Media/Recordings/Coming up on 5 live sports extra/Coming up on 5 live sports extra2015-07-0417-00.ts: Unable to change permissions -- Operation not permitted
2015-07-04 20:33:00.845 dvr: /media/Time-Capsule/Shared/Media/Recordings/Coming up on 5 live sports extra/Coming up on 5 live sports extra2015-07-0417-00.ts from adapter: "TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0", network: "Freeview", mux: "706MHz", provider: "", service: "BBC R5SX"
2015-07-04 20:33:00.845 dvr: # type lang resolution aspect ratio sample rate channels
2015-07-04 20:33:00.845 dvr: 1 MPEG2AUDIO eng ? ?
Any ideas?
Replies (19)
RE: Unable to create dir Operation not permitted - Added by saen acro over 9 years ago
Who have right to write there?
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Its mounted from fstab with user HTS and permission 0777
RE: Unable to create dir Operation not permitted - Added by Mihail sovaby over 9 years ago
Show your fstab
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Line from fstab
//172.16.0.254/Data/media/Time-Capsule cifs username=username,password=password,sec=ntlm,iocharset=utf8,gid=118,uid=118,file_mode=0777,dir_mode=0777 0 0
uid 118 is the Hts user
Same line in fstab has worked for months and if I log in as Hts I can create folders and files no problems. In fact tvheadend created the folder but registers that it's failed.
RE: Unable to create dir Operation not permitted - Added by Mihail sovaby over 9 years ago
//172.16.0.254/Data/media/Time-Capsule cifs or //172.16.0.254 /Data/media/Time-Capsule cifs or //172.16.0.254/Data /media/Time-Capsule cifs
Where is the mount point ?
if mount point /media/Time-Capsule Watch 172.16.0.254
I think it lacks a space or tab in the right place
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Sorry, typo that should be //172.16.0.254/Data /media/Time-Capsule ...
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Ok strange results tonight! 1 recording worked and 2 failed! None of them had existing folders.
Really don't think its a permissions problem.
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Ok, to simplify things I have changed my recording location to /media/Recordings (a local folder), chown -R'd it to hts:video and chmoded it to 777 -R
Interestingly some recordings work, some don't, file missing! it's getting harder to work out the error message as I have to be logged into the web console to get the message.
The folders aren't created for the failed recordings now though.
RE: Unable to create dir Operation not permitted - Added by Prof Yaffle over 9 years ago
1. Messages are also to syslog, so you can track them there
2. If you look at /etc/default/tvheadend, you can switch debug logging on there (restart the service) and then peruse syslog at your leisure
3. You'll probably need to switch trace debugging on - you can do that in the web interface if your binary has trace enabled:
http://docs.tvheadend.org/Appendices/debugging/
I believe 4.1 is automatically built with trace - check About -> Toggle Details and see that "--enable-trace" is in there. If so, you're good to go. I'd start by tracing dvr, but you may want to look at mkv and/or pass as well depending on your container (looks like you're using 'pass').
4. I'd also check what permissions you're trying to use (Configuration -> Recording -> <specific profile name> )
5. ... and the user as which tvheadend is running (just to make sure you're not trying to chown/chmod from your user to hts, which isn't allowed).
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Thanks fro the reply and the useful info.
Yes i am using pass.
In About -> toggle details there is no --enable-trace
I have now enabled debug in /etc/default/tvheadend. Checking the Configuration -> Debugging options Debig to syslog is enabled and subsystems is +all
In recording subdirectory options Directory permissions is set to 0775 and file permissions are set to 0664
Yes TVHeadend is running as hts.
I will see what happens next time the recording fails.
RE: Unable to create dir Operation not permitted - Added by Prof Yaffle over 9 years ago
Okay, you may have to self-build (or I can build you a deb if you're not comfortable doing it) to get trace debugging, then. Let's see what your debug log tells us first, though.
Tvheadend doesn't try to be clever when creating files and directories, so I suspect it's still something to do with your system permissions. I'm wondering perhaps on the mount point originally, perhaps on a parent directory now - if hts can't list what's in /media then it may not be able to ever find /media/recordings, for example, despite having write permission. That doesn't explain the inconsistency, though.
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Thanks again for the update. A recording was scheduled for 18:00 today and it failed:-
Jul 7 17:59:30 Ubuntu tvheadend2766: dvr: "CSI: New York" on "5USA" recorder starting
Jul 7 17:59:30 Ubuntu tvheadend2766: dvr: unable to find access (owner '(null)', creator 'Auto recording by: 80.6.91.33')
Jul 7 17:59:37 Ubuntu tvheadend2766: mpegts: 698MHz in Freeview - add raw service
Jul 7 17:59:37 Ubuntu tvheadend2766: service: 3: 698MHz in Freeview si 0x27827f0 TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0 weight 0 prio 10 error 0
Jul 7 17:59:37 Ubuntu tvheadend2766: service: 2: 698MHz in Freeview si 0x3626210 TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0 weight 0 prio 10 error 0
Jul 7 17:59:37 Ubuntu tvheadend2766: mpegts: 698MHz in Freeview - tuning on TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0
Jul 7 17:59:37 Ubuntu tvheadend2766: linuxdvb: TurboSight TBS 62x1 DVBT/T2 frontend : DVB-T #0 - starting 698MHz in Freeview
Jul 7 17:59:37 Ubuntu tvheadend2766: mpegts: 698MHz in Freeview - started
Jul 7 17:59:37 Ubuntu tvheadend2766: mpegts: 698MHz in Freeview - open PID 0012 (18) [20/0x2f7cd70]
Jul 7 17:59:37 Ubuntu tvheadend2766: eit: installed table handlers
Interestingly the DVR Autorecord entries also had owner as blank and Creator as an IP address. The one that had worked had Dave and Dave (the user I created for access restrictions in tvheadend).
When I selected to record the program that failed it started recording fine!
I have changed the recording entries to match owner and creator.
RE: Unable to create dir Operation not permitted - Added by saen acro over 9 years ago
What is ownership of folder where you recording
show what show
ls -alin upper folder
in fstab use root to mount
RE: Unable to create dir Operation not permitted - Added by Prof Yaffle over 9 years ago
I think you've found the problem - you probably have autorec rules or previously-scheduled rules that haven't survived the latest upgrade. I recall that the access entries were changed relatively recently, and it looks like you were left with scheduled recordings that had no owner - or an owner without DVR permissions, which is tantamount to the same thing.
If you've made them all the same owner as the ones that work, I'd expect them to work without problem now. Just make sure new rules are created with the right ownership.
Once that's all well, reinstate your NFS mount and check again.
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
I think so. I have always used "Create AutoRec" on the web interface to create recording schedules.
I have notices that the "Create autoRec" button no longer works.
To be safe I have removed all the recording entries and manually recreated them.
Next recording is at 21:00
Don't think I will be moving the recordings back to the time-capsule though. All being well a new HDD will be arriving for the Ubuntu box and I will be copying all content from the Time-Capsule to that The time-capsule has been running for 6 years so the HDD is getting rather old and it's only 1TB
RE: Unable to create dir Operation not permitted - Added by Prof Yaffle over 9 years ago
Hmmmm - the button should work - are you logged in as a user with DVR permissions? You shouldn't have to recreate everything...
(and 1TB is a boot disc nowadays )
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Yep user has all permissions and I can create any other recordings, except using the "Create AutoRecord" button.
I know what you mean, but having multiple TB of cloud storage and a nice fast internet connection means I don't have to store too much locally but my inet still isn't up to streaming full Blu-ray quality films and others browsing at the same time
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Ok, 2 for 2 so far! 2 recordings started successfully
RE: Unable to create dir Operation not permitted - Added by Dave Travers over 9 years ago
Ok, 4 for 4 now, looks like we've sorted it.
Thanks everyone for your help.
Dave