TV Server error and Powerscheduler - possibly related? (1 Viewer)

2.0

MP Donator
  • Premium Supporter
  • January 18, 2012
    106
    19
    New York
    Home Country
    United States of America United States of America
    After over three months of building, I finally finished my HTPC and everything was installed correctly. Or so I thought... :(

    Two days ago everything was working fine on my HTPC. But suddenly, it wasn't shutting down when it was supposed to any more. I had configured Powerscheduler to hibernate after 7 minutes of being idle, and it had done this correctly many times last week. But now it won't turn off when it should, though I can make it hibernate with the remote.

    I took a look at the log files and saw something new in the TV Server error log. There is a very long error which says something about "The database backend (provider MySQL) could not be reached." Could this have something to do with my Powerscheduler problem? Everything else in those logs seems normal.

    I took every conceivable step to fix the problem. I changed all the settings in Powerscheduler. I restarted TV Service. I did resets. I did a Windows restore to an earlier time. Nothing fixed Powerscheduler or that error in the logs. I even did a complete uninstall of TV Server and MySQL and reinstalled them. Several times. Still, the error persists.

    I am all out of ideas. I have no clue as to why it would completely break overnight when it was working just fine before. The only new thing I did with my HTPC was to plug in a new mouse and keyboard, but I removed that and it's still not working. Could somebody please take a look at these log files and tell me what's wrong?
     

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    655
    Bratislava
    Home Country
    Slovakia Slovakia
    From logs it seems that PowerScheduler is disabled in TV Service. Can you check again if PowerScheduler is enabled?
     

    2.0

    MP Donator
  • Premium Supporter
  • January 18, 2012
    106
    19
    New York
    Home Country
    United States of America United States of America
    Powerscheduler was indeed disabled at the time of those logs. I tried running TV Server as a fresh install with no plugins or channels set up, to see if I still got that error. I guess I should have mentioned this earlier.

    Last night I restored all my settings in TV Server with BackupSettings. All plugins and channels, etc were put back as they were before. I still have the problem of not hibernating, and that error is still there in the log. I'm posting new log files here.

    Another thing I noticed is the next scheduled wakeup time in the logs. It says EPGGrabbingHandler will wake up on 3/05 at 12:00, but it's not supposed to do that. It should only wake up on Sundays at 12:00 for WebEPG.

    The good news is that my system properly turned on last night for a scheduled recording. The bad news is that it didn't turn off afterwards.
     

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    655
    Bratislava
    Home Country
    Slovakia Slovakia
    At least it's not related to database error. In your logs I found message repeated every minute:
    Code:
    PowerScheduler: User input detected at 3/5/2012 10:59:17 AM
    (of course with another time). It seems that something in your system is generating user input every minute.
     

    2.0

    MP Donator
  • Premium Supporter
  • January 18, 2012
    106
    19
    New York
    Home Country
    United States of America United States of America
    Well I just solved the Powerscheduler problem. :D

    I scratched my head quite a bit about what could be causing user input every minute and interrupting hibernation. It turns out the culprit was HTPCInfo TVServer Monitor. This handy little tray icon tells you what state your TV Server is in (Idle, tuning, recording, etc.) It has an option to start itself automatically with Windows. It also has an option to "Send activity to the TV Server" (For what purpose I know not). Last week, when Powerscheduler was shutting down properly, I had this send activity option disabled. However, when I restarted Windows on Saturday morning, HTPCInfo TVServer Monitor automatically reactivated its send activity function. This is what was interfering with Powerscheduler. HTPCInfo TVServer Monitor will always reactivate this function on a restart and prevent scheduled shutdown and there is no way to change that. So I guess we can blame Micropolis for this one...

    I deactivated HTPCInfo TVServer Monitor and now it shuts down properly as it did before. I also checked the logs and there were no more "User input detected" lines. Problem half solved.

    That leaves the other issue of the error message in the error log. I'm still getting that error, though now we know it is not related to the Powerscheduler problem. Any idea what that error means or what may be causing it?
     

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    655
    Bratislava
    Home Country
    Slovakia Slovakia
    Sequence of messages in log files doesn't make any sense. Can you stop TV Service, delete all TV server logs and start TV service again? Then post TV server logs.
     

    2.0

    MP Donator
  • Premium Supporter
  • January 18, 2012
    106
    19
    New York
    Home Country
    United States of America United States of America
    Sequence of messages in log files doesn't make any sense. Can you stop TV Service, delete all TV server logs and start TV service again? Then post TV server logs.
    Okay, I did just that and checked the logs. The error was not there. I did it again a second and third time, still no error. Posted the results in the first file.

    Then I left TV Service running, restarted Windows, and checked the logs. And there's the error, just as before. Posted in the second file.

    So maybe the error only happens at startup time? I'm just speculating about this; I'm really no expert.
     

    georgius

    Retired Team Member
  • Premium Supporter
  • October 31, 2010
    1,376
    655
    Bratislava
    Home Country
    Slovakia Slovakia
    I think that these errors are not at startup time but at shutdown time. But I don't see any log lines that system is going to restart and TV service is stopping. It seems like your Win installation just restart without shutdown of services - or at least without shutdown of TV service. It seems that your MySQL service is stopping (or maybe stopped) and connection between TV Service and MySQL database cannot be established.

    Maybe can helps you setting dependencies for TV service. You need to run command prompt with admin rights. Then run command to get which dependencies is set:
    Code:
    sc qc TVService
    It produces output like:
    Code:
    [SC] QueryServiceConfig SUCCESS
     
    SERVICE_NAME: TVService
            TYPE              : 110  WIN32_OWN_PROCESS (interactive)
            START_TYPE        : 3  DEMAND_START
            ERROR_CONTROL      : 1  NORMAL
            BINARY_PATH_NAME  : "C:\Program Files (x86)\Team MediaPortal\MediaPortal TV Server\TVService.exe"
            LOAD_ORDER_GROUP  :
            TAG                : 0
            DISPLAY_NAME      : TVService
            DEPENDENCIES      : SQLBrowser
                              : Netman
            SERVICE_START_NAME : LocalSystem
    The required line(s) for you are 'DEPENDENCIES'. Also you have to get right name for MySQL service. Open services window (Control Panel -> Administrative tools -> Services), find MySQL service, click right, select Properties. Service name, which you require, is written in 'Service name'.

    Now you can set up dependencies with command:
    Code:
    sc config TVService depend= <DEPENDECIES SERVICES SEPARATED BY '/'>/<MySQL service name>
    , e.g. for example above:
    Code:
    sc config TVService depend= SQLBrowser/Netman
    You should get response
    Code:
    [SC] ChangeServiceConfig SUCCESS
    and also you can check dependencies in services window, find TVService, click right, select Properties and select Dependencies tab. MySQL service should be listed in 'This service depends on the following system components' window.
     

    2.0

    MP Donator
  • Premium Supporter
  • January 18, 2012
    106
    19
    New York
    Home Country
    United States of America United States of America
    Okay, I did that. I typed in sc qc TVService in command prompt and got this:
    Code:
    [SC] QueryServiceConfig SUCCESS
     
    SERVICE_NAME: TVService
            TYPE              : 110  WIN32_OWN_PROCESS (interactive)
            START_TYPE        : 2  AUTO_START
            ERROR_CONTROL      : 1  NORMAL
            BINARY_PATH_NAME  : "C:\Program Files\Team MediaPortal\MediaPortal TV Server\TVService.exe"
            LOAD_ORDER_GROUP  :
            TAG                : 0
            DISPLAY_NAME      : TVService
            DEPENDENCIES      : MySQL
                              : Netman
            SERVICE_START_NAME : LocalSystem
    Then I checked services, and MySQL's service name is "MySQL". So I typed this in to the command prompt:
    Code:
    sc config TVService depend= MySQL/Netman
    I got the confirmation dialog. Then I checked TVService's dependencies and it said it depends on MySQL and Network Manager. When I restarted Windows. TVService wasn't running. When I tried to start it I got the following error log:
    2012-03-08 01:22:11.644634 [SetupTv(1)]: ServiceHelper: Starting TvService failed. Please check your installation.
    Error: System.InvalidOperationException: Cannot start service TVService on computer '.'. ---> System.ComponentModel.Win32Exception: The dependency service does not exist or has been marked for deletion
    --- End of inner exception stack trace ---
    at System.ServiceProcess.ServiceController.Start(String[] args)
    at System.ServiceProcess.ServiceController.Start()
    at SetupTv.ServiceHelper.Start(String aServiceName)
    2012-03-08 01:22:12.081435 [SetupTv(1)]: Failed to wait for Global\MPTVServiceInitializedEvent
    2012-03-08 01:22:12.081435 [SetupTv(1)]: Exception :confused:ystem.Threading.WaitHandleCannotBeOpenedException: No handle of the given name exists.
    at System.Threading.EventWaitHandle.OpenExisting(String name, EventWaitHandleRights rights)
    at SetupTv.ServiceHelper.WaitInitialized(Int32 millisecondsTimeout)

    2012-03-08 01:22:37.166279 [SetupTv(1)]: ServiceHelper: Starting TvService failed. Please check your installation.
    Error: System.InvalidOperationException: Cannot start service TVService on computer '.'. ---> System.ComponentModel.Win32Exception: The dependency service does not exist or has been marked for deletion
    --- End of inner exception stack trace ---
    at System.ServiceProcess.ServiceController.Start(String[] args)
    at System.ServiceProcess.ServiceController.Start()
    at SetupTv.ServiceHelper.Start(String aServiceName)
    2012-03-08 01:22:37.166279 [SetupTv(1)]: Failed to wait for Global\MPTVServiceInitializedEvent
    2012-03-08 01:22:37.166279 [SetupTv(1)]: Exception :confused:ystem.Threading.WaitHandleCannotBeOpenedException: No handle of the given name exists.
    at System.Threading.EventWaitHandle.OpenExisting(String name, EventWaitHandleRights rights)
    at SetupTv.ServiceHelper.WaitInitialized(Int32 millisecondsTimeout)

    2012-03-08 01:23:02.188723 [SetupTv(1)]: Exception :confused:ystem.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 192.168.1.42:31456

    Server stack trace:
    at System.Net.Sockets.Socket.Connect(IPAddress[] addresses, Int32 port)
    at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket(AddressFamily family)
    at System.Runtime.Remoting.Channels.RemoteConnection.CreateNewSocket()
    at System.Runtime.Remoting.Channels.RemoteConnection.GetSocket()
    at System.Runtime.Remoting.Channels.SocketCache.GetSocket(String machinePortAndSid, Boolean openNew)
    at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.SendRequestWithRetry(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream)
    at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
    at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage msg)

    Exception rethrown at [0]:
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
    at TvControl.IController.get_Cards()
    at SetupTv.Startup.Main(String[] arguments)
    Yikes! So I went back to command prompt, redid the operation, and restarted. This time TV Service worked. However, the error is still there, as you can see in the latest logs.

    Did I do something wrong?
     

    geichel

    Portal Pro
    January 11, 2008
    81
    17
    Dortmund
    Home Country
    Germany Germany
    Hallo,2.0 ;)
    Your problem is not the TV Service itself. You have a problem with your database backend "MySql".
    You should check if the MySql service is running and if the TV Service can connect to the MP database.
    Please check if MySQL is installed and service is available. Please also check if both services TV Service and MySql
    are started automaticlly by windows.
    Regards,
    Gerrit
     

    Users who are viewing this thread

    Top Bottom