January 11, 201313 yr Hey all, Really could use some help here. I had some problems previously where my newznab DB tables were corrupting continually when using various update scripts. I've since started over, have been using @Tybio's great newznab_cron.sh script, and everything has been plugging along just fine - binaries update, legacy NZBs get imported, releases update. All good. I then had a power outage, which caused me to need to reboot (of course). Since then, my DB's corrupt at every update. I've backed up my files, but could use some help as to steps that I should take. Part of me wonders if there is a config in PHP or mysql that would have reset at the reboot (if it was in volitle memory), but I'm not sure. Any thoughts? I've got a good week of time / data into my current iteration, so could really use some guidance. Thanks, LT
January 11, 201313 yr Author One other point: I backed my DB up and have myisamchk against the tables to fix them. myisamchk reports that the tables repair, but they go right back to corrupted after update. HOWEVER: I am able to access all the data that currently exists in my newznab instance via Web UI or API once repaired..it is only the update that seems to corrupt them.
January 11, 201313 yr You're really not helping yourself much. Did you stop mySQL before repairing? Exactly what commands did you use to repair?
January 11, 201313 yr Author i started with You're really not helping yourself much. Did you stop mySQL before repairing? Exactly what commands did you use to repair? - Why am I not helping myself? Would like to know to avoid in the future... - Yes...stopped mysql before repair - started with myisamchk --recover tablename.MYI, but needed to go to myisamchk -f tablename.MYI per messaging back from myisamchk
January 11, 201313 yr You're not helping yourself much because you didn't give any details. Your post basically said this - "Hey, I have database corruption and I tried to fix it but it didn't get fixed. Got any ideas?". Try using --extend-check or --safe-recovery
January 11, 201313 yr Author Ah. Got it. Here's what it reports for binaries.MYI myisamchk: warning: Table is marked as crashed and last repair failed - check file-size myisamchk: warning: Size of datafile is: 2263196 Should be: 316612 - check record delete-chain - check key delete-chain - check index reference - check data record references index: 1 - check data record references index: 2 - check data record references index: 3 - check data record references index: 4 - check data record references index: 5 - check data record references index: 6 - check data record references index: 7 - check data record references index: 8 - check data record references index: 9 - check records and index references myisamchk: error: Record at: 208 Can't find key for index: 1 MyISAM-table 'binaries.MYI' is corrupted Fix it using switch "-r" or "-o" and similar for parts: Checking MyISAM file: parts.MYI Data records: 123344 Deleted blocks: 0 myisamchk: warning: Table is marked as crashed and last repair failed - check file-size - check record delete-chain - check key delete-chain - check index reference - check data record references index: 1 - check data record references index: 2 - check data record references index: 3 - check data record references index: 4 - check data record references index: 5 - check records and index references myisamchk: error: Record at: 6258904 Can't find key for index: 1 MyISAM-table 'parts.MYI' is corrupted Fix it using switch "-r" or "-o"
January 11, 201313 yr Author myisamchk --extend-check tablename.MYI Also, and I don't know if it matters, but just wanted to restate: Everything works for me after repair with the exception of updates. I can search via Web, pull down NZBs from the web page, query Newznab via API by Couchpotato, sickbeard and Headphones.
January 12, 201313 yr Author Ok. Maybe one more piece of the puzzle. I've been manually running my update processes, then checking in SQL to check the status. It appears that every time update_binaires and update_releases run, I end up with corrupted binaries, parts and sometimes partrepair. If I truncate them, everything continues to process as normal. Not sure if this helps, but wanted to share it..
January 12, 201313 yr In the update_scripts directory run: $ php optimise_db.php true Might look like it's hung, just wait awhile for it to complete.
January 12, 201313 yr Author Did you try --safe-recovery? Yep, and below is what I get: root@Tower:/mnt/cache/mysql/newznab# myisamchk -o binaries.MYI - recovering (with keycache) MyISAM-table 'binaries.MYI' Data records: 3093 myisamchk: error: Can't create new tempfile: 'binaries.TMD' MyISAM-table 'binaries.MYI' is not fixed because of errors Try fixing it by using the --safe-recover (-o), the --force (-f) option or by not using the --quick (-q) flag In the update_scripts directory run: $ php optimise_db.php true Might look like it's hung, just wait awhile for it to complete. Yep...did that, too. And nothing either. Through more testing, it seems like it corrupts after every single update. If I truncate the binaries, parts and parts repair table every time, it works. I've been able to get my #of release up by 5K last night, but it's taken a lot of manual effort. I took out a new stick of RAM that I recent put in, thinking that might be the issue, but no different.
January 25, 201313 yr Author I fixed my perms and all is now working fine. Have 100k+ releases imported without issue. The perms that I applied are in here: http://lime-technology.com/forum/index.php?topic=20603.45
Archived
This topic is now archived and is closed to further replies.