DEBUG - Error Creating New Session »  Show posts from    to     

Icy Phoenix


Documentation And How To - DEBUG - Error Creating New Session



z3d0 [ Wed 23 Aug, 2006 11:18 ]
Post subject: DEBUG - Error Creating New Session
Often I'm told that the phpbb_session table is full and I must empty it manually to make the site work again. I don't know if you have my same problem, anyway here is the patch (that will be included in phpbb 3)

OPEN:

Code: [Hide]
  1. include/sessions.php 


FIND:

Code: [Hide]
  1. message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql); 


REPLACE WITH:

Code: [Hide]
  1. $error = TRUE;  
  2. if (SQL_LAYER == "mysql" || SQL_LAYER == "mysql4")  
  3. {  
  4. $sql_error = $db->sql_error($result);  
  5. if ($sql_error["code"] == 1114)  
  6. {  
  7. $result = $db->sql_query('SHOW TABLE STATUS LIKE "'.SESSIONS_TABLE.'"');  
  8. $row = $db->sql_fetchrow($result);  
  9. if ($row["Type"] == "HEAP")  
  10. {  
  11. if ($row["Rows"] > 550)  
  12. {  
  13. $delete_order = (SQL_LAYER=="mysql4") ? " ORDER BY session_time ASC" : "";  
  14. $db->sql_query("DELETE QUICK FROM ".SESSIONS_TABLE."$delete_order LIMIT 50");  
  15. }  
  16. else  
  17. {  
  18. $db->sql_query("ALTER TABLE ".SESSIONS_TABLE." MAX_ROWS=".($row["Rows"]+50));  
  19. }  
  20. if ($db->sql_query($sql))  
  21. {  
  22. $error = FALSE;  
  23. }  
  24. }  
  25. }  
  26. }  
  27. if ($error)  
  28. {  
  29. message_die(CRITICAL_ERROR, "Error creating new session", "", __LINE__, __FILE__, $sql);  


z3d0 [ Sat 26 Aug, 2006 23:58 ]
Post subject: Re: [Patch] Error Creating New Session
Even if I added this patch, the problem seemed not to be solved...so, as suggested here, I increased the MAX_ROWS of the table (that actually in phpbbxs are 550 ) with a query like this

Code: [Hide]
  1. ALTER TABLE phpbb_sessions MAX_ROWS = 2500; 


and now it seems work fine


Mighty Gorgon [ Sun 27 Aug, 2006 16:16 ]
Post subject: Re: [Patch] Error Creating New Session
Great suggestion!

I'm moving this to the Docs Section.

Thank you very much for this... many users will find this useful.


P.S.: Since it's not the first time you are suggesting me something really useful... you are upgraded to VIP with special access to Development section.


z3d0 [ Sun 27 Aug, 2006 18:19 ]
Post subject: Re: [Patch] Error Creating New Session
thx


KugeLSichA [ Sun 27 Aug, 2006 18:48 ]
Post subject: Re: [Patch] Error Creating New Session
hmm i little bit confused, should we all apply this? or only if we have errors with sessions?


z3d0 [ Sun 27 Aug, 2006 19:56 ]
Post subject: Re: [Patch] Error Creating New Session
It's up to you...untill you don't have problem with sessions, you shoudn't touch anything but if you want to prevent any problem, apply it


Mighty Gorgon [ Sun 27 Aug, 2006 21:10 ]
Post subject: Re: [Patch] Error Creating New Session
You're right... I quote this...
z3d0 wrote: [View Post]
It's up to you...untill you don't have problem with sessions, you shoudn't touch anything but if you want to prevent any problem, apply it


diegomak [ Fri 30 Mar, 2007 22:07 ]
Post subject: Re: [Patch] Error Creating New Session
Quote:
SQL Error : 1114 The table 'phpbb_sessions' is full

INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_user_agent, session_page, session_logged_in, session_admin) VALUES ('14d3ecbe31ca3d5e9dcc308160f9b4ac', 4, 1175281452, 1175281452, 'c9e3b416', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.8.1.3) Gecko/20070309 Firefox/2.


I have that problem, which solution must implement
Code: [Hide] [Select]
ALTER TABLE phpbb_sessions MAX_ROWS = 2500;
this or the solution in the first topic??

I have IP, the firts topic is for IP? or XS?

thanks, i don't want have this problem with full table again


diegomak [ Sat 31 Mar, 2007 16:53 ]
Post subject: Re: [Patch] Error Creating New Session
Hmm one day more after truncate the table are full again

Now I apply the patch, and I hope that don't have this problem again


thanks thanks Z3do


diegomak [ Mon 14 May, 2007 15:06 ]
Post subject: Re: [Patch] Error Creating New Session
ok, for 1 month this solution work, but now my website have more than 1200 users and the error appear again.

I believed that the solution is

Code: [Hide]
  1. ALTER TABLE phpbb_sessions MAX_ROWS = 9999;  


because of 2500 register are reached easily in my website in this moments.


my question now is this?

when my website grows again, this value was small again.

what is the maximum value than I can set up


thanks




EDIT:

AND waht about this table phpbb_sessions_keys¿???

i can truncate this table too, or if I do that, I will have troubles??


Mighty Gorgon [ Tue 15 May, 2007 23:47 ]
Post subject: Re: [Patch] Error Creating New Session
Your table is HEAP or MyISAM?


diegomak [ Sat 19 May, 2007 19:02 ]
Post subject: Re: [Patch] Error Creating New Session
is heap MG, I will that with heap table this problem don't appear again but

now 1300 users

thanks, for now 9999 rows works


Mighty Gorgon [ Sun 20 May, 2007 15:38 ]
Post subject: Re: [Patch] Error Creating New Session
diegomak wrote: [View Post]
is heap MG, I will that with heap table this problem don't appear again but

now 1300 users

thanks, for now 9999 rows works

Convert it to MyISAM.


diegomak [ Wed 30 May, 2007 01:38 ]
Post subject: Re: [Patch] Error Creating New Session
Mighty Gorgon wrote: [View Post]

Convert it to MyISAM.


Mighty Gorgon wrote: [View Post]
I've edited the code to Icy Phoenix.
Anyway you may even decide to convert the table from HEAP to MyISAM.
HEAP type has the advantage to remain loaded in memory, so SQL are a bit faster, but MyISAM should not have the problem listed above.
I use MyISAM...



I don`t know how do that.
but now, I ask,
in the final version(1.1.0.15) you do that(myISAM table??)
in the final version I need apply this patch???(in the first topic)

jeje my forum around 1800 users now


Mighty Gorgon [ Wed 30 May, 2007 12:17 ]
Post subject: Re: [Patch] Error Creating New Session
If you don't know how to do it... don't do it...

On a clean installation sessions table is MyISAM.

I won't convert tables with the upgrade script, because it may leads to some problems if not done properly.




Powered by Icy Phoenix