NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
1 2 3 4 5 … 34 Next »
NextPVR webserver not starting, prevents client from starting

 
  • 0 Vote(s) - 0 Average
NextPVR webserver not starting, prevents client from starting
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#1
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.

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.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,766
Threads: 954
Joined: May 2006
#2
2025-02-03, 01:50 PM (This post was last modified: 2025-02-03, 02:00 PM by mvallevand.)
I do see you disabling the service (not pvr.nextpvr) from the GUI

2025-02-03 13:31:05.356 T:1102 debug <general>: CAddonMgr: service.nextpvr disabled

so it might just need to be enabled

If not since it never ran let's reset defaults. Sinc you use ssh this is what to try

Code:
systemctl stop service.nextpvr
rm  .kodi/userdata/addon_data/service.nextpvr/config/*
systemctl start service.nextpvr
systemctl status service.nextpvr

# you can confirm if you'd like
ps -Af | grep nextpvr
#should give something like)
# 1178 root      0:01 dotnet /storage/.kodi/addons/service.nextpvr/nextpvr-bin/NextPVRServer.dll

netstat -l | grep 8866
#tcp        0      0 :::8866                 :::*                    LISTEN

Then configure Kodi pvr.nextpvr on this LE instance to use 127.0.0.1 8866 and from remote web servers and clients it will be 198.168.1.100

If the reset didn't work let's try running manually to see any errors on startup

Code:
systemctl stop service.nextpvr
cd /storage/.kodi/addons/service.nextpvr/nextpvr-bin
NEXTPVR_DATADIR_USERDATA=/storage/.kodi/userdata/addon_data/service.nextpvr/config/  dotnet NextPVRServer.dll

Note the server doesn't log to kodi.log the nextpvr logs are in

/storage/.kodi/userdata/addon_data/service.nextpvr/config/logs/

Martin
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#3
2025-02-03, 03:01 PM (This post was last modified: 2025-02-03, 04:34 PM by homemaisonbaile.)
Thanks for the quick reply Martin.

I disabled and re-enabled the service in the GUI when I was making that log. The service is listed as "Enabled" in the GUI.

service.nextpvr is also running. I restarted it as suggested but the webserver is still not accessible. I see it listed in ps, and 8866 is being listened on in netstat.

Code:
● service.nextpvr.service - NextPVR Server
    Loaded: loaded (/storage/.config/system.d/service.nextpvr.service; enabled; preset: disabled)
    Active: active (running) since Mon 2025-02-03 13:50:02 CET; 1h 50min ago
      Docs: https://nextpvr.com
  Main PID: 3412 (dotnet)
      Tasks: 19 (limit: 8903)
    Memory: 44.5M (peak: 46.7M)
        CPU: 5.047s
    CGroup: /system.slice/service.nextpvr.service
            └─3412 dotnet /storage/.kodi/addons/service.nextpvr/nextpvr-bin/NextPVRServer.dll

Feb 03 13:50:02 LivingRoom systemd[1]: Started service.nextpvr.service.


The server is also not accessible when starting the server manually as per your suggestion, and I don't see any indication of issues either.

Code:
LivingRoom:~/.kodi/addons/service.nextpvr/nextpvr-bin # NEXTPVR_DATADIR_USERDATA=/storage/.kodi/userdata/addon_data/serv
ice.nextpvr/config/  dotnet NextPVRServer.dll
NEXTPVR_INSTALLDIR /storage/.kodi/addons/service.nextpvr/nextpvr-bin/
NEXTPVR_DATADIR /storage/.kodi/addons/service.nextpvr/nextpvr-bin/data/
NEXTPVR_DATADIR_USERDATA /storage/.kodi/userdata/addon_data/service.nextpvr/config/
[1] See LICENSE.txt for license information
[1] No /storage/.kodi/userdata/addon_data/service.nextpvr/config/scripts/PreStartup.sh
[1] Checking if upgrade required
[1] master file is /storage/.kodi/addons/service.nextpvr/nextpvr-bin/data/Config-master-dont-edit.xml
[1] Doing database updates
[1] Database: /storage/.kodi/userdata/addon_data/service.nextpvr/config/npvr.db3
[1] Version 7.0.1.241229
[1] Starting SAT>IP discovery
[1] local address: 192.168.1.100
[1] CaptureSource.LoadAll()
[1] []
[1] OSArchitecture: X64
[1] Is64BitProcess: True
[1] With environment: LD_LIBRARY_PATH=/storage/.kodi/addons/service.nextpvr/nextpvr-bin/DeviceHost/x64:/usr/lib:/usr/lib/pulseaudio
[1] Local Devices: <devices>
</devices>

[1] SAT>IP discovery complete
[1] update CAPTURE_SOURCE set name=@name, recorder_plugin_class='NShared.IPTVRecorder', enabled='Y', present='Y', priority=@priority where oid = 20
[1] CaptureSource.LoadAll()
[1] update CAPTURE_SOURCE set name=@name, recorder_plugin_class='NShared.IPTVRecorder', enabled='Y', present='Y', priority=@priority where oid = 20
[1] CaptureSource.LoadAll()
[1] Using in-progress RecordingService
[1] RecordingService.Startup()
[12] PowerManagement CancelWakeup (needs implementation)
[13] ServiceLocatorThread() starting...
[13] ServiceLocatorThread() Hostname:  LivingRoom
[13] address: 192.168.1.100
[12] Requesting wake up for 'EPG-UPDATE' [EPG Update] at 02/04/2025 02:44
[12] PowerManagement ScheduleWakeup (needs implementation)
[11] RecordingService starting...
[11] Doing database vacuum
[11] vacuuming done
[9] Deleting web temp files
[13] Waiting for broadcast
[11] No /storage/.kodi/userdata/addon_data/service.nextpvr/config/scripts/PostStartup.sh
[11] PurgeOldDeletes()
[11] Loading recording schedule
[11] PowerManagement CancelRecordingWakeupRequests (needs implementation)
[1] Enabling web server response compression
[1] Using webroot: /storage/.kodi/addons/service.nextpvr/nextpvr-bin/wwwroot/
Hosting environment: Production
Content root path: /storage/.kodi/addons/service.nextpvr/nextpvr-bin
Now listening on: http://[::]:8866
Application started. Press Ctrl+C to shut down.

Thanks for pointing out the NextPVR logs location, I have attached the contents of the logs folder here.

Also you mentioned confiuring pvr.nextpvr once this is resolved. I assume this is the nextpvr client?


Attached Files
.zip   nextpvrlogs.zip (Size: 4.18 KB / Downloads: 1)
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,766
Threads: 954
Joined: May 2006
#4
2025-02-03, 03:12 PM (This post was last modified: 2025-02-03, 03:14 PM by mvallevand.)
The logs show it running for hours too so it seems to be a connection issue.

In the ssh shell do any of these work to contact the web server?

curl -v http://localhost:8866/
curl -v http://127.0.0.1:8866/
curl -v http://192.168.1.100:8866/
curl -v http://[::1]:8866/

pvr.nextpvr is the Kodi client yes.

Martin
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#5
2025-02-03, 03:49 PM (This post was last modified: 2025-02-03, 04:33 PM by homemaisonbaile.)
Connection is acquired, but returns Internal Server Error 500 just as the NextPVR client did.

Code:
LivingRoom:~ # 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.6.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 15:45:15 GMT
< Server: Kestrel
<
* Connection #0 to host 192.168.1.100 left intact

LivingRoom:~ # curl -v http://localhost:8866/
* Host localhost:8866 was resolved.
* IPv6: ::1
* IPv4: 127.0.0.1
*   Trying [::1]:8866...
* Connected to localhost (::1) port 8866
> GET / HTTP/1.1
> Host: localhost:8866
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 15:45:29 GMT
< Server: Kestrel
<
* Connection #0 to host localhost left intact

LivingRoom:~ # curl -v http://127.0.0.1:8866/
*   Trying 127.0.0.1:8866...
* Connected to 127.0.0.1 (127.0.0.1) port 8866
> GET / HTTP/1.1
> Host: 127.0.0.1:8866
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 15:45:53 GMT
< Server: Kestrel
<
* Connection #0 to host 127.0.0.1 left intact

LivingRoom:~ # curl -v http://[::1]:8866/
*   Trying [::1]:8866...
* Connected to ::1 (::1) port 8866
> GET / HTTP/1.1
> Host: [::1]:8866
> User-Agent: curl/8.6.0
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 15:46:04 GMT
< Server: Kestrel
<
* Connection #0 to host ::1 left intact

And the same occurs connecting to the server from another computer on the network.
Code:
LivingRoom:~ # exit
Connection to 192.168.1.100 closed.

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.7.1
> Accept: */*
>
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 15:47:26 GMT
< Server: Kestrel
<
* Request completely sent off
* Connection #0 to host 192.168.1.100 left intact
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,766
Threads: 954
Joined: May 2006
#6
2025-02-03, 03:57 PM (This post was last modified: 2025-02-03, 03:57 PM by mvallevand.)
Could your try the manual service run from my first post and connect remotely? We might be able to detect were it is getting too.

