Kodi Community Forum

Full Version: Intermittent access errors when scheduling/starting recording
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Have Kodi 17 on Windows, accessing TVH 4.2 on a RPi, with HDHomerun tuners.
Intermittently, I can't schedule a recording from Kodi. It fails with (from the log file):

17:41:23.883 T:8852 ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command addDvrEntry failed: User does not have access
17:41:23.883 T:8852 ERROR: PVR - PVR::CPVRClient::AddTimer - addon 'Tvheadend:ariel:9982' returned an error: server error
17:41:23.883 T:8852 ERROR: PVR - PVR::CPVRClients::AddTimer - cannot add timer to client '1924689120': server error

Strangely, this only happens on some channels - at exactly the same time I can schedule a recording from another channel. The error seems specific to the channel. There are 4 tuners in all, so there are plenty of them.
What gives here?
I see exactly the same issue running Kodi 18. Have spent hours trying to get to the bottom of it. Seems like issue has been reported in other threads over last year or so with no resolution.

I also run the Kodi branch for Apple TV and iOS devices MrMc and have the same issues. Also have setup 2 Tvheadend servers and issue the same in both.  Only seems to be related with starting an instant recording, not a timer (Autorec) recording.

Seems to be just a Kodi issue. Can schedule fine in Tvheadend directly, or via the iOS or Android app.

Now I just have to schedule recordings using the Tvheadend apps. Have tried on both on iOs and Android and work fine. 


 
(2019-04-11, 10:10)aegidius Wrote: [ -> ]Have Kodi 17 on Windows, accessing TVH 4.2 on a RPi, with HDHomerun tuners.
Intermittently, I can't schedule a recording from Kodi. It fails with (from the log file):

17:41:23.883 T:8852 ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command addDvrEntry failed: User does not have access
17:41:23.883 T:8852 ERROR: PVR - PVR::CPVRClient::AddTimer - addon 'Tvheadend:ariel:9982' returned an error: server error
17:41:23.883 T:8852 ERROR: PVR - PVR::CPVRClients::AddTimer - cannot add timer to client '1924689120': server error

Strangely, this only happens on some channels - at exactly the same time I can schedule a recording from another channel. The error seems specific to the channel. There are 4 tuners in all, so there are plenty of them.
What gives here?
Tvheadend servers says "user does not have access".

For me, this sounds like you have to fix the access rights configuration for your tvheadend server. ;-)
(2019-05-27, 10:32)ksooo Wrote: [ -> ]Tvheadend servers says "user does not have access".

For me, this sounds like you have to fix the access rights configuration for your tvheadend server. ;-)

It sounds like it, but I don't think it is the case.

The issue is completely intermittent and across all channels in the guide but at different times. I attempt to record a show through Kodi that is currently airing and it may or may not work and throws this error. If it doesn't work and I can usually wait till next show rolls over, and then it will probably work. The user account also has full admin permissions. I can schedule series recordings or future shows straight out of the guide in Kodi and works without issue, so I don't think permissions are an issue.

I'm confident there is a glitch in the integration with Kodi and Tvheadend somewhere and it's related to the data in the guide in some way. I suspect it is some kind of missing or problem id data that is used to tell TvHeadend which show to record. It's not passed across properly and Tvheadend isn't able to match against the right show. Probably manifesting incorrectly as an access denied error, if Tvheadend working with corrupted data.

I've given up trying to schedule recordings now through Kodi as just too hit and miss. Just using the Tvheadend app instead which works ok, but would be great to find a solution as has been raised a few times in the past with no resolution.
Not likely to be access rights - I can schedule a recording most of the time but intermittently it fails. If it fails I can go to another channel and it works.
I have been seeing the same thing for a long while. It doesn't bother me because I schedule via the web interface. It bothers my wife but she puts up with it but I put an identical system into my technically challenged parents place and it bothers them, hence i am now looking at it after a long while :-(

@ksooo I have the same situation as OP.

