9 replies [Last post]
keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Was this information Helpful?

My web host just did a server upgrade and my site is not working any more. This is the error that is showing, and I cannot even log in as admin in order to shut the site down!

user warning: Incorrect key file for table './inknow_uber/role.MYI'; try to repair it query: SELECT DISTINCT(p.perm) FROM role r INNER JOIN permission p ON p.rid = r.rid WHERE r.rid IN (1) in /usr/www/users/inknow/uber/includes/database.mysql.inc on line 172.

Any help?

Mysql version is 5.0.41
PHP/5.2.11

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6855
Re: user warming: Incorrect key file for table ....

Uh oh. Sounds like your host didn't do the upgrade exactly right. I'd tell them about it and hope you have a backup of your site around somewhere.

keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Re: Re: user warming: Incorrect key file for table ....

Are you saying my database is messed up?

keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Re: Re: Re: user warming: Incorrect key file for table ....

My web host says they didn't upgrade the shared Mysql server and that my database is corrupt. The suggested I run the query indicated in the error. I did that, and this was what was returned:

#126 - Incorrect key file for table './inknow_uber/role.MYI'; try to repair it

I have no idea what this means...?

Thinking out loud, so maybe someone else can learn from my head banging. Sad

I am looking at the database now...will attache screen capture of that table.

Update 4:55pm: I was able to repair that table by executing the query "repair table role". But now I cannot log in as admin, and password reset does not work. ARRGGGGH! When I click the login button after resetting my password, it takes me to the home page with the error message that I am not authorized to view that page.

Update 6pm: Still debugging, looking at database via Phpmyadmin. Last order was placed Thu, 22 Oct 2009 06:26:28 GMT. It doesn't seem to let anybody log in.

I was looking at the users_roles table. There are only four entries, altho there are 844 users. The table looks like this. Shouldn't there be an entry for all the users?

uid rid
4 3
6 3
8 3
516 3
527 3

I looked at the users table and there is a user 0. Isn't admin supposed to be user 0?

6:40pm: looking at backup sql file dated 10/19. users_roles looks the same, and admin uid is 1. I know the site worked on 10/21 because a blog entry was posted by my client, so they must have been able to log in.

6:44pm: turned php errors on and saw that table sessions is crashed and I needed to repair that table as well. Now I can reset my password, login and everything seems okay. Any idea why this happened?

AttachmentSize
blah.jpg 81.58 KB
keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
another crashed table

So, I had another crashed table today. acl_user. What does this mean that tables keep crashing? Hacking? Database server overloaded? Any ideas?

PS: I just noticed that my database is 33 Megabytes in size. That seems huge. Is that normal for a Drupal 5 / Ubercart site?

keyone's picture
Offline
Joined: 10/01/2008
Juice: 95
Re: another crashed table

I dug around the database and noticed the cache_menu tables is huge and wondered if it is really needed. So, I googled 'Drupal 5 clear cache' and came across this tip.

http://drupal.org/node/152983#top

I did it and it reduced my database size down to 11 Meg. Still kid of big for a shared server, but hopefully good enough to get things running smoothly again. I will post any updates here in case this might help others.

PS: this step required much headbanging. I am making it sound easy!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: Re: another crashed table

Well generally a database table shouldn't spontaneously corrupt, but it does happen. However usually it's "several tables corrupt at once" as a result of a migration issue, a compression problem, or a multitude of other reasons.

The only thing you can really do is check each table's status to see if it needs repairing. That means going through and checking each one individually.

--
Help directly fund development: Donate via PayPal!

IT Guy 3000's picture
Offline
Joined: 05/11/2009
Juice: 122
Re: Re: Re: another crashed table

Hi ... I've got a site experiencing the same problem. Just happened a few hours ago. The site still renders in FF, but I can't login and no one can't add products to the cart.

http://www.optionindigo.com

Here's the error: Warning: Incorrect key file for table './[drupal path]/sessions.MYI'; try to repair it
query: SELECT u.*, s.* FROM users u INNER JOIN sessions s ON u.uid = s.uid WHERE s.sid = '772aebjavcs61a0imcoakcd6o4' in [drupal path]\includes\database.mysql.inc on line 128

Is there a table that keeps track of session IDs or similar I should look for/at? Other help/ideas?

Thanks!

IT Guy 3000's picture
Offline
Joined: 05/11/2009
Juice: 122
Re: Re: Re: Re: another crashed table

Interesting: If I delete my cookie for the site, it renders the home page without error. But once I try to navigate to another page, it kicks out the error and the problem returns. Does this point to a particular table? Thanks again!

torgosPizza's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/14/2007
Juice: 4111
Re: Re: Re: Re: Re: another crashed table

Yeah that points exactly to your sessions table, it needs to be repaired. Do you have access to the MySQL command line, or to phpMyAdmin? If so you can do a repair from either of those. It's in the Operations table in phpMyAdmin and in the CLI it's "REPAIR tablename;"

HTH

--
Help directly fund development: Donate via PayPal!