Martin
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#7
2025-02-03, 04:06 PM
Certainly. This is the output from the remote computer.

Code:
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.7.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0
< Date: Mon, 03 Feb 2025 16:04:10 GMT
< Server: Kestrel
<
* Connection #0 to host 192.168.1.100 left intact

And this is the output from the server. There were no updates after the connection attempt was made.
Code:
LivingRoom:~/.kodi/addons/service.nextpvr/nextpvr-bin # NEXTPVR_DATADIR_USERDATA=/storage/.kodi/userdata/addon_data/serv
ice.nextpvr/config/  dotnet NextPVRServer.dll
NEXTPVR_INSTALLDIR /storage/.kodi/addons/service.nextpvr/nextpvr-bin/
NEXTPVR_DATADIR /storage/.kodi/addons/service.nextpvr/nextpvr-bin/data/
NEXTPVR_DATADIR_USERDATA /storage/.kodi/userdata/addon_data/service.nextpvr/config/
[1] See LICENSE.txt for license information
[1] No /storage/.kodi/userdata/addon_data/service.nextpvr/config/scripts/PreStartup.sh
[1] Checking if upgrade required
[1] master file is /storage/.kodi/addons/service.nextpvr/nextpvr-bin/data/Config-master-dont-edit.xml
[1] Doing database updates
[1] Database: /storage/.kodi/userdata/addon_data/service.nextpvr/config/npvr.db3
[1] Version 7.0.1.241229
[1] Starting SAT>IP discovery
[1] local address: 192.168.1.100
[1] CaptureSource.LoadAll()
[1] []
[1] OSArchitecture: X64
[1] Is64BitProcess: True
[1] With environment: LD_LIBRARY_PATH=/storage/.kodi/addons/service.nextpvr/nextpvr-bin/DeviceHost/x64:/usr/lib:/usr/lib/pulseaudio
[1] Local Devices: <devices>
</devices>