Kodi on mixed clients Windows & Libreelec (PI and x86) to TVH server over wired Gig-E. Scheduling recordings via the TVH webpage works with 100% success rate. Instant recording via the Kodi interface works with anecdotally 50% success rate. I am sure that scheduling guide based recordings in the future work fine as does time-shifting via the Kodi interface. Deleting recordings from Kodi works fine too.

Today I started experimenting trying to localise it.
 
  • First thing I did was use a windows Kodi client and deleted the Kodi directory to start fresh - deleted everything in \AppData\Roaming\Kodi\
  • I then installed the TVH addon, configured it with the server address, username and password only and tested it.
  • Voila, 100% success rate on instant recordings.

Much to my surprise it worked every time.  Note, the process I take is - switch to channel, see video then press the record button on GUI for this test, but usually via the IR remote. In this case time-shifting is enabled but I haven't used the time-shift buffer in Kodi for these tests.

I then compared my old pvr.hts settings.xml file in \AppData\Roaming\Kodi\userdata\addon_data\pvr.hts looking for deltas between my standard configuration. This standard config is set the same on all clients and it is set using the addon GUI in each case.

I found the following diffs in pvr.hts.

Original:
<setting id="autorec_approxtime" default="true">0</setting>
<setting id="pretuner_enabled">true</setting>
<setting id="total_tuners">5</setting>

Fresh:
<setting id="autorec_approxtime">1</setting>
<setting id="pretuner_enabled" default="true">false</setting>
<setting id="total_tuners">2</setting>

I have 6 tuners available.

I changed one line at a time starting with autorec_approxtime. Starting Kodi and then attempting to play, then instant record.  I found that when pretuner_enabled was set to true, it would fail with the usual frequency. If i set it back to false, instant recording would work as expected. I never changed total_tuners in the new file, because pretuner_enabled caused the issue.

The kodi error log says similar error entries as the OP with the "User does not have access" note. The rights for the user are okay many recordings work so I would agree, I don't think access rights are the root of the issue.

2019-08-29 16:07:33.951 T:12824   ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command addDvrEntry failed: User does not have access
2019-08-29 16:07:33.951 T:12824   ERROR: PVR::CPVRClient::AddTimer: Add-on 'Tvheadend:14.78.3.1:9982' returned an error: server error

I have taken logs from Kodi for Good and for Bad (i.e. when it failed). I have also taken snips of the tvh debug log too.

Process is:
  1. Start Kodi
  2. Switch to ABC (failed on bad log)
  3. Press instant record
  4. Stop instant record
  5. Switch to SBS
  6. Press instant record (worked on both bad and good log)
  7. Try record ABC from guide (failed on bad log)
  8. Exit kodi and copy off log file.
I repeated the same for both good and bad.

Good Kodi Log: voxomaxaki.kodi (paste)
Good TVH Log: yajatewojo (paste)
Good settings.xml: duraxocavi (paste)

Bad Kodi Log: ujunatejun.kodi (paste)
Bad TVH Log: cexakekowo (paste)
Bad settings.xml: fowoviqaja (paste)

Kodi Ver : 18.3 Git:20190619-89472b7d69
Tvheadend HTSP Client Ver: 4.4.18
Tvheadend server version: 4.2.8-31~g0a60f73

 @aegidius and @krammcc  if you change the setting in your Kodi addon under Streaming settings "Use predictive tuning to speedup channel switches" from on to off do your instant records start working? If it is already, off then this is a hint only...

Cheers
CV8R
(2019-08-29, 09:18)CV8R Wrote: [ -> ]I have been seeing the same thing for a long while. It doesn't bother me because I schedule via the web interface. It bothers my wife but she puts up with it but I put an identical system into my technically challenged parents place and it bothers them, hence i am now looking at it after a long while :-(

@ksooo I have the same situation as OP.

Kodi on mixed clients Windows & Libreelec (PI and x86) to TVH server over wired Gig-E. Scheduling recordings via the TVH webpage works with 100% success rate. Instant recording via the Kodi interface works with anecdotally 50% success rate. I am sure that scheduling guide based recordings in the future work fine as does time-shifting via the Kodi interface. Deleting recordings from Kodi works fine too.

