server doesn't start (1 Viewer)

mrkaras

Portal Pro
December 9, 2006
541
7
Home Country
almost always after a restart of my PC I have to manually start TV server, the service just does not start. I have set it to start automatically (was never set any different) and I have now set it to restart if it fails, but it makes no difference, it just never starts.

I attempted to export some log files but that is also broken (see attached). I were actually trying to save some logs because now MP stops working some times, presumably the TV server crashes. when my wife turned it off instead of it stopping live TV and returning to the TV guide (the power button doesn't turn it off since about 5 versions back) the picture just froze. this was the second time this has happened and the second time the whole thing failed to work properly when turning it back on.

Is viewing TV being phased out? it just seems that in every single version more and more is broken, I saw a while ago a plugin to save the time shift buffer when you start a recording after watching part of the program, a long time ago this was built in and record current program would do just that even if some of it had to come from the time shift buffer, that function is long gone. pressing the power button no longer puts the PC into away mode, to turn the TV machine off you now need to press power (live TV stops) press an arrow to change the selection and then press power again.
 

Attachments

  • Capture.PNG
    Capture.PNG
    39.1 KB

mrkaras

Portal Pro
December 9, 2006
541
7
Home Country
thanks for replying nicely to my rant, my wifes been telling me we need to get rid of this and get a normal set top box, and I'm having trouble coming up with any sensible reasons not to, we'd even be able to play blue ray, something it looks like MP will never be able to do (mp doesn't do menus in any blue rays I've ever tried, unless that's changed recently). anyway I've ziped and uploaded my TV server logs, what else do you need
 

mrkaras

Portal Pro
December 9, 2006
541
7
Home Country
also perhaps you can see in there why we scheduled some recordings but then they were forgotten, net next day they were no longer scheduled. this happened more than once (but it was a few weeks back so it might be a bit of a hard ask to find it in the logs)
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    almost always after a restart of my PC I have to manually start TV server, the service just does not start. I have set it to start automatically (was never set any different) and I have now set it to restart if it fails, but it makes no difference, it just never starts.
    1. If the service doesn't start it is usually because a service that our TV service depends on (such as MySQL) failed to start. The only way we can see that is in the Windows event logs. So, please use the watchdog (which includes event logs) with option 3 (export all existing logs) to collect your log files:
    http://wiki.team-mediaportal.com/1_MEDIAPORTAL_1/16_Support/3_Forums/2_Log_Files

    2. Please tell us when you last restarted your PC and the service failed to start.


    mp doesn't do menus in any blue rays I've ever tried, unless that's changed recently
    It is true: MP's internal player does not support BD-J. If that bothers you greatly you can use an external player (eg. Cyberlink PDVD) for Blu-Ray.


    also perhaps you can see in there why we scheduled some recordings but then they were forgotten, net next day they were no longer scheduled. this happened more than once (but it was a few weeks back so it might be a bit of a hard ask to find it in the logs)
    This is pretty much impossible without any indication of the date, time, name of program, name of channel, type of schedule...
     

    mrkaras

    Portal Pro
    December 9, 2006
    541
    7
    Home Country
    I had a look and do see an event for the TV service failing to start, it claims SQL server could not be reached. how can I make the TV service wait for SQL server rather than just trying and failing to start too early? That was yesterday, I'm sure SQL server was running yesterday when I manualy started the TV service but sometimes it doesn't seem to start, any ideas, is that common or does the TV service somehow manage to crash SQL server?

    I cannot use the log collection tool, see the attachment on the first post. not sure if it is useful or not but I have attached the application event log.

    I'll see if I can do anything to get the watchdog program to actually run properly

    is this the latest method to play blu-rays? https://forum.team-mediaportal.com/threads/bluray-with-mp-and-powerdvd.93618/

    Service cannot be started. Error: DatabaseUnavailableUnclassified
    Gentle.Common.GentleException: The database backend (provider SQLServer) could not be reached.
    Check the connection string: Password=MediaPortal;Persist Security Info=True;User ID=sa;Initial Catalog=MpTvDb;Data Source=Mediaserver\SQLEXPRESS;Connection Timeout=30; ---> System.Data.SqlClient.SqlException: Cannot open database "MpTvDb" requested by the login. The login failed.
    Login failed for user 'sa'.
    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.SqlClient.SqlConnection.Open()
    at Gentle.Provider.SQLServer.SQLServerProvider.GetConnection()
    --- End of inner exception stack trace ---
    at Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String ...
     

    Attachments

    • application events.evtx.txt
      2.1 MB

    mrkaras

    Portal Pro
    December 9, 2006
    541
    7
    Home Country
    OK, I managed to get the watchdog to work and save some logs, and a new fault, MP froze when I tried to close it.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    @mrkaras
    In your log files I can see three occasions where the TV service starts successfully:
    • 2014-08-25 19:26:56,557
    • 2014-08-26 05:13:54,265
    • 2014-08-26 19:00:04,962
    I can't tell for sure whether these are automatic or manual starts, but on all three occasions the successful start is immediately preceded by a failed attempt... so I guess they're manual starts.
    In the TV Server log the failures looks like this:
    [2014-08-26 18:52:29,052] [Log ] [4 ] [DEBUG] - Setting up EventWaitHandle with name: Global\MPTVServiceInitializedEvent
    [2014-08-26 18:52:30,919] [Log ] [4 ] [ERROR] - applyProcessPriority: exception is at Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String msg)
    at Gentle.Common.Check.Fail(Exception e, Error error, Object[] args)
    at Gentle.Provider.SQLServer.SQL92Analyzer.Analyze(String tableName)
    at Gentle.Provider.SQLServer.SQLServerAnalyzer.Analyze(String tableName)
    at Gentle.Framework.GentleAnalyzer.UpdateObjectMap(ObjectMap map)
    at Gentle.Framework.ObjectFactory.ConstructMap(PersistenceBroker broker, Type type)
    at Gentle.Framework.ObjectFactory.GetMap(PersistenceBroker broker, Type type)
    at Gentle.Framework.SqlBuilder..ctor(IGentleProvider provider, StatementType stmtType, Type type, LogicalOperator logicalOperator)
    at TvDatabase.TvBusinessLayer.GetSetting(String tagName, String defaultValue)
    at TvService.Service1.applyProcessPriority()

    When I compare with the application event logs I see the following sequence...
    1. Windows tells the SQL Server service to start:
    "26/08/2014 6:52:26 PM";"MSSQL$SQLEXPRESS";"Server";"Information";"Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (X64)
    Mar 29 2009 10:11:52
    Copyright (c) 1988-2008 Microsoft Corporation
    Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
    ";"1073758893"

    2. SQL Server reports it is ready for connections. Presumably the SQL Server service tells Windows it has finished starting at this point:
    "26/08/2014 6:52:29 PM";"MSSQL$SQLEXPRESS";"Server";"Information";"Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\SQLEXPRESS ].";"1073767872"
    "26/08/2014 6:52:29 PM";"MSSQL$SQLEXPRESS";"Server";"Information";"Server local connection provider is ready to accept connection on [ \\.\pipe\MSSQL$SQLEXPRESS\sql\query ].";"1073767872"

    3. Windows tells the TV Server service to start:
    [2014-08-26 18:52:29,052] [Log ] [4 ] [DEBUG] - Setting up EventWaitHandle with name: Global\MPTVServiceInitializedEvent

    4. SQL Server reports login failure:
    "26/08/2014 6:52:30 PM";"MSSQL$SQLEXPRESS";"Logon";"FailureAudit";"Login failed for user 'sa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]";"3221243928"
    "26/08/2014 6:52:31 PM";"MSSQL$SQLEXPRESS";"Logon";"FailureAudit";"Login failed for user 'sa'. Reason: Failed to open the explicitly specified database. [CLIENT: <local machine>]";"3221243928"

    5. TV Server fails to start:
    "26/08/2014 6:52:35 PM";"TV Server";"(0)";"Error";"Service cannot be started. Error: DatabaseUnavailableUnclassified Gentle.Common.GentleException: The database backend (provider SQLServer) could not be reached. Check the connection string: Password=***;Persist Security Info=True;User ID=sa;Initial Catalog=MpTvDb;Data Source=Mediaserver\SQLEXPRESS;Connection Timeout=30; ---> System.Data.SqlClient.SqlException: Cannot open database "MpTvDb" requested by the login. The login failed. Login failed for user 'sa'. at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at Gentle.Provider.SQLServer.SQLServerProvider.GetConnection() --- End of inner exception stack trace --- at Gentle.Common.Check.FailWith(Severity severity, Error error, Exception e, String ...";"0"

    6. SQL Server reports it has loaded the TV Server database:
    "26/08/2014 7:00:05 PM";"MSSQL$SQLEXPRESS";"Server";"Information";"Starting up database 'MpTvDb'.";"1073758961"

    7. You manually start TV Server successfully:
    "26/08/2014 7:00:11 PM";"TV Server";"(0)";"Information";"Service started successfully.";"0"


    So, in short it appears like the problem is that SQL Server is saying it can accept connections before it has loaded the TV Server database... which results in TV Server's attempts to connect to its database being rejected. To me SQL Server's behaviour seems illogical, and I'm not sure that there is much TV Server can do about this.


    In answer to your questions:

    I had a look and do see an event for the TV service failing to start, it claims SQL server could not be reached. how can I make the TV service wait for SQL server rather than just trying and failing to start too early?
    Services are started by Windows.
    Windows starts a given service when all pre-requisite services for the service have successfully started.
    When TV Server is installed and configured, it registers the TV service and includes a pre-requisite reference to the SQL Server service (or MySQL service - depending on what database engine you choose) that you configure.
    What I'm trying to say with the above statements is:
    1. It is not the TV service's responsibility to wait for SQL Server. Windows manages when services are started.
    2. Windows should already be configured to wait for the SQL Server service to finish starting before attempting to start the TV service.
    On the second point: the application event logs appear to show Windows is indeed waiting until the SQL Server service is started before attempting to start the TV service. The question is why SQL Server is saying it is ready for connections when clearly it is not able to accept TV Server's connection attempt... and I'm not able to answer that.


    That was yesterday, I'm sure SQL server was running yesterday when I manualy started the TV service...
    Sorry but you're going to need to be more precise - like "the 26th at 7:26pm". "Yesterday" at the time you wrote that could be the 25th, 26th or 27th for all I know, especially considering I don't know what time zone you're in.


    ...but sometimes it doesn't seem to start, any ideas, is that common or does the TV service somehow manage to crash SQL server?
    No, not common as far as I know.
    No, the TV service is not crashing SQL Server.
     

    mrkaras

    Portal Pro
    December 9, 2006
    541
    7
    Home Country
    I have seen SQL server act that way before, I wrote some software that run at start up and I found waiting for SQL server to say it was ready was not enough I ended up waiting for it to be "ready" then wait another 3 seconds for it to be actually ready. I agree it is totally logical but I think that is the way it works, perhaps we're misunderstanding the meaning (though I thought it was pretty clear).

    so its still looking like I'll have to build another workaround, I have already build a very useful script to kill media portal every time it locks up for more then soem time limit (15 seconds I think), (up to 10 seconds or so can happen in normal operation), now I'll have to expand it to start the service when it is actually ready to start I suppose. there isn't some easy way to delay the service logging on for a couple of seconds is there?

    @regeszter I'm very hesitant to do that because every time I have "upgraded" I get more problems than before, and it only rarely fixes anything I have been experiencing. that version is not even full release (not that that has any effect one expected stability anyway) but will I potentially have difficulty upgrading later?
     

    Users who are viewing this thread

    Top Bottom