2025-02-03, 12:58 PM
(This post was last modified: 2025-02-04, 08:38 PM by homemaisonbaile.
Edit Reason: Putting solution in OP
)
The NextPVR backend service does not start the webserver at 8866, "http://server:8866/" is unavailable. The webserver also does not start on other ports that work with other PVR backends such as TVHeadEnd.
"Settings > System info > PVR backend" is greyed out when the NextPVR server is enabled.
The NextPVR Client immediately disables after attempting to enable as it cannot connect to the server.
I have gone as far as I can with debugging this myself, I can't figure out what the issue is here. Has anyone seen this before?
Device: Asus Chromebox 4
Motherboard: DUFFY
OS: LibreElec 12.0.2
Kodi version: 21.2.0
Log with debug mode enabled. PVR, webserver, and addons are in verbose:
https://paste.libreelec.tv/endless-dassie.log
Edit: Solution
An empty/junk key file was present in /storage/.aspnet/DataProtection-Keys. Removing the file and restarting the service resolved the issue.
Data Protection key locations on different systems:
Windows C:\Windows\System32\config\systemprofile\AppData\Local\ASP.NET\DataProtection-Keys or
C:\Users\%username%\appdata\Local\ASP.NET\DataProtection-Keys
Linux deb installer
/root/.aspnet/DataProtection-Keys/
Linux LibreElec
/storage/.aspnet/DataProtection-Keys
ASP .net looks in /storage/.aspnet/DataProtection-Keys for xmls files containing those keys. I am not sure why this keyfile was generated, it was created around the same time as the system was being set up along with NextPVR so I can't pinpoint a source.
Manually starting the service with ASPNETCORE_ENVIRONMENT=Development and curling the webserver pointed towards a .net XML issue.
Big thanks to Martin for all the help, and Sup for the debug suggestions and the app itself.
"Settings > System info > PVR backend" is greyed out when the NextPVR server is enabled.
The NextPVR Client immediately disables after attempting to enable as it cannot connect to the server.
I have gone as far as I can with debugging this myself, I can't figure out what the issue is here. Has anyone seen this before?
Device: Asus Chromebox 4
Motherboard: DUFFY
OS: LibreElec 12.0.2
Kodi version: 21.2.0
Log with debug mode enabled. PVR, webserver, and addons are in verbose:
https://paste.libreelec.tv/endless-dassie.log
Edit: Solution
An empty/junk key file was present in /storage/.aspnet/DataProtection-Keys. Removing the file and restarting the service resolved the issue.
Data Protection key locations on different systems:
Windows C:\Windows\System32\config\systemprofile\AppData\Local\ASP.NET\DataProtection-Keys or
C:\Users\%username%\appdata\Local\ASP.NET\DataProtection-Keys
Linux deb installer
/root/.aspnet/DataProtection-Keys/
Linux LibreElec
/storage/.aspnet/DataProtection-Keys
ASP .net looks in /storage/.aspnet/DataProtection-Keys for xmls files containing those keys. I am not sure why this keyfile was generated, it was created around the same time as the system was being set up along with NextPVR so I can't pinpoint a source.
Manually starting the service with ASPNETCORE_ENVIRONMENT=Development and curling the webserver pointed towards a .net XML issue.
Code:
## Manually start webserver with ASPNETCORE_ENVIRONMENT in development
systemctl stop service.nextpvr
cd /storage/.kodi/addons/service.nextpvr/nextpvr-bin
ASPNETCORE_ENVIRONMENT=Development NEXTPVR_DATADIR_USERDATA=/storage/.kodi/userdata/addon_data/service.nextpvr/config/ dotnet NextPVRServer.dll
## Curl webserver
C:\Users\admin>curl -v http://192.168.1.100:8866/
* Trying 192.168.1.100:8866...
* Connected to 192.168.1.100 (192.168.1.100) port 8866
> GET / HTTP/1.1
> Host: 192.168.1.100:8866
> User-Agent: curl/8.9.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/plain; charset=utf-8
< Date: Tue, 04 Feb 2025 09:26:42 GMT
< Server: Kestrel
< Transfer-Encoding: chunked
<
System.Security.Cryptography.CryptographicException: An error occurred while trying to encrypt the provided data. Refer to the inner exception for more information.
---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlReader.MoveToContent()
at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XElement.Load(Stream stream, LoadOptions options)
at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.ReadElementFromFile(String fullPath)
at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElementsCore()+MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.GetAllElements()
at Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.GetAllKeys()
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.CreateCacheableKeyRingCore(DateTimeOffset now, IKey keyJustAdded)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRingCore(DateTime utcNow, Boolean forceRefresh)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext)
at Microsoft.AspNetCore.Session.CookieProtection.Protect(IDataProtector protector, String data)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
HEADERS
=======
Accept: */*
Host: 192.168.1.100:8866
User-Agent: curl/8.9.1
* Connection #0 to host 192.168.1.100 left intact
Big thanks to Martin for all the help, and Sup for the debug suggestions and the app itself.