[1] SAT>IP discovery complete
[1] update CAPTURE_SOURCE set name=@name, recorder_plugin_class='NShared.IPTVRecorder', enabled='Y', present='Y', priority=@priority where oid = 20
[1] CaptureSource.LoadAll()
[1] update CAPTURE_SOURCE set name=@name, recorder_plugin_class='NShared.IPTVRecorder', enabled='Y', present='Y', priority=@priority where oid = 20
[1] CaptureSource.LoadAll()
[1] Using in-progress RecordingService
[1] RecordingService.Startup()
[12] PowerManagement CancelWakeup (needs implementation)
[13] ServiceLocatorThread() starting...
[13] ServiceLocatorThread() Hostname:  LivingRoom
[13] address: 192.168.1.100
[13] Waiting for broadcast
[12] Requesting wake up for 'EPG-UPDATE' [EPG Update] at 02/04/2025 02:44
[12] PowerManagement ScheduleWakeup (needs implementation)
[11] RecordingService starting...
[11] Doing database vacuum
[11] vacuuming done
[7] Deleting web temp files
[11] No /storage/.kodi/userdata/addon_data/service.nextpvr/config/scripts/PostStartup.sh
[11] PurgeOldDeletes()
[11] Loading recording schedule
[11] PowerManagement CancelRecordingWakeupRequests (needs implementation)
[1] Enabling web server response compression
[1] Using webroot: /storage/.kodi/addons/service.nextpvr/nextpvr-bin/wwwroot/
Hosting environment: Production
Content root path: /storage/.kodi/addons/service.nextpvr/nextpvr-bin
Now listening on: http://[::]:8866
Application started. Press Ctrl+C to shut down.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,766
Threads: 954
Joined: May 2006
#8
2025-02-03, 04:28 PM (This post was last modified: 2025-02-03, 04:29 PM by mvallevand.)
Do top/htop show you have enough memory available when NextPVR is running?

Martin
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#9
2025-02-03, 04:32 PM
Plenty of spare memory while NextPVR is running.

Code:
top - 17:31:24 up  4:03,  1 user,  load average: 1.40, 1.43, 1.45
Tasks: 133 total,   2 running, 131 sleeping,   0 stopped,   0 zombie
%Cpu(s): 20.9 us,  1.5 sy,  0.2 ni, 77.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   7686.7 total,   5936.6 free,   1050.8 used,    987.9 buff/cache
MiB Swap:      0.0 total,      0.0 free,      0.0 used.   6635.9 avail Mem
homemaisonbaile
Offline

Junior Member

France
Posts: 13
Threads: 1
Joined: Feb 2025
#10
2025-02-03, 04:42 PM
I have had NextPVR functioning on an RPi4b on libreelec, and I created a backup off of that to transfer to this chromebox and NextPVR was working at that time. I no longer have that backup and am unsure what could be different in this setup but at least the hardware has worked with NextPVR at some point in the past.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  NextPVR can't open RAI (Italian main TV channels) links f2fg 17 2,894 2025-03-29, 10:15 AM
Last Post: alice_anto
  Guide data issue using NextPVR in a Proxmox LXC njc 10 770 2025-03-23, 01:40 PM
Last Post: njc
  NextPVR oddly limited to 7 tuners DaVinylSmith 4 390 2025-02-12, 02:49 PM
Last Post: DaVinylSmith
  NextPVR 7 looses recordings after post processing ballfam 15 807 2024-12-20, 03:23 AM
Last Post: ballfam
  Colossus 2 and nextpvr Iriman 53 4,401 2024-12-16, 02:32 AM
Last Post: ehfortin
  NextPVR user1232 1 282 2024-11-09, 11:21 AM
Last Post: mvallevand
  How does NextPVR separate TV from VOD ? FrankBKK 8 732 2024-10-30, 06:17 AM
Last Post: sub
  NextPVR i.mjh.nz [Failed: Recording interrupted] Nzbaxterman 6 655 2024-10-29, 11:44 PM
Last Post: sub
  NextPVR server on LibreElec jcjefferies 45 3,754 2024-09-16, 04:38 PM
Last Post: mvallevand
  NextPVR doesn't record retrofan 5 523 2024-09-15, 05:15 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode