DVR Engine doesn't restart

Help and support for HDHomeRun DVR and HDHomeRun software for Windows 10, Mac, Android, XBox, etc.
jdcuartero
Posts: 11
Joined: Tue Jun 25, 2019 1:58 am
Device ID: 1250FE42

Re: DVR Engine doesn't restart

Post by jdcuartero » Thu Jun 27, 2019 12:56 am

My DeviceID: 1250FE42

I have been thinking about trying a different thing ...

Once the NAS is running (after 30min from the boot) ... I went to the Dashboard and I manually stopped the Engine by clicking the "stop" button.

Then I went to the Synology Package Center and I stopped the spk (HDHomeRunDVR Manager 0.7.0).

After a while ... I went to the Synology Package center, again, and I start the spk (HDHomeRunDVR Manager 0.7.0). By doing this I supposed that the Engine should start automatically. But I got the same result ...

So it is not only when the NAS restarts ... it also happens when you stop running the spk and then start it again.

I know it is not the best solution, but maybe It could be a temporary solution. Do you know how to write a script that can call to the Engine (like the Dashboard does) so ... first it stops the engine and then starts it again?

At Synology there is an option to create a task in the Task Scheduler. So we can run an "user defined script". By this way you can schedule a task that can be run every day, for instance, 10 min later than the primary task that boots the NAS. Maybe this can work. But I don't know how to write this kind of script.

These are the steps ...

1. Enter the name of the task and then you can select the type of user (root, admin or a particular user) is going to run the task. This is useful for the permissions. We can choose "root" in order to ensure you will have all permissions to run the script.
2. Schedule the task. Here we will select "daily". And we can choose the time for the first run. In my case I can choose 09:10am in order to ensure the script will be run once the NAS has all the processes running ok. You can also choose if there is any frequency to run the script (in our case we will select "every day"). And regarding to the "Last run time" ... we will keep the same as for the run (9:10am)
3. Under the "Task settings" tab ... we can write the script to run. And even we can configure an email just for the case the script terminates abnormally. But the script ... I am so sorry I don't know how to write it.

Image

Image

Image

Image

Another thing I have been thinking about ... is it possible that the new HdHomeRecord Release 20190621 has caused this? Is there any way to downgrade the HdHomeRecord to the Release 20190417 or to any other previous version? I have been thinking about this because as I can remember ... I have no problems with the 0.6.9 spk and Record Release 20190417. The problems started after upgrading the same day to the 0.7.0 spk and the Record to the Release 20190621 (the record was updated through my.hdhomerun.com)

And today when I am trying to downgrade to 0.6.9 or any other previous version ... the problem is not solved because the Record is still kept at the Release 20190621.

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Thu Jun 27, 2019 10:37 am

jdcuartero wrote:
Thu Jun 27, 2019 12:56 am
After a while ... I went to the Synology Package center, again, and I start the spk (HDHomeRunDVR Manager 0.7.0). By doing this I supposed that the Engine should start automatically. But I got the same result ...
Interesting...
I observed something recently here as well where the 'stop' failed to the engine and the engine didn't clean itself up and caused what u saw below
And today when I am trying to downgrade to 0.6.9 or any other previous version ... the problem is not solved because the Record is still kept at the Release 20190621.
I wonder if this might be the cause.
Let me play around today.
I know it is not the best solution, but maybe It could be a temporary solution. Do you know how to write a script that can call to the Engine (like the Dashboard does) so ... first it stops the engine and then starts it again?
could add step to start script to request stop before start.
No harm - the engine will either reject because it's not started..
But not sure it will fix it :(
Another thing I have been thinking about ... is it possible that the new HdHomeRecord Release 20190621 has caused this? Is there any way to downgrade the HdHomeRecord to the Release 20190417 or to any other previous version? I have been thinking about this because as I can remember ... I have no problems with the 0.6.9 spk and Record Release 20190417. The problems started after upgrading the same day to the 0.7.0 spk and the Record to the Release 20190621 (the record was updated through my.hdhomerun.com)
Is possible..
But trying to determine which one will be tricky.. If you can go back to old one and it's all good.. then we have a valid point showing that it's working.
Next is trying to determine what is going on with the bad one.
And today when I am trying to downgrade to 0.6.9 or any other previous version ... the problem is not solved because the Record is still kept at the Release 20190621.
I observed this recently too.. but shrugged it off.
Was when I upgraded to 20190621 the engine reported being the previous beta version.
When I stopped engine and started again it was ok.
It worked so I never went back.. I will try again today.. My suspicion on this one is that the engine didn't clean itself up properly. When you execute the engine it decompresses the real binary into /tmp and then executes that.. So my theory is that didn't get deleted, and subsequent start reused it and didn't update to the new one.
You could be experiencing the same in downgrading.
And if this is happening - could be causing other issues.

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Thu Jun 27, 2019 10:51 am

Good News - I can repeat your problem perfectly on my system now :)
Bad News - still don't know why..

