Page 1 of 3

sessions.php error

Posted: Mon Mar 19, 2007 12:16 am
by Agent F
For a reason unknowing to me, I am receiving this error on my site. Can someone give me some idea on how to fix this error. Here it is:
phpBB : Critical Error

Error doing DB query userdata row fetch

DEBUG MODE

SQL Error : 1030 Got error 127 from table handler

SELECT u.* FROM phpbb_users u, phpbb_sessions_keys k WHERE u.user_id = 6 AND u.user_active = 1 AND k.user_id = u.user_id AND k.key_id = '6fe452f89bc1206f20a421f160126e44'

Line : 89
File : sessions.php

Re: sessions.php error

Posted: Mon Mar 19, 2007 12:32 am
by techwizz78
Looks like a mysql error or a db error.

What did you do? Must have changed something?

Its unable to select that user from the db. Basically.

Re: sessions.php error

Posted: Mon Mar 19, 2007 12:39 am
by Agent F
Neither I, nor the other 2 Administrators of my forum have touched the database. One of them even replaces the db with an older copy to see if it would work, but it didn't. I get this error on the index page of the forum.

If it isn't a database error, how can I fix the mySQL error or is that something on my host's end?

Re: sessions.php error

Posted: Mon Mar 19, 2007 12:56 am
by geocator
Run the following query in phpmyadmin:

Code: Select all

REPAIR phpbb_sessions_keys;

Re: sessions.php error

Posted: Mon Mar 19, 2007 12:58 am
by nycore
Ive been getting these same errors a few times per day since I upgraded to the latest version of phpbb

To fix it you go into the database (using phpmyadmin for example) with:

repair table phpbb_sessions

For me it doesnt stay fixed but usually it works for a long time

Re: sessions.php error

Posted: Mon Mar 19, 2007 1:08 am
by techwizz78
Well... you could always shut the site down... .backup the db... and do clean install... then overwrite the new db with the old one.

Re: sessions.php error

Posted: Mon Mar 19, 2007 1:37 am
by rvmomma
yes, and if your car gets a flat, you could just blow it up and get a new one.

that is not very good advice in this situation. as a matter of fact , that is rarely necessary for any reason.

Re: sessions.php error

Posted: Mon Mar 19, 2007 1:54 am
by techwizz78
rvmomma wrote: yes, and if your car gets a flat, you could just blow it up and get a new one.

that is not very good advice in this situation. as a matter of fact , that is rarely necessary for any reason.



It takes... 4 minutes....

Can you buy a car for 4 minutes worth or work? You make some $$$ if thats the case.

What do you do by the way?

He's tried other solutions...in this case that may be the quicker solution. He's upgraded... its not working.

A clean install may be the "quickest" way to deal with this randomly occuring error. 8O

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:10 am
by Agent F
within phpMyAdmin, how do I run the query? I logged in and selected the main database that we use for the forum. Then i went into Query and in the SQL query on database test textbox, pasted the code and Submitted the form. Then i am told "You have to choose at least one column to display." I do not know anything really about databases or phpMyAdmin so could you please walk me through and dumb it down.

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:19 am
by karlsemple
  1. Create a fix.php file with the following:

    Code: Select all

    <?php
    define('IN_PHPBB', true);
    include('./extension.inc');
    include('./common.'.$phpEx);
    $page_title = 'phpBB Fix';
    
    $sql = array();
    $sql[] = "REPAIR TABLE " . SESSIONS_KEYS_TABLE . "";
    
    
    $sql_count = count($sql);
    for( $i = 0; $i < $sql_count; $i++ )
    {
       if ( !($result = $db->sql_query($sql[$i])) )
       $echo .= '<b>Query ' . ($i+1) . ': </b><font color="red"><b>Error (' . mysql_error() . ')</b></font><br />';
       else
       $echo .= '<b>Query ' . ($i+1) . ': </b><font color="green"><b>Ran successfully</b></font><br />';
    }
    message_die(GENERAL_MESSAGE, "<table width=\"80%\" class=\"forumline\"><tr><td><u><b>Report:</b></u><br />$echo<br /><br />All queries have been run. If any errors came up above, be sure to post the report in your topic on phpBB.com.<br /><b>You should now delete this file</b></td><tr></table>");
    ?>
  2. Upload the file to your board's root folder (the one with config.php)
  3. Run it by navigating to the file in your browser (ex. http://www.yoursite.com/phpBB2/fix.php)
  4. If any errors come up, post the report here.
  5. Be sure to delete the file; don't leave it on your server

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:23 am
by Agent F
I ran the file and this what was displayed:

message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:26 am
by karlsemple
Agent F wrote: I ran the file and this what was displayed:

message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?



you dont have the install and contrib folders still present do you?

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:27 am
by Agent F
of course not. I needed to remove those during the installation process.

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:31 am
by karlsemple
It appears that the script has fixed the sessions_key error but there is another problem with the forum which is causing the message_die error, there is a mod which will give more detail about the problem.....if I can find a working download link for it seens as our mod section is still not working

Re: sessions.php error

Posted: Mon Mar 19, 2007 3:32 am
by Agent F
would it be helpful to tell you of all the mods i have installed?

edit: now my forum is displaying a different error then my main page. I am using a portal system on my site called mkportal.

The main area of the site displayes the error posted above, but the forum index shows this message:
phpBB : Critical Error

Error creating new session

DEBUG MODE

SQL Error : 1062 Duplicate entry '-1' for key 2

INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin) VALUES ('a9d62b5476e48d5477a84171c59be944', -1, 1174275105, 1174275105, 'a139d572', 0, 0, 0)

Line : 187
File : sessions.php