unofficial Docker Container for Record Engine

Downloads & Instructions
Post Reply
DornoDios
Posts: 76
Joined: Sat Dec 12, 2020 9:33 pm
Device ID: 107C3D26
x 3

Re: unofficial Docker Container for Record Engine

Post by DornoDios »

I just noticed that nothing has recorded since the end of February. The news is set to record on two different channels every night at 6:30pm. The last time anything recorded was February 28th.

I tried to start a manual recording and it would not work. I was able to timeshift and watch the channel live via Kodi and the HDHR app, but it would not record the show.

I went into DSM and I restarted the docker container. Everything began working correctly after doing that. I was able to set a recording of a show in progress and a scheduled recording for a show at 7pm began recording as well. Do you have any idea what may have caused this?

As always, thanks for your time!

Code: Select all

The last "Recording: event download success" & "Recorded: recorded sync success" messages were at 20220228-21:34:19 which is 15:34:19 local time.
So my theory of it being related to the end of February appears to be incorrect.
No idea what happened that caused events to no longer occur after that time. There was no loss in internet access.
Edit: I did a quick update of my NAS after I reset the container, but before checking if things worked. The update didn't restart the NAS and only took about 30-45 seconds. It did reset the SMB service and possibly the webserver so that may be the reason things began working. In the logs it appears it began working after I reset the container and then stopped and started after/while updating the NAS. I'm still on DSM 6.x.5.
Last edited by DornoDios on Thu Mar 03, 2022 3:21 pm, edited 1 time in total.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

DornoDios wrote: Wed Mar 02, 2022 6:05 pm I just noticed that nothing has recorded since the end of February. The news is set to record on two different channels every night at 6:30pm. The last time anything recorded was February 28th.

I tried to start a manual recording and it would not work. I was able to timeshift and watch the channel live, but it would not record.

I went into DSM and I stopped and then started the docker container. Everything began working correctly after doing that. I was able to set a recording of a show in progress and a scheduled recording for a show at 7pm began recording as well.

I just wanted to mention this as I don't know what the cause of the error was.

If there's any info I can provide let me know. As always, thanks for your time!

Code: Select all

I noticed in the log file for 3-1-22 that the last instance of "recording" showed up at 3:01AM which is actually 9PM 2-28-22 local time.
After that there were no more instances of the word "recording" in the log files until I reset the container just prior to making this post.
Edit: I did a quick update of my NAS after I reset the container, but before checking if things worked. The update didn't restart the NAs, but it resets SMB and probably the webserver so it's possible that is the reason things began working. I didn't think of that initially.
strange
when you started a manual recording and it failed - it would be good to see the log around that time to see if it even saw the event, and/or did it fail to get a tuner, and/or did it have difficulty writing out the file.
Similarly in the logs around the news at 6:30pm (or 00:30am UTC in the logs).
I'm assuming the logs were still being updated all along and the engine was running - so suggests something else prevented it from doing its job and we need to see why :)

DornoDios
Posts: 76
Joined: Sat Dec 12, 2020 9:33 pm
Device ID: 107C3D26
x 3

Re: unofficial Docker Container for Record Engine

Post by DornoDios »

I haven't had any problems aside from that one time. Obviously there was nothing of significance that you could find in the log files.

I think it was probably related to an issue with my internet connection and/or router. The docker record engine is completely reliable and I haven't encountered a single issue going forward.

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

It's back!
Updated version of the container is now live on dockerhub https://hub.docker.com/r/demonrik/hdhrdvr-docker

Apologies for the 2yr delay in doing any updates - but then again - yay it's been solidly working for 2 years :)

Main update at this point is to add the DVR Manager UI I had in the NAS packages to the container.
It's mostly working - but does have an issue with parsing the log files that I will work on next.
To this, I've had to rework the container to add NGINX and PHP which is working nicely

Heads up to existing installs and updating
This version of the container will run the record engine with a UID of 1000
In next version I will allow you to change this to a UID of your own - just didn't make it into this weeks drop
So before you panic - you will need to
  1. stop the container
  2. chown all the recordings in /dvrrec to UID 1000
  3. and for safety the files in /dvrdata to UID 1000
  4. then start the container and should be good.
Known Issues
  • the log file reading causes an error
  • the RunAs field in the config is not used at this time
Next things on my todo list in priority order
1. Fix the log file parsing
2. Add the uid/gid overrides
3. Add ARM builds for armv7 and arm64

Once these are done I plan to start another project which will be to build this out more with the DVRUI and other features integrated. Will be a more complete 'management' solution which includes the engine - but no client.

