TVSERVER service crashing constantly (1 Viewer)

jformica

Portal Member
June 3, 2007
13
1
Home Country
Hi All.

I have been using MePo for many years (0.12 i think?) and have found that most of the recent releases have been great.

Since upgrading to 1.13.0 i seem to be having issues with the TVService constantly crashing - usually when watching TV from either the local singleseat install or from clients. Though I have noted that it has sometimes crashed without LiveTV being used at all.

I get the following message in the EventLog:
The TVService service terminated unexpectedly. It has done this 1 time(s). The following corrective action will be taken in 0 milliseconds: Restart the service.

-I currently have it set to restart the TVService automatically.

Just wondering if anyone has any idea why?

Logs attached.

Thanks in advance.
 
Last edited:

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Hi

    First, thanks for reporting the problem.

    Windows is reporting a crash, but the log files show that TV Server is not actually starting successfully. The reason that TV Server fails to start comes from this exception/error:
    [collapse]
    [2016-03-10 00:48:51,913] [Log ] [scheduler thread] [INFO ] - scheduler: SchedulerWorker inner exception System.NullReferenceException: Object reference not set to an instance of an object.
    at TvDatabase.Schedule.GetProgramsForSchedule(Schedule schedule)
    at TvDatabase.Schedule.ResetProgramStates(Int32 idSchedule)
    at TvDatabase.Schedule.Delete()
    at TvService.Scheduler.CheckAndDeleteOrphanedOnceSchedules()
    at TvService.Scheduler.DoScheduleWork()
    at TvService.Scheduler.SchedulerWorker()
    [2016-03-10 00:48:51,913] [Log ] [TVService] [INFO ] - TvControllerException: System.NullReferenceException: Object reference not set to an instance of an object.
    at TvDatabase.Schedule.GetProgramsForSchedule(Schedule schedule)
    at TvDatabase.Schedule.SynchProgramStates(Int32 idSchedule)
    at TvDatabase.Schedule.SynchProgramStatesForAll()
    at TvService.TVController.InitController()
    at TvDatabase.Schedule.GetProgramsForSchedule(Schedule schedule)
    at TvDatabase.Schedule.SynchProgramStates(Int32 idSchedule)
    at TvDatabase.Schedule.SynchProgramStatesForAll()
    at TvService.TVController.InitController()[/collapse]

    I think the cause of the error is that you've somehow managed to get into a situation where you have a schedule that references a channel that no longer exists.

    To fix:
    1. Open a command prompt with admin privileges (click start button, type cmd, hold down the ctrl and shift keys and press enter).
    2. To stop the TV service type net stop TVService then press enter.
    3. Type cd "c:\Program Files\MySQL\MySQL Server 5.6\bin" then press enter.
    4. Type mysql -h localhost -u root -p then press enter.
    5. You should now be prompted to enter the root (admin) user password for your MySQL database. In your case it is MediaPortal (case sensitive!). Type the password then press enter.
    6. Type use MpTvDb; then press enter.
    7. Type DELETE FROM Schedule WHERE NOT EXISTS (SELECT * FROM Channel WHERE Channel.idChannel = Schedule.idChannel); then press enter.
    8. Type commit; then press enter.
    9. Type \q then press enter.
    10. To start the TV service type net start TVService then press enter.
    If you've followed the above instructions properly, the problem should now be solved... I hope!
     

    jformica

    Portal Member
    June 3, 2007
    13
    1
    Home Country
    Ok just tried it....T-Minus 2 min and I should know if it has worked :)

    What you said makes sense - i deleted all channels and rescanned, but forgot to export and delete the schedule first......That being said, there was stuff in there from about 2 years ago that probably needed to be cleared out!
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand

    Users who are viewing this thread

    Top Bottom