Page 1 of 1

table jos_session crashed, what is the cause?

Posted: Wed Sep 15, 2010 8:30 am
by markuz
Last night my site crashed due to a problem with jos_session. The site showed up with the message.
jtablesession::Store Failed
DB function failed with error number 145
Table './example/jos_session' is marked as crashed and should be repaired SQL=INSERT INTO `jos_session` ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( 'hashcode_here','large_number_here','','0','1','0' )
I managed to repair it through a repair with this SQL-command:

Code: Select all

REPAIR TABLE `jos_session`
...But my question is: How could this happen? Is it a Joomla! bug? Is it a MySQL-bug? How can I prevent this?

Greetings,
Mark

Re: table jos_session crashed, what is the cause?

Posted: Tue Nov 15, 2011 6:54 am
by jrbashi
I would also like to know how to prevent this. It's only happened twice to me in the 25+ sites I've built with Joomla in the past 3 years. But I would like to know if there is a way to prevent it.

cheers,
James

Re: table jos_session crashed, what is the cause?

Posted: Fri Nov 25, 2011 9:14 am
by ant
And I just add myself among the ones who would like to know how to prevent this crash.

I noticed in the past that this error occurred on high traffic sites on a budget hosting, but today I find a site of my clients that crashed on a hosting service which usually performs very well (and the site is not generating high traffic!).

So, what is the cause and how to prevent, if possible?
Thanks,
Ant.

Re: table jos_session crashed, what is the cause?

Posted: Fri Nov 25, 2011 10:23 am
by ant
Ok, I read enough. Someone in this forum tells it has to do with "the drive being mounted as read-only by the OS after a reboot" (actually my site crashed after a down of the server).

Someone also suggests a permanent solution: set session_handler to "none", instead of "database", in the configuration file. It should avoid jos_session table to crash and it makes sense to me.

Greetings,
Ant.

Re: table jos_session crashed, what is the cause?

Posted: Wed Dec 14, 2011 2:43 pm
by xyzbytes
I just had the same thing happen. It sounds like there is a bug.

Re: table jos_session crashed, what is the cause?

Posted: Mon Jun 04, 2012 8:32 am
by Thetjo
I know this topic is pretty old already and I'm sorry for the bump.

However, I just encountered this issue on a Joomla 1.5 website, and after some digging I found out that my session lifetime (in the Global Configuration) was set to 9999 minutes. Perhaps others with this issue are facing the same settings and I would suggest lowering that value drastically to reduce the chance of any problems with the sessions table.

Another alternative seems to be the one suggested by ant to move the session handling away from the database altogether, but somehow that seemed a bit more risky to me (knowing how most hosts are handling file permissions, etc.).

Re: table jos_session crashed, what is the cause?

Posted: Mon Jun 04, 2012 10:40 am
by ant
Hi Thetjo,
thank you for reporting your experience.
I just checked some of the sites that encountered this issue: they all have a session lifetime of 30 minutes. But I'll keep an eye in future to this setting ;)

Re: table jos_session crashed, what is the cause?

Posted: Sun Jul 08, 2012 4:39 am
by xdrone
I am presently experiencing the same problem. My database over sixty GB of data and I need a solution since I am experiencing the same issue. Table jos_session crashes with the following report.
warning : Table is marked as crashed
warning : 3 clients are using or haven't closed the table properly
error : Record at pos: 346856 is not remove-marked
error : record delete-link-chain corrupted
error : Corrupt
Is this an optimization issue? Has any solution?

Re: table jos_session crashed, what is the cause?

Posted: Sun Jul 08, 2012 4:59 am
by xdrone
I am presently experiencing the same problem. My database over sixty GB of data and I need a solution since I am experiencing the same issue. Table jos_session crashes with the following report.
warning : Table is marked as crashed
warning : 3 clients are using or haven't closed the table properly
error : Record at pos: 346856 is not remove-marked
error : record delete-link-chain corrupted
error : Corrupt
I reviewd the session table data and noticed empty session "data" columns.

Has any solution?

Re: table jos_session crashed, what is the cause?

Posted: Tue Jul 17, 2012 2:24 pm
by bussy
Thanks "code" REPAIR TABLE `jos_session` did it, but the question is still why it's happening?

Re: table jos_session crashed, what is the cause?

Posted: Thu Feb 07, 2013 7:16 pm
by whamprod
I have run into this exactly same issue on three of my client websites in just the past 5 days. All three sites were version 2.5.X.

My solution:
  1. open the database in question in phpMyAdmin.
    Image
  2. At the "home" screen, click on "databases" tab at the top.
    Image
  3. On the next screen, click on the name of the database.
    Image
  4. The list of tables and their structure will load into phpMyAdmin's main frame. Scroll down until you see the sessions table, and check it.
    Image
  5. Scroll the rest of the way down the page, and look for the "With Selected" pulldown menu at the bottom.
    Image
  6. Click the pulldown open and select "Repair table."
    Image
  7. phpMyAdmin will automatically process the request, repairing the table. When this is finished, you will see the following message at the top of the page:
    Image
  8. Your are finished, and the website should load just fine.
I have no idea of what might have caused three such crashes within days of one another on the same server, but when looked at my server logs, there was no indication of anything untoward going on. I spoke to my own php/mysql guru, he said that it was possible that someone was trying an sql injection or something, but without any server log indications, it would seem hard to tell what is going on. Everything on my server regarding linux, apache, php, and mysql is all up to date current versions.

In any case, you learn as you go forward. At least the fix was a simple one, and only takes about 30 seconds to do.

Re: table jos_session crashed, what is the cause?

Posted: Tue Feb 12, 2013 8:12 pm
by whamprod
Another of my client sites had the same issue and didn't tell me about it until today. I fixed it, using the instructions I provided above, and it is working fine now.......but still.......... Is there a security patch needed for 2.5?

Re: table jos_session crashed, what is the cause?

Posted: Tue Feb 12, 2013 9:21 pm
by Per Yngve Berg
I believe this is a Mysql issue rather than Joomla. The database server must have been interrupted somehow.
A fix can be to move the database to a separate server that is optimized as a database server.

Re: table jos_session crashed, what is the cause?

Posted: Tue Apr 02, 2013 11:28 am
by bcraigie
This happened to my server yesterday and today. Both times, the hardware had hard hung and needed a reboot. The sessions table was broken after the reboots. So I think that explains why my site had problems. In my case, I'm planning to move my sites to new hardware in order to sort the problem (stop the hang).

If you are not the one who maintains your hardware, perhaps it was caused by a reboot you were unaware of (or beyond your control).

HTH

Brian