fwiw - I know I've been delinquent on updating, and apologies on that.
Have now established some good time management for myself, a scalable dev/test environment, and hope to have a more regular beat rate of updates in coming weeks/months.

Jsherman
Posts: 180
Joined: Mon Jul 20, 2015 1:59 am

Re: unofficial Docker Container for Record Engine

Post by Jsherman »

demonrik wrote: Thu May 12, 2022 12:46 pm [*]chown all the recordings in /dvrrec to UID 1000
[*]and for safety the files in /dvrdata to UID 1000
[*]then start the container and should be good.
[/list]
To be clear, to perform the chown command we just need to do the following for both directories?

chown 1000 <config_folder>
chown 1000 <recorded_TV_Folder>

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

Jsherman wrote: Sat May 14, 2022 2:39 am
demonrik wrote: Thu May 12, 2022 12:46 pm [*]chown all the recordings in /dvrrec to UID 1000
[*]and for safety the files in /dvrdata to UID 1000
[*]then start the container and should be good.
[/list]
To be clear, to perform the chown command we just need to do the following for both directories?

chown 1000 <config_folder>
chown 1000 <recorded_TV_Folder>
Don't forget the -R to apply to all files, i.e. chown -R 1000 ...
Once I have the UID/GID thing working again it'll default back to nobody, but this is first step of the plumbing, and I didn't want to wait to get this update out.

Jsherman
Posts: 180
Joined: Mon Jul 20, 2015 1:59 am

Re: unofficial Docker Container for Record Engine

Post by Jsherman »

demonrik wrote: Sat May 14, 2022 7:17 am
Jsherman wrote: Sat May 14, 2022 2:39 am
demonrik wrote: Thu May 12, 2022 12:46 pm [*]chown all the recordings in /dvrrec to UID 1000
[*]and for safety the files in /dvrdata to UID 1000
[*]then start the container and should be good.
[/list]
To be clear, to perform the chown command we just need to do the following for both directories?

chown 1000 <config_folder>
chown 1000 <recorded_TV_Folder>
Don't forget the -R to apply to all files, i.e. chown -R 1000 ...
Once I have the UID/GID thing working again it'll default back to nobody, but this is first step of the plumbing, and I didn't want to wait to get this update out.
Thank you for that! I am new to Linux / Docker. so this command would need to be ran on the /mnt/user path, correct?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

Jsherman wrote: Sat May 14, 2022 1:08 pm
demonrik wrote: Sat May 14, 2022 7:17 am
Jsherman wrote: Sat May 14, 2022 2:39 am

To be clear, to perform the chown command we just need to do the following for both directories?

chown 1000 <config_folder>
chown 1000 <recorded_TV_Folder>
Don't forget the -R to apply to all files, i.e. chown -R 1000 ...
Once I have the UID/GID thing working again it'll default back to nobody, but this is first step of the plumbing, and I didn't want to wait to get this update out.
Thank you for that! I am new to Linux / Docker. so this command would need to be ran on the /mnt/user path, correct?
Actual paths will depend on your mappings.
When you set up the container you will have mapped the /dvrrec and /dvrdata mounts to something.
For UnRAID /mnt/user/... sounds about right. But do the chown on the specific folder (e.g. my /dvrrec is mapped to /mnt/user/Media/Recordings/), NOT on /mnt/user as you might impact other apps/data.

Jsherman
Posts: 180
Joined: Mon Jul 20, 2015 1:59 am

Re: unofficial Docker Container for Record Engine

Post by Jsherman »

Actual paths will depend on your mappings.
When you set up the container you will have mapped the /dvrrec and /dvrdata mounts to something.
For UnRAID /mnt/user/... sounds about right. But do the chown on the specific folder (e.g. my /dvrrec is mapped to /mnt/user/Media/Recordings/), NOT on /mnt/user as you might impact other apps/data.
Sounds good! Thank you for all of your help!
Last edited by jasonl on Sun May 15, 2022 1:23 pm, edited 1 time in total.
Reason: fix quote tag

TBlankenheim
Posts: 101
Joined: Wed May 27, 2015 9:15 am
Device ID: 107BBE13, 10782AED
Location: Madison, WI
x 2

Re: unofficial Docker Container for Record Engine

Post by TBlankenheim »

Any plans to provide the ability to specify the WebUI port to avoid potential conflicts with other Docker containers?

Thx!

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

TBlankenheim wrote: Sun May 15, 2022 10:30 pm Any plans to provide the ability to specify the WebUI port to avoid potential conflicts with other Docker containers?

