Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Newznab Database Corruption - can't recover...please help!

Featured Replies

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

  • 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.

You're really not helping yourself much.

 

Did you stop mySQL before repairing?

 

Exactly what commands did you use to repair?

 

 

 

  • 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

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

 

 

  • 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"

What command did you use to get those results?

  • 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.

  • 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..

 

 

Did you try --safe-recovery?

In the update_scripts directory run:

 

$ php optimise_db.php true

 

Might look like it's hung, just wait awhile for it to complete.

  • 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.

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.