Today I started experimenting trying to localise it.
 
  • First thing I did was use a windows Kodi client and deleted the Kodi directory to start fresh - deleted everything in \AppData\Roaming\Kodi\
  • I then installed the TVH addon, configured it with the server address, username and password only and tested it.
  • Voila, 100% success rate on instant recordings.

Much to my surprise it worked every time.  Note, the process I take is - switch to channel, see video then press the record button on GUI for this test, but usually via the IR remote. In this case time-shifting is enabled but I haven't used the time-shift buffer in Kodi for these tests.

I then compared my old pvr.hts settings.xml file in \AppData\Roaming\Kodi\userdata\addon_data\pvr.hts looking for deltas between my standard configuration. This standard config is set the same on all clients and it is set using the addon GUI in each case.

I found the following diffs in pvr.hts.

Original:
<setting id="autorec_approxtime" default="true">0</setting>
<setting id="pretuner_enabled">true</setting>
<setting id="total_tuners">5</setting>

Fresh:
<setting id="autorec_approxtime">1</setting>
<setting id="pretuner_enabled" default="true">false</setting>
<setting id="total_tuners">2</setting>

I have 6 tuners available.

I changed one line at a time starting with autorec_approxtime. Starting Kodi and then attempting to play, then instant record.  I found that when pretuner_enabled was set to true, it would fail with the usual frequency. If i set it back to false, instant recording would work as expected. I never changed total_tuners in the new file, because pretuner_enabled caused the issue.

The kodi error log says similar error entries as the OP with the "User does not have access" note. The rights for the user are okay many recordings work so I would agree, I don't think access rights are the root of the issue.

2019-08-29 16:07:33.951 T:12824   ERROR: AddOnLog: Tvheadend HTSP Client: pvr.hts - Command addDvrEntry failed: User does not have access
2019-08-29 16:07:33.951 T:12824   ERROR: PVR::CPVRClient::AddTimer: Add-on 'Tvheadend:14.78.3.1:9982' returned an error: server error

I have taken logs from Kodi for Good and for Bad (i.e. when it failed). I have also taken snips of the tvh debug log too.

Process is:
  1. Start Kodi
  2. Switch to ABC (failed on bad log)
  3. Press instant record
  4. Stop instant record
  5. Switch to SBS
  6. Press instant record (worked on both bad and good log)
  7. Try record ABC from guide (failed on bad log)
  8. Exit kodi and copy off log file.
I repeated the same for both good and bad.

Good Kodi Log: voxomaxaki.kodi (paste)
Good TVH Log: yajatewojo (paste)
Good settings.xml: duraxocavi (paste)

Bad Kodi Log: ujunatejun.kodi (paste)
Bad TVH Log: cexakekowo (paste)
Bad settings.xml: fowoviqaja (paste)

Kodi Ver : 18.3 Git:20190619-89472b7d69
Tvheadend HTSP Client Ver: 4.4.18
Tvheadend server version: 4.2.8-31~g0a60f73

 @aegidius and @krammcc  if you change the setting in your Kodi addon under Streaming settings "Use predictive tuning to speedup channel switches" from on to off do your instant records start working? If it is already, off then this is a hint only...

Cheers
CV8R


Could you give a recent Kodi 19 nightly build a go? It comes with both, fixes in Kodi core and the tvh addon.
I tested 19.0-ALPHA1 Git:20190829-8671745740 and with the pretuner_enabled = false and a fresh install it failed to record on the first channel, then the next channel was okay. This negates my conclusion from yesterday. I went back and tested the old clients and today I can make it fail with pretuner_enabled = false.