Thx!
Good request. Adding it to list

AnalogBill
Posts: 22
Joined: Wed Aug 11, 2021 6:23 am
Location: Fort Wayne, Indiana

Re: unofficial Docker Container for Record Engine

Post by AnalogBill »

Progress: Installed Docker on Synology, container running, and see the record engine in /dvrdata. Nothing else happening.
Logs show the dvr engine attempts to start as user dvr, permission denied. Yep, dvr user doesn't exist.
Also: nginx: [emerg] 17272#17272: bind() to 0.0.0.0:80 failed (98: Address in use)
Details show no ports assigned. Stuck until I get a dvr user or understand the Portainer solution.
Suggestions?

demonrik
Posts: 1591
Joined: Mon May 04, 2015 10:03 am
Device ID: 108042A1, 10814D8E
x 38

Re: unofficial Docker Container for Record Engine

Post by demonrik »

AnalogBill wrote: Fri Jun 17, 2022 1:49 pm Progress: Installed Docker on Synology, container running, and see the record engine in /dvrdata. Nothing else happening.
Logs show the dvr engine attempts to start as user dvr, permission denied. Yep, dvr user doesn't exist.
Also: nginx: [emerg] 17272#17272: bind() to 0.0.0.0:80 failed (98: Address in use)
Details show no ports assigned. Stuck until I get a dvr user or understand the Portainer solution.
Suggestions?
You need to port map the ports on the container now that we have the DVR Manager in there.
Port 80 is already used by the NAS so it won't bind
Open the Network Ports Configuration/Setting and set the Host/Local Port to a free port on the NAS (e.g. 8080) and map to the container port 80 for TCP
Image
In future release you will be able to change the port of the DVR Manager

For the permissions issue you need to ensure a user with an ID of has write access to the data volumes
Best way on synology is to create a 'dvr' user then SSH to the NAS and edit the /etc/ passwd file
From
root:x:0:0::/root:/bin/bash
nobody:x:99:100:nobody:/:/bin/false
dvr:x:1231:100::/:/bin/false
To
root:x:0:0::/root:/bin/bash
nobody:x:99:100:nobody:/:/bin/false
dvr:x:1000:100::/:/bin/false
Again - plan to swap this around and let you map to any UID in the system.. but not there juet yet

AnalogBill
Posts: 22
Joined: Wed Aug 11, 2021 6:23 am
Location: Fort Wayne, Indiana

Re: unofficial Docker Container for Record Engine

Post by AnalogBill »

Created dvr user, edited /etc passwd, gave dvr user rw to both Docker and /volume1/HDHomerunDVR/dvrdata & /dvrrec .
Attempting to map ports got "Port settings are not required when using the same network as Docker host"
Maybe the problem is in my run command:

Code: Select all

docker run -d --name dvr \
  --restart=unless-stopped \
  --network host \
  -v /volume1/HDHomeRunDVR/tempdata:/dvrdata \
  -v /volume1/HDHomeRunDVR/recordings:/dvrrec \
  demonrik/hdhrdvr-docker
Thanks for your help.
Bill
UPDATE: removed the "--network host" and ran the run command again. Container showed bridge network, and I was able to map 8080:80
Opening my nas ip:8080 got the dvr mgr (almost) Error 500 and "unable to discover dvr version".
No StorageID in dvr.conf:
RecordPath=/HDHomeRunDVR/recordings
Port=59090
RecordStreamsMax=16
BetaEngine=1
Going to chown 1000 /dvrdata & /dvrrec next

Does this look right?
-rwxrwxrwx+ 1 dvr 1000 80 Jun 18 09:17 dvr.conf
-rwxrwxrwx+ 1 root root 556124 Jun 21 19:21 hdhomerun_record_rel

AnalogBill
Posts: 22
Joined: Wed Aug 11, 2021 6:23 am
Location: Fort Wayne, Indiana

Re: unofficial Docker Container for Record Engine

Post by AnalogBill »

Stuck with this error:
DVRMgr: ** Starting the DVR Engine as user dvr
ash: /HDHomeRunDVR/data/hdhomerun_record: Permission denied
2022-06-23 15:01:10,003 INFO exited: dvr (exit status 126; not expected)

Gotta be a permissions problem, but I'm not understanding where.
-rwxrwxrwx+ 1 dvr 1000 80 Jun 18 09:17 dvr.conf
---x------ 1 dvr 1000 1983318 Mar 3 13:39 hdhomerun_record

Post Reply