Fatal error help

Permalink 4 users found helpful
The day before my site was working fine, it was even finished and I was just writing up some documentation for it.

I came to it today and I got this error message and really worried now because I don't know how to resolve it. It loads up when I try accessing the index page:


Please can some-one help me?

Error message:
Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [145: Table './brain/PageStatistics' is marked as crashed and should be repaired] in EXECUTE("insert into PageStatistics (cID, uID, date) values ('1', 0, NOW())") ' in /var/www/html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/html/concrete/libraries/3rdparty/adodb/adodb.inc.php(1037): adodb_throw('mysql', 'EXECUTE', 145, 'Table './brain/...', 'insert into Pag...', false, Object(ADODB_mysql)) #1 /var/www/html/concrete/libraries/3rdparty/adodb/adodb.inc.php(993): ADOConnection->_Execute('insert into Pag...') #2 /var/www/html/concrete/libraries/3rdparty/adodb/adodb.inc.php(761): ADOConnection->Execute('insert into Pag...', Array) #3 [internal function]: ADOConnection->Query('insert into Pag...', Array) #4 /var/www/html/concrete/libraries/database.php(73): call_user_func_array(Array, Array) #5 /var/www/html/concrete/models/user.php(195): Database->__call('query', Array) #6 /var/www/html/concrete/models/user. in /var/www/html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

View Replies: View Best Answer
triplei replied on at Permalink Best Answer Reply
It sounds like your page statistics table may be corrupted. If you bring up a mysql console and connect to your db, you should be able to run a
repair table PageStatistics;

That *should* repair the table and remove the lock on it.
admin replied on at Permalink Reply

I just performed that command. It worked - You are a life saver!

Thanks once again :-)
andarys replied on at Permalink Reply
had similar problem with the following error:

An unexpected error occurred.
mysql error: [145: Table './admin008_c5vwpdb1/PageSearchIndex' is marked as crashed and should be repaired] .....

tried your suggestion and executed the following in MySQL console
[repair table PageSearchIndex;]

worked great, thanks for this tip and to Peter Vernaglia for directing me to it.
stryker replied on at Permalink Reply
Thank you, that fixed a problem I was having with one of my tables too.
uswebdesigner replied on at Permalink Reply
Thanks. That helped me also.

Below are more details for my case in the event they help someone else.

In my case, my client first reported that he was getting an error when he clicked on the SiteMap tab in his site Dashboard - as such:

An unexpected error occurred.
A database error occurred while processing this request.

I went in to update the software to see if that would fix it first, and got an error on trying to update the database.

An unexpected error occurred.
A database error occurred while processing this request.

So I backed up the database from PHPMyAdmin in hosting panel and proceeded to try to update, which is when I got the following error that was more descriptive (with actual database name changed to database_name):

An Unexpected Error occurred while upgrading: mysql error: [145: Table './database_name/PageSearchIndex' is marked as crashed and should be repaired] in EXECUTE("UPDATE PageSearchIndex SET cName='Multilingual',cDescription=NULL,cPath='/dashboard/settings/multilingual',cDatePublic ......

So I used the same code provided in this post by andarys,

repair table PageSearchIndex;

(I actually asked my host to do it for me because I am not comfortable with a MySQL console). And after having it done, all of the issues went away.

Thanks again.
BrettDashwood replied on at Permalink Reply
Like @uswebdesigner I have not had to perform this before.

I can access the database through phpMyAdmin.

Do I simply go to the Query tab and enter
REPAIR TABLE PageSearchIndex;
as an 'SQL query on database'?
BrettDashwood replied on at Permalink Reply
I have just had this error again:
mysqlt error: [145: Table './document_concrete/PageStatistics'
And I realised that I didn't add anything after I had the problem a couple of years ago.

We run under ControlPanel so once open, scroll down to the Databases section and click on phpMyAdmin. This will open up and down the left hand side should be your current databases (in my case, "document_concrete").

Select the right database and let it load. Once loaded, across the top of the main window should be something like:
Server: localhost ┬╗Database: document_concrete

Now click on the SQL tab (2nd one for my version) and then add the query:
repair table PageStatistics;
...to the "Run SQL query/queries on database" window.

Press the "Go" button (far right of the screen), let it run, job done!

I hope this helps someone else, but of course this is just an expansion on the awesome simple response by triplei in the first place.
grovesk replied on at Permalink Reply

I've got the same problem with the Areas table but when I ran the Query, I get an error saying "Can't create new temp file." This seems like a permissions problem (?). If so, which folder would need a permission change?

When looking at the tables in the dB, the problem table says "In Use" in the Collation column, instead of "utf8_general_ci" like all the others. Not sure if that is relevant but I'm not a dB wizard.

Thanks, Karen
AkhenatonX replied on at Permalink Reply
You are a genius. Thanks.