The real problem is that you hava a database excepction that the code can not show. In elgg 1.9 and above all the engine/database was fully rewritten, that's why is not happening there. I use 1.8.20 and have this problem, but usually is because the table is corrupt and have to repair it (usually the user sessions table).
I was just just wondering
Could you not just empty this table. I thought it was just keeping track of who is logged in. Of course it would log every one out that was in but if you did it at a quite time ????? on the other hand check, with someone who knows a bit more about this, and if this could cause any damage to your site, before even thinking about this solution.
Confirmed ;-)
I just emptied my sessions table => caused no problems
@JEd
(1) try phpMyAdin to empty table first
if not allowed.. delete and recreate table -- you do know how to ?
I have a similar problem with elgg_users_sessions. Table crashed and I had to repair it with the myisamchk --safe-recover elgg_users_sessions commande, easier methods for reparation failed. It took several hours to do it ! Tehn I discovered that there were more than 2 million records in the table ! Yes, two million and a half sessions recorded...
So I looked closer to understand why. For an unknown reason, the old sessions aren't been destroyed. Also for an unkonown reason, sessions continue to be created even if there is no "visible" activity in the site. About 900 records per hour. So, after some weeks, the table size becomes enormous, the garbage collector fails to optimize it and all that leads to a crash.
The other think I noticed, but I am not sure if this is the right way. Should the 'session' field of the 'elgg_users_sessions' table reflect the 'code' field of the 'elgg_users_entity' table ? I think so if I understood well the way the sessions are written in the database in the engine/lib/sessions.php. If this is so, the thing I noticed is that in my installation this doesn't happen. When I look with phpmyadmin and something like :
SELECT *
FROM elgg_users_sessions, elgg_users_entity
WHERE elgg_users_sessions.session = elgg_users_entity.code
it returns no result.
If my assumption that these two fields should be identical is right then I suppose that the destroy function doesn't work because it cant find the session to destroy in the elgg_users_sessions table.
Well, this should explain why this table grows until to explose, but it doen't explain why 1) sessions are written even if there is no "visible" activity and 2) why sessions are not written with the same reference in elgg_users_sessions and in elgg_users_entity
Any help will be greatly appreciated.
I have to mention that I am using elgg 1.5 and also I integrated it with two other external applications for a common login (elgg as master and the other applications as slaves). I desactivated the integration links to see if this was causing the problem, but it continues even when Elgg is alone.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.