users_sessions table corrupted for 2.3.x versions of Elgg

Hi all,

I have a couple of Elgg-based test/hobby sites. Last night some strange thing happened with the Elgg 2.3.x based ones (more specifically one os based on 2.3.11 and the other one is 2.3.12). No such problem with the Elgg 1.x.x ones and they are OK.

In both of those Elgg 2.3.x based sites, I suddenly started getting White Screen (WSOD). When I checked the logs, I can see that Elgg complains about 'invalid file format' for the elgg_users_sessions table.

It is not possible to repair it via REPAIR TABLE command. So I am running instead:

myisamchk -r -f -t /home/temp elgg_users_sessions --sort_buffer_size=20G 

But then this one does not work either. It returns the error message:

'elgg_users_sessions' is not an MyISAM-table

Prior to this WSOD problem appearing, I had noticed that I had forgotten to set up the cron jobs for some of the websites. These two Elgg 2.3.x based sites are among those -alongside the ones for the Elgg 1.x based ones- for which I have defined a full set of cron jobs as per Elgg Wiki.

Having said this, the problem did not occur immediately after defining the cron jobs but only after a day or so. It may not be related but this is the only one I did recently that I can recall.

Appreciate any ideas for any possible cause and any way of recovering...

Best Regards



  • Use phpmyadmin to set the storage engine like as MyISAM.

    You can empty this table also.

    Backup the DB before any changes.

  • Thank you RvR for your reply.

    I was able to repair the user_sessions table only after deleting its contents (truncating). The real issue seems to be the metastrings table which is not really practical to truncate. I tried to change the table's engine to ISAM via ALTER command but it again complained #130 - Incorrect file format 'elgg_metastrings' Trying to find a way to repair it...

    By the way, I am not sure that my issue is specific to my 2.3.x based sites. I found one Elgg 2.3.5 based site which is not effected by this problem - transactionwise it is even more static than the other two, if it matters...

    I am suspecting this whole thing might have something to do with the countless system_log tables (hundreds if not several thousands of them) created by cron jobs, I think at some point it may have hit a threshold in mysql or so. It may also explain the fact that the problem did not occur immediately after setting up crons but after a few days, possibly indicating a buildup - if it has anything to do with this at all.


  • I am suspecting this whole thing might have something to do with the countless system_log tables (hundreds if not several thousands of them) created by cron jobs

    We've disabled the system log on all our sites already:

    elgg_unregister_event_handler('log', 'systemlog', 'system_log_default_logger');
    elgg_unregister_event_handler('all', 'all', 'system_log_listener');
  • @meril Thanks for the link. I had already looked into that discussion and as a mater of fact the myisamchk command was taken over from your posting.

    In my case, it was mostly the users_sessions table but there was at least one case also had the metastrings table.

    At the end, I had to rollback the sites from backup (they are incredibly static sites anyway :-) ).

    Since then, it happened only one and only with users_sessions table, which is easy to fix.

    Problem seems to be triggerd by a cron job (not minute or hourly). But as for the real cause, I am suspecting some integrity issue with the Debian 8 updates that I might have installed. Just a guess. Time to upgrade to clean Debian 9.