2nd time corrupt database issue in a month (1 Viewer)

kiwijunglist

Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    Hi

    I'm pretty sure my problem relates to corrupted tvseries database, 2x within this month. Attached logs. Are there any suggestions on how I could avoid this problem? 2 weeks ago, I encountered this problem, and I fixed it by deleting the tvseries database file. Apologies if the problem doesn't relate to tv series.

    2014-06-29 11:36:44.139 [INFO][06]: Commit failed on this command: <select * from online_series where online_series.ID = 84947> (SQLiteClient: cmd:sqlite3_step err:ERROR detailed:bind or column index out of range query:select * from online_series where online_series.ID = 84947).

    [collapse]
    Mediaportal-error.log:

    [2014-06-29 11:36:44,123] [Error ] [DirectoryWorker] [ERROR] - SQLiteClient: cmd:sqlite3_step err:ERROR detailed:bind or column index out of range query:select * from online_series where online_series.ID = 84947
    [2014-06-29 11:36:44,997] [Error ] [14 ] [ERROR] - MediaPortal: Unhandled exception occured
    [2014-06-29 11:36:45,012] [Log ] [14 ] [ERROR] - Exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
    at System.Threading.Thread.StartInternal(IPrincipal principal, StackCrawlMark& stackMark)
    at System.Threading.Thread.Start(StackCrawlMark& stackMark)
    at System.Threading.Thread.Start()
    at MediaPortal.Plugins.MovingPictures.LocalMediaManagement.MovieImporter.Start()
    at MediaPortal.Plugins.MovingPictures.MainUI.MovingPicturesGUI.onCoreInitializationProgress(String actionName, Int32 percentDone)
    at MediaPortal.Plugins.MovingPictures.MovingPicturesCore.Initialize()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart() Message: Exception of type 'System.OutOfMemoryException' was thrown. Site : Void StartInternal(System.Security.Principal.IPrincipal, System.Threading.StackCrawlMark ByRef) Source : mscorlib Stack Trace: at System.Threading.Thread.StartInternal(IPrincipal principal, StackCrawlMark& stackMark)
    at System.Threading.Thread.Start(StackCrawlMark& stackMark)
    at System.Threading.Thread.Start()
    at MediaPortal.Plugins.MovingPictures.LocalMediaManagement.MovieImporter.Start()
    at MediaPortal.Plugins.MovingPictures.MainUI.MovingPicturesGUI.onCoreInitializationProgress(String actionName, Int32 percentDone)
    at MediaPortal.Plugins.MovingPictures.MovingPicturesCore.Initialize()
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()[/collapse][DOUBLEPOST=1403999081][/DOUBLEPOST]If needed I can upload the database file...
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    @kiwijunglist, is the database db3 corrupt as well and fails an SQLite PRAGMA integrity check? If that's the case then I can at least offer you a workaround via batchscript I use. It automatically does a backup and restores any database on an integrity check. Sometimes the time involved in debugging all the conditions involved that cause a corruption are just not worth it when it is extremly random in nature.

    Auto-Backup/Restore script @ https://forum.team-mediaportal.com/threads/corrupted-database.120376/#post-1014075
     

    bribbon

    MP Donator
  • Premium Supporter
  • September 11, 2008
    470
    100
    Home Country
    Switzerland Switzerland
    I have for a long time no more corrupt database. I had this mostly when I had to choke when MediaPortal starting (PC reset). Was pronounced to access the database as I had to do the reset.

    In any case, thanks for the tip RoChess. I will try it
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    Thanks. I think the first corrupted database coincided with a power loss to my htpc. Not sure about the recent problem.

    I'll try your script. Thanks.

    It might be nice if tvseries could automatically do something similar.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    when it is extremly random in nature.
    For what it's worth I've been seeing people report a corrupt TV Series database with increasing frequency in the last few months. IMHO it isn't a good look for My TVSeries or for MediaPortal in general. Obviously there's nothing anybody can do about corruption caused by unexpected power loss, HDD failure etc. access attempts, but what I'm seeing feels too co-incidental to be random. Unfortunately it is hard to quantify with hard facts.

    Anything we can do to assist getting this problem sorted, or are you still of the opinion the problem is completely random?
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    Could it be related to changing versions of mysql or possibly the increase in freq of people using other plugins that access the database e.g. mpsync or webmp etc (I don't use any of these plugins btw)

    If it is related to power cycle corruption it seems particularly vulnerable to this it would be nice if it could either be made more robust or if it had a built in auto corruption check on startup and restore function.
     
    Last edited:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Could it be related to changing versions of mysql
    No. MySQL which is used for TV Server and SQLite which is used for MediaPortal and plugins are completely unrelated.

    Could it be related to ... the increase in freq of people using other plugins that access the database e.g. mpsync or webmp etc (I don't use any of these plugins btw)
    Yes absolutely. My understanding is any concurrent access - at file or database level, even from multiple threads within My TV-Series - would have the potential to cause problems. Granted the potential may not be that high, but it is there.
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    The one comminality I can see between the majority of users who actually experience it is that they run a well-above average configuration. Shouldn't make a difference, but it seems to make things break easy. For me the only bug worth pursuing is a reproducable one, and that just has not been made possible yet for this one. It is easy to sort of force reproduction, and that is to unplug the power to your computer or harddisk right when MP-TVSeries is doing updates to the SQLite index.

    Maybe the users have a large series database, that takes a long time to verify and they have set their collection rescan time to sharp, so it goes into a constant SQLite update loop in the background. I've gone through the trouble to manually go into my MP-TVSeries collection and mark each 'Ended' show to be checked for "ignore on scan". But I've changed so many other things, so no idea if that is why the only time my MP-TVSeries database went correct is because I had concurrent RDP open and editing MP-TVSeries dbase and somebody else without me knowing held down power button on HTPC thinking it was "frozen". In some cases that was with multiple on/offs a week of entire HTPC, or months of 24/7 usage via MP-TVSeries playlists, over a timespan of at least the last 2 years. Of course I don't use standby/resume, for me the screen goes black, and the CPU idles, so maybe the problem lies in there, not enough confirmations if that is the comminality when corruption occurs.

    I did had corruption myself once a week from older LastMediaAdded plugin, which was harmless, but annoying and what inspired me to write the auto-backup/restore script, which was also a good idea for getting backups anyway :)
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    My setup is very basic plugins:
    TVSeries,MovPic,OnlineVideos,Trakt,IMDB+,Titan,Trailers (No TV Server/TV)
    But my database for tvseries and MovPic is HUGE!

    PS: Haven't got around to adding your script yet rochess ;-p
     

    Users who are viewing this thread

    Top Bottom