Very frustrating :-(

One of my Kodi installs hadn't upgraded the TVH addon for some time (i cannot recall the version but it was old) and it was failing today.  I upgraded to the tvh addon to 4.4.18 and the first ~5 instant records worked but then it failed again.

So other than confirming that some recordings work as expected others do not and that a fresh install still suffers random record failures and that pretuner_enabled appears unrelated - i am nowhere. It does appear to affect the same channels each session but each day i've tried the problem seams to move to other channels - no evidence to support this theory. 

Yesterday it was working fine with this change and today it isn't which makes me wonder if it is somehow linked to guide data.

CV8R
What is your "instant recording action" settings value? Does it make a difference if you change this from "current show" to "fixed time" (actual names may be slightly different, no Kodi avail atm to look up the actual name).
Also, please note, if you watch time shifted and you then start an instant recording, Tvheadend will start the recording at the current live position, not at the current ts buffer location. There is nothing Kodi can do about that behavior. There is a long standing issue open for tvheadend, but no dev found the time to implement/fix that it seems.

Could your problems be related to that?
It's set to Record current show (if guide data available).

I changed it to Record for a fixed period of time (Instant recording duration) with the instant recording duration set at default 120min and did 20 instant records without failure.

Changed it back to Record current show (if guide data available) and it failed on the very first instant record with the same log entries failed: User does not have access and returned an error: server error.

Note: there was guide data available.

See linkied images - Interesting that the recordings that failed were on Mary Berry's Fool both ABC and ABC HD and on Playschool on ABC Comedy/kids.  I thought the programs that went further into their duration's such as Millionaire, The Chase and 10 News although worked as expected for testing showed it wasn't related.  However, at the moment only the ABC channels are failing.  I have exported the epg to xml if that helps.

https://drive.google.com/file/d/1rCfiQlG...XRC_58D9RG
https://drive.google.com/file/d/1lBwFKlu...svsB3q0jKm

Guide data: https://drive.google.com/file/d/14E8-G4G...px1jzmIOif

Cheers,

CV8R
(2019-08-30, 09:44)CV8R Wrote: [ -> ]It's set to Record current show (if guide data available).

I changed it to Record for a fixed period of time (Instant recording duration) with the instant recording duration set at default 120min and did 20 instant records without failure.

Changed it back to Record current show (if guide data available) and it failed on the very first instant record with the same log entries failed: User does not have access and returned an error: server error.

Note: there was guide data available.

See linkied images - Interesting that the recordings that failed were on Mary Berry's Fool both ABC and ABC HD and on Playschool on ABC Comedy/kids.  I thought the programs that went further into their duration's such as Millionaire, The Chase and 10 News although worked as expected for testing showed it wasn't related.  However, at the moment only the ABC channels are failing.  I have exported the epg to xml if that helps.

https://drive.google.com/file/d/1rCfiQlG...XRC_58D9RG
https://drive.google.com/file/d/1lBwFKlu...svsB3q0jKm

Guide data: https://drive.google.com/file/d/14E8-G4G...px1jzmIOif

Cheers,

CV8R
I cannot see anything suspicious in the guide data xml when comparing the failing channels with the not failing channels, sorry.
CV8R
[/quote]
I cannot see anything suspicious in the guide data xml when comparing the failing channels with the not failing channels, sorry.
[/quote]

So where to from here? Should I log a defect somewhere?
(2019-08-30, 22:57)CV8R Wrote: [ -> ]CV8R


I cannot see anything suspicious in the guide data xml when comparing the failing channels with the not failing channels, sorry.
[/quote]

So where to from here? Should I log a defect somewhere?
[/quote]

Not easy to answer as it is not clear where the problem lies. It could be everywhere from tvheadend, Kodi, or Kodi tvh addon code bug to some configuration/data error on your end.
I captured the messages using wireshark and dumped them to text file to see if this helps.

Short with recording that failed and one that worked. yamarukuhe (paste)

Long with a few that worked and failed. ixuqasusaw (paste)

I have the guide data from this period too, but the xml extract from TVH doesn't have event id's or anything in it.  I need to figure a way to get access to the raw EPG OTA data.

Edit: I just tried a forced grab to update the EPG in TVH and then stopped and started the tvh addon. The programs that were failing now work. I was able to schedule a recording on every channel without failure. I will leave it go a few hours, wait for programs to fail and then stop/start the addon again.
Pages: 1 2