jdcuartero
Posts: 11
Joined: Tue Jun 25, 2019 1:58 am
Device ID: 1250FE42

Re: DVR Engine doesn't restart

Post by jdcuartero » Thu Jun 27, 2019 11:41 am

Thank you demonrik.

So I am not crazy or at least not as crazy. :D

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Thu Jun 27, 2019 11:49 am

I had it repeating consistently with stop/start from package center - but now no longer - works perfect every time
even a restart doesn't cause it to fail.
I'm at a loss.

jdcuartero
Posts: 11
Joined: Tue Jun 25, 2019 1:58 am
Device ID: 1250FE42

Re: DVR Engine doesn't restart

Post by jdcuartero » Thu Jun 27, 2019 11:28 pm

Well, I have good news.

The NAS Booth up and the engine started Ok.

When I installed the spk the first time I had problems to reveal the default record path. Even after of giving the right permissions (running the commands you explain al the tutorial) I couldn’t create the path through the Synology Share Folder. I got an error. This was the reason while I was using a different folder for the record path.

Well, yesterday I tried a different thing.
- I stopped the spk at the Package center
- I run winscp under Windows. I accessed to the NAS file system and I removed the HDHomeRunDVD folder located at volume1. Otherwise it has been not posible because this folder is hidden at the Synology Share Folder and at the Synology File Station.
- I uninstalled the spk.
- I restarted the NAS.
- Before installing again the spk ... I went to the Synology Share folder and I created the folder HDHomeRunDVR, according to the permissions from your tutorial. And now it has been possible to create it without error.
- I installed the 0.7.0 spk

The engine started ok when the spk started after the installation.

And today ... after the NAS has been restarted (according to the saving schedule program) ... the engine works ok. There is no DVR Failure message. And it has been not needed to stop and restart the engine through the Dashboard.

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Fri Jun 28, 2019 10:24 am

Glad you're now working reliably

I doubt those changes made any difference though..
Suspicious that it's mysteriously resolved around same time as I couldn't reproduce.
I wonder if there is some corner case bug in the engine that was occurring and the conditions have changed such that it doesn't trigger.

If it happens again, then repost. In meantime I will see if I can add some additional debug steps to the start script to check a few things before starting the engine - at a min I'm going to check is the record path writable before the engine starts.
That way at least we can rule in/out the engine vs the NAS.

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Sat Jun 29, 2019 3:51 pm

I added some prechecks to the startup script for synology.
Will first check if the recordpath exists..
Then attempt to write a file to that folder as the user selected.
Hopefully if things go wrong you can check /tmp/hdhr_arch_choice and see where it's failing

jdcuartero
Posts: 11
Joined: Tue Jun 25, 2019 1:58 am
Device ID: 1250FE42

Re: DVR Engine doesn't restart

Post by jdcuartero » Sun Jun 30, 2019 3:11 pm

Ok, thank you demonrik for the update.

By the moment ... the engine is starting OK when the NAS boots up.

demonrik
Posts: 1127
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: DVR Engine doesn't restart

Post by demonrik » Thu Jul 11, 2019 9:57 pm

following up on this.

DSM update yesterday.
Applied and restarted today around 5:25pm MST (yes MST - am in AZ)
it started the engine but no writing, and no recording..
Engine looks like everything is running - status is running, but it's not updating logs or anything.
am sure SD is seeing a report saying it can't write (@jasonl might confirm), however locally there is no way to tell

I look at my prechecks and there was an issue that on start I couldn't write (touch) a precheck to the RecordPath

Code: Select all

    $hdhr_bin_path/$hdhr_wrap -u $hdhr_user -b /bin/touch -- ${RecordPath}/precheck
    if [[ -w ${RecordPath}/precheck ]] ; then
    ....
    else
      echo "Something went wrong creating ${RecordPath}/precheck " >> $hdhr_arch_log
    fi
So 2 issues I see.
a) something in latest DSM has the engine starting before we can write to folder.. need to investigate if I can build a dependency
b) The engine keeps running even when it cant do anything... and because it cant write to logs we've no way to know its off in the weeds. @jasonl would be better if engine didn't start in this case and exit with error... then i could build start script to retry until permissions are right

still working it... synology only so far

Post Reply