Jtable Session Crashed

My website Imagewize.net with a Joomla! 1.5.23 setup had been down for a few hours and I had had no news from the hoster Webreus for quite some time. During an investigation I found out the Jtable session crashed. Here is how I found out and the solution I used.

Jtablesession::store failed

When I wanted to enter the backend I got:

jtablesession::store failed
 DB function failed with error number 145
 <span style="color: red;">Table './imagewizenet_joomla-2/jos_session' is marked as crashed and should be repaired SQL=INSERT INTO `jos_session` ( `session_id`,`time`,`username`,`gid`,`guest`,`client_id` ) VALUES ( '0e5b90dacc1639dc05d4b096ddbb8a5e','1348971115','','0','1','1' )</span>
 <strong>Fatal error</strong>: Allowed memory size of 50331648 bytes exhausted (tried to allocate 16 bytes) in <strong>/var/www/vhosts/imagewize.net/httpdocs/libraries/joomla/error/exception.php</strong> on line <strong>117</strong>

Email was not working either. Had been waiting for an important email. For all I knew it bounced and I won’t get any access to my Joomlashack Dev bundle. Had been trying to figure this database issue out by doing some Googling. I could not access PHPMyAdmin as Plesk was not accessible either. Did of course email my hoster, but they normally do not reply at all during the weekend. Fortunately Imagewize.com was still up and running although I had been bumping into some VPS Memory issues here as well. Odd peaks at around 8 PM CEST forcing it to reboot.

Dropping Session Table

As soon as I have PHPMyAdmin access again I tried the following:

DROP TABLE IF EXISTS `jos_session`;
 CREATE TABLE `jos_session` (
 `username` varchar(150) default '',
 `time` varchar(14) default '',
 `session_id` varchar(200) NOT NULL default '0',
 `guest` tinyint(4) default '1',
 `userid` int(11) default '0',
 `usertype` varchar(50) default '',
 `gid` tinyint(3) unsigned NOT NULL default '0',
 `client_id` tinyint(3) unsigned NOT NULL default '0',
 `data` longtext,
 PRIMARY KEY (`session_id`(64)),
 KEY `whosonline` (`guest`,`usertype`),
 KEY `userid` (`userid`),
 KEY `time` (`time`)

to remove the old session and start a new one. Don’t do anything like this without a backup mind you! This was based on a nice tip I got from the Bluehost forum- thread here. This was not the best solution however. There was an easier, less radical one.

Database Tables Repair

Changed my mind in the end on the solution to use. Based upon Joomla! forum thread I repaired all tables and the session table was adjusted. Now the site is running again!

Tagged in : Tagged in :
Jasper Frumau

Jasper has been working with web frameworks and applications such as Laravel, Magento and his favorite CMS WordPress including Roots Trellis and Sage for more than a decade. He helps customers with web design and online marketing. Services provided are web design, ecommerce, SEO, content marketing. When Jasper is not coding, marketing a website, reading about the web or dreaming the internet of things he plays with his son, travels or run a few blocks.