2nd time corrupt database issue in a month

Discussion in 'My TVSeries' started by kiwijunglist, June 29, 2014.

  1. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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.



    Show Spoiler

    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()
    [DOUBLEPOST=1403999081][/DOUBLEPOST]If needed I can upload the database file...
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    @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
     
  4. bribbon
    • Premium Supporter

    bribbon MP Donator

    Joined:
    September 11, 2008
    Messages:
    470
    Likes Received:
    95
    Gender:
    Male
    Ratings:
    +106 / 0
    Home Country:
    Switzerland Switzerland
    Show System Specs
    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
     
  5. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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.
     
    • Agree Agree x 1
  6. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    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?
     
  7. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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: August 4, 2014
  8. mm1352000
    • Team MediaPortal

    mm1352000 Development Group

    Joined:
    September 1, 2008
    Messages:
    21,527
    Likes Received:
    4,738
    Ratings:
    +8,205 / 17
    Home Country:
    New Zealand New Zealand
    No. MySQL which is used for TV Server and SQLite which is used for MediaPortal and plugins are completely unrelated.

    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.
     
  9. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    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 :)
     
  10. kiwijunglist
    • Team MediaPortal

    kiwijunglist Super Moderator

    Joined:
    June 10, 2008
    Messages:
    6,742
    Likes Received:
    1,417
    Occupation:
    Doctor
    Location:
    New Zealand
    Ratings:
    +1,846 / 9
    Home Country:
    New Zealand New Zealand
    Show System Specs
    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
     
  11. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,182
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    Did you exclude any "Ended" shows from the import scan? And what is your import refresh/update timer set at, as well as the initial import delay setting?
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!