2022-08-14, 06:57 PM
I am trying to run NextPVR as an addon to home assistant, which means that home assistant essentially manages the docker environment, ensuring that the folders and ports are mapped etc. but otherwise it is a docker container. My NPVR docker image has two mount points, one /config that is mapped to a local folder on my ha server and /share which is where the buffer is held. /share is actually mapped to a cifs mounted folder on the ha instance.
Anyway enough background, when I try to play a channel in NPVR I get the following in the log
This reads to me that there is a problem writing to the buffer folder, however if I log on to the docker container and try to write a test file as the same user as NPVR it is sucessful
My question is, if the container user can write to the folder, but NPVR cannot, what is the problem, or what can I do to get more information as I have run out of ideas on how to troubleshoot
Thanks
Paul
Anyway enough background, when I try to play a channel in NPVR I get the following in the log
Code:
[color=#6a9955][font=Consolas, 'Courier New', monospace]2022-08-14[/font][/color][color=#d4d4d4][font=Consolas, 'Courier New', monospace] [/font][/color][color=#6a9955][font=Consolas, 'Courier New', monospace]16:45:46.945[/font][/color][color=#d4d4d4][font=Consolas, 'Courier New', monospace] [/font][/color][color=#ce9178][font=Consolas, 'Courier New', monospace][b][ERROR][/b][/font][/color][color=#d4d4d4][color=#d4d4d4][font=Consolas, 'Courier New', monospace][[/font][/color][/color][color=#569cd6][font=Consolas, 'Courier New', monospace]6[/font][/color][color=#d4d4d4][color=#d4d4d4][font=Consolas, 'Courier New', monospace]] Unexpected error writing to OutputSink: [/font][/color][/color][color=#ce9178][font=Consolas, 'Courier New', monospace][i]System.UnauthorizedAccessException[/i][/font][/color][color=#d4d4d4][color=#d4d4d4][font=Consolas, 'Courier New', monospace]: Access to the path [/font][/color][/color][color=#ce9178][font=Consolas, 'Courier New', monospace]'/share/fs/multimedia/Buffer/live-ITV2-1-1.ts'[/font][/color][color=#d4d4d4][color=#d4d4d4][font=Consolas, 'Courier New', monospace] is denied.[/font][/color][/color]
[color=#d4d4d4][font=Consolas, 'Courier New', monospace][color=#d4d4d4] ---> [/color][color=#ce9178][i]System.IO.IOException[/i][/color][color=#d4d4d4]: Permission denied[/color]
[color=#d4d4d4] --- End of inner exception stack trace ---[/color]
[color=#ce9178][i] at System.IO.FileStream.WriteNative(ReadOnlySpan`1 source)[/i][/color]
[color=#ce9178][i] at System.IO.FileStream.FlushWriteBuffer()[/i][/color]
[color=#ce9178][i] at System.IO.FileStream.WriteSpan(ReadOnlySpan`1 source)[/i][/color]
[color=#ce9178][i] at System.IO.FileStream.Write(Byte[] array, Int32 offset, Int32 count)[/i][/color]
[color=#ce9178][i] at NShared.Writer.OutputSink.Write(Byte[] data, Int32 offset, Int32 length)[/i][/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.945[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] StopStream([/color][color=#569cd6]1572865[/color][color=#d4d4d4])...[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.945[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] clientHandle[[/color][color=#569cd6]0fdfb396-392b-45a5-8bea-40c8eff81ba2[/color][color=#d4d4d4]] = [/color][color=#569cd6]1572865[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.945[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] Calling StopStream()[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.951[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] StopStream([/color][color=#569cd6]1[/color][color=#d4d4d4])[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.952[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] StopStream handle: [/color][color=#569cd6]1[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.953[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] Closing TSWriter....: LIVE&/share/fs/multimedia/Buffer/live-[/color][color=#569cd6]ITV2-1-1.ts[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.956[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]16[/color][color=#d4d4d4]] [/color][color=#569cd6]writer.Close[/color][color=#d4d4d4]() failed: [/color][color=#ce9178][i]System.UnauthorizedAccessException[/i][/color][color=#d4d4d4]: Access to the path [/color][color=#ce9178]'/share/fs/multimedia/Buffer/live-ITV2-1-1.ts'[/color][color=#d4d4d4] is denied.[/color]
[color=#d4d4d4] ---> [/color][color=#ce9178][i]System.IO.IOException[/i][/color][color=#d4d4d4]: Permission denied[/color]
[color=#d4d4d4] --- End of inner exception stack trace ---[/color]
[color=#ce9178][i] at System.IO.FileStream.WriteNative(ReadOnlySpan`1 source)[/i][/color]
[color=#ce9178][i] at System.IO.FileStream.FlushWriteBuffer()[/i][/color]
[color=#ce9178][i] at System.IO.FileStream.Dispose(Boolean disposing)[/i][/color]
[color=#ce9178][i] at System.IO.Stream.Close()[/i][/color]
[color=#ce9178][i] at NShared.Writer.OutputSink.<Close>b__23_0()[/i][/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.956[/color] [color=#ce9178][b][ERROR][/b][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] [/color][color=#569cd6]writer.Close[/color][color=#d4d4d4]() did not complete in a timely fashion[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.956[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] Close@[/color][color=#569cd6]2[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.956[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] deleting /share/fs/multimedia/Buffer/live-[/color][color=#569cd6]ITV2-1-1.ts.map[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.962[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] Close@exit[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.962[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] StopStream@exit[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.987[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] stopping graph[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.987[/color] [color=#569cd6][DEBUG][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] destroying graph[/color]
[color=#6a9955]2022-08-14[/color] [color=#6a9955]16:45:46.987[/color] [color=#b5cea8][INFO][/color][color=#d4d4d4][[/color][color=#569cd6]21[/color][color=#d4d4d4]] Stopped[/color][/font][/color]
This reads to me that there is a problem writing to the buffer folder, however if I log on to the docker container and try to write a test file as the same user as NPVR it is sucessful
Code:
root@local-nextpvr:/share/fs/multimedia# ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.9 1.3 23357400 220012 ? Ssl 16:42 0:05 dotnet /app/NextPVRServer.dll
root 188 0.0 0.0 19572 3436 pts/1 Ss 16:47 0:00 /bin/bash
root 341 0.0 0.0 34408 2860 pts/1 R+ 16:51 0:00 ps aux
root@local-nextpvr:/share/fs/multimedia# ls
@Recently-Snapshot @Recycle Audio Books Buffer Pictures Samples Video
root@local-nextpvr:/share/fs/multimedia# cd Buffer/
root@local-nextpvr:/share/fs/multimedia/Buffer# echo >live-ITV2-1-1.ts hello
root@local-nextpvr:/share/fs/multimedia/Buffer# ls
live-ITV2-1-1.ts
My question is, if the container user can write to the folder, but NPVR cannot, what is the problem, or what can I do to get more information as I have run out of ideas on how to troubleshoot
Thanks
Paul