sessions.php error

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: sessions.php error

Post by karlsemple » Mon Mar 19, 2007 3:35 am

Agent F wrote: would it be helpful to tell you of all the mods i have installed?



Not really, without knowing what is causing the message_die error it is near impossible to start with a solution, to be honest that is the most useless error in history 8O


EDIT: download and install this and then report back with the new error message :)
http://www.ktuk.net/phpBB3/viewtopic.php?f=18&t=2187
Image

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Mon Mar 19, 2007 4:00 am

I just want to point out the edit in my previous post in case you missed it.

edit: ok, i see you just edited your post too. i'll let you know in a few minutes.
Image

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: sessions.php error

Post by karlsemple » Mon Mar 19, 2007 4:03 am

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


Try this then to empty the session table and then test :)
  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[] = "TRUNCATE TABLE " . SESSIONS_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
Image

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Mon Mar 19, 2007 4:16 am

Alright, i used that mod that you posted then I made the second fix file that you posted and ran it. This is what is displayed:
Critical Error!
message_die() was called multiple times.
--------------------------------------------------------------------------------
Error #1
Report:
Query 1: Ran successfully

All queries have been run. If any errors came up above, be sure to post the report in your topic on phpBB.com.
You should now delete this file
--------------------------------------------------------------------------------
Error #2
Error doing DB query userdata row fetch

Line : 89
File : /home/therscbc/public_html/forum/includes/sessions.php
SQL : 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'


edit: Now the forum folder is displaying the same error as the main site again.
Image

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Mon Mar 19, 2007 9:02 am

This is the latest error:
ERROR: Database error.
Cannot execute the query: SELECT pt.post_text, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid FROM phpbb_forums f, phpbb_topics t, phpbb_users u, phpbb_posts p, phpbb_posts_text pt WHERE pt.post_id = p.post_id AND f.forum_id = p.forum_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id ORDER BY p.post_time DESC LIMIT 0,5
MySql Error returned: Got error 127 from table handler
MySql Error code: 1030


edit: when i open up the database, i get an error that says "#1016 - Can't open file: 'phpbb_confirm.MYI'. (errno: 145) " so the database shows a list of the tables and stops at that one and doesn't show the tables after the phpbb_confirm table. Is there a script i can run to fix my database?
Image

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Mon Mar 19, 2007 6:42 pm

Could i get more assistance on my problem please? My forum has been down for 3 days now and I don't know what to do next.
Image

User avatar
karlsemple
Former Team Member
Posts: 39802
Joined: Mon Nov 01, 2004 8:54 am
Location: Hereford, UK
Contact:

Re: sessions.php error

Post by karlsemple » Mon Mar 19, 2007 6:44 pm

Have you tried running repairs on all your database tables via phpmyadmin?
Image

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Mon Mar 19, 2007 9:22 pm

I have done the check/repair on the database and it tells me that phpbb_sessions has a Warning. So i click repair and it says this, "Myisamchk on table phpbb_sessions completed. If the table is still inoperable, contact support for further assistance."
Then i go and check it again and the same warning comes up.

When i open the database in phpMyAdmin, I get this error:
Error
SQL query:

SELECT COUNT( * ) AS num
FROM `therscbc_rscb`.`phpbb_confirm`

MySQL said:

#1016 - Can't open file: 'phpbb_confirm.MYI'. (errno: 145)


It lists the tables in alphabetic order but when it gets to this table, it stops because this table has an error. I can't even click Browse or Delete on this table like i can on the tables listed above it.
Image

rvmomma
Registered User
Posts: 768
Joined: Fri Mar 09, 2007 5:23 pm

Re: sessions.php error

Post by rvmomma » Mon Mar 19, 2007 9:56 pm

this has gone past anything you can fix. contact your host and tell them the database server is having a problem.

I would get a complete backup first, just in case they mess it up and lose all your data.

do NOT do the backup from the admin panel, use phpmyadmin or similar to be sure you get a complete backup.

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Tue Mar 20, 2007 1:02 am

alright, i have a complete backup from phpMyAdmin and I will contact my host. Thanks for your help guys.
Image

rvmomma
Registered User
Posts: 768
Joined: Fri Mar 09, 2007 5:23 pm

Re: sessions.php error

Post by rvmomma » Tue Mar 20, 2007 5:32 am

it is time to contact your host,

having this many database problems means that your host is having problems with their server.

try to make a complete backup first, just in case the host messes up.

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: sessions.php error

Post by espicom » Tue Mar 20, 2007 2:08 pm

Fixing MySQL 1016/1030 errors

The fact that you are having errors on multiple tables says that something happened on the MySQL server, that the host should look into and fix. It was probably shut down incorrectly at some point in the last few days, causing this. The "USE_FRM" repair mentioned in the above link can help with this sometimes, but it would seem that your host needs to do some maintenance on the server itself.
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

Agent F
Registered User
Posts: 201
Joined: Fri Sep 15, 2006 3:28 am
Location: phpbb_users

Re: sessions.php error

Post by Agent F » Tue Mar 20, 2007 2:28 pm

Alright, so my host has become unresponsive. We have tried submitting trouble tickets to them and even emails, but nothing back.

I tried running your script espicom, but the page keeps coming up as the Page Cannot Be Displayed. I checked the url, the location that i uploaded it to, the filename, and I still cannot load the page that your script says to do.
Image

espicom
Registered User
Posts: 17905
Joined: Wed Dec 22, 2004 1:14 am
Location: Woodstock, IL

Re: sessions.php error

Post by espicom » Tue Mar 20, 2007 2:39 pm

"Page cannot be displayed" means you're not properly dealing with the security check in the script. Remove these lines, but you better remove the script after using it:

Code: Select all

// verify that we're supposed to run
// change 'XX42m3' to something unique for your site, so it will only
// execute if you call it as 'http://mysite.com/fixtables.php?XX42m3=1'
if (!isset($_GET['XX42m3']))
{
	header("Location: http://127.0.0.1/");
	die();
}
Jeff
Fixing 1016/1030/1034 Errors | (obsolete link) | MySQL 4.1/5.x Client Error | phpBBv2 Logo in ACP
Support requests via PM are ignored!
"To be fully alive is to feel that everything is possible." - Eric Hoffer

golf25radioman
Registered User
Posts: 76
Joined: Sun Dec 12, 2004 3:26 am
Location: So. California
Contact:

Re: sessions.php error

Post by golf25radioman » Tue Mar 20, 2007 7:11 pm

karlsemple wrote:
  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

I started having similar problems, tried uploading fresh copies of the offending .php files mentioned in the errors (all were generated during attempts at posts - the first came from a large post). I copied your fix.php code, uploaded and ran it and the following results:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /data/12/1/128/6/1128658/user/1196188/htdocs/phpBB2/fix.php on line 5

Before I start attempting to fix anything more (by uploading files mentioned in errors), does the above error give any guideance on what I should do next? BTW, this is on my 2ndbn5thmarines.com site - the other seems fine, and both are on the same server.

Thanks...

Locked

Return to “2.0.x Support Forum”