Critacal Error message when trying to access forum

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
DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

Critacal Error message when trying to access forum

Post by DragonMom424 » Tue Feb 15, 2005 1:54 am

HI
Any help with this problem is much appreciated... I installed a BB about 3 months ago, managed to get it running with no problems until this past weekend. Nobody can access the forum, this is the message that comes up:

phpBB : Critical Error

Error creating new session

Our host is Ipower web (I read in the past that there have been problems with them). Anyone else experiencing problems, anyone have an answer, and keep in mind that I am clueless about code, debugging, etc. Thanx in advance for any help!!
DragonMom424

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

Post by espicom » Tue Feb 15, 2005 4:29 am

Code: Select all

repair table phpbb_sessions;
truncate table phpbb_sessions;
alter table phpbb_sessions type=myisam;
Try those three queries, in order, using your favourite tool for accessing the MySQL database, changing "phpbb_" to whatever prefix you used, if you changed it. The first will probably give you an error; HEAP tables, the default for the sessions table if you didn't configure the forum for MySQL 4.x, have a size limitation, and they don't support being repaired.

The second query will clear the table, and allow people to log in again.

The third, which should only be used if the first gave an error, will remove the size restriction.
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

DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

running a query

Post by DragonMom424 » Tue Feb 15, 2005 4:35 am

Thanx espicom...
I think your answer would help someone who has a clue.. unfurtunately it's not me! I guess my next step is to do a search thru the BB to see how to run a query (if that's what you call it!) I was lucky to get the forum up and running, but boy I'll feel good if I manage to fix it!
:?
DragonMom424

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

Post by espicom » Tue Feb 15, 2005 4:58 am

Queries are what make the world of dynamic site content go 'round, my girl! :)

Find out if your hosting provider has installed PHPMyAdmin. It's a web interface to let you do all sorts of mischief with your database that the forum software won't allow. It will be password-protected, and they should have given you log-in information SOMEWHERE. It has a button on it marked SQL, which will let you enter the queries I posted and execute them.

Barring that, you need "shell access", which will usually be provided using a tool called "putty" under Windows, "ssh" in Linux, Unix, or Mac OS-X. The instructions for that are a bit more involved...

But, here's a little program for you, to do it from your browser. Save the following as a file, call it something like "clear_sessions.php". Upload this file to your board's root directory (where the file config.php is), and execute it by entering your board's URL with "/clear_sessions.php" on the end. It will do the repairs for you...

Code: Select all

<?php
// Clear PHPBB sessions table, repairing if necessary

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'config.php');

// connect to the database server
$db = mysql_connect($dbhost,$dbuser,$dbpasswd);
if (!$db) die("Unable to connect to database!\n");

// select the PHPBB database
mysql_select_db($dbname,$db);

// Repair table, ignore errors
$tablequery = "repair table ".$table_prefix."sessions";
mysql_query($tablequery,$db);


// Clear table
$tablequery = "truncate table ".$table_prefix."sessions";
mysql_query($tablequery,$db);

echo "PHPBB sessions table cleared and repaired.";

// Remove slashes from next two lines to change table type to MYISAM
// $tablequery = "alter table ".$table_prefix."sessions type=myisam";
// mysql_query($tablequery,$db);

?>
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

DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

SQL and queries... brain hurts now

Post by DragonMom424 » Tue Feb 15, 2005 5:17 am

The good news (I think!) is that the server DOES had PHPmyadmin (this could be dangerous...) I think by looking at it that I'm over my head but hey I got the darned thing up and running (even got the logo where it belonged LOL) so I'll give this a shot... I guess the worst that can happen is it all goes away to wherever these things go when they disappear (the big database clearing house in the sky...)

There IS a button marked SQL and also a button market QUERY... Eeny meany miney mo, I'll let you know just how it goes..... (well it almost rhymed) Now I'm off to try your words of wisdom

BOOM

(and the meek shall inherit the earth....)

DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

what kind of script is it?

Post by DragonMom424 » Tue Feb 15, 2005 5:23 am

Um.... IT is asking me questions to which I have no answers!
IT wants to know what kind of file I'm creating, a perl script or a shell script... (and the difference would be... ) Thanx so much for your help and patience!

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

Post by espicom » Tue Feb 15, 2005 5:32 am

IT wants to know what kind of file I'm creating, a perl script or a shell script... (and the difference would be... )


Well, a perl script can be a shell script, but not the other way around... :)

What is asking you these questions, PHPMyAdmin? Normally it won't be so inquiring... just querying. :)

OK, don't use the Query button. It's complicated. Use the SQL button, because you can directly enter the queries I gave you, one at a time, and the GO button will give you the server's reaction to the query.
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

DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

Thank You Thank You Thank You!!!!!

Post by DragonMom424 » Tue Feb 15, 2005 5:57 am

espicom you're wonderful!!

I created that handy dandy little "clear_sessions.php" file and saved it as a shell script (I think... yeah that's what I did!) It worked like a charm! A little knowledge is a dangerous thing... Yup, I have just enough knowledge to be a danger to myself AND my website! Yay!

Thanx for all the help and especially the step-by-step instructions (sorta like talking to a 3rd grader LOL) I can now carry on in my unofficial role as "computer godess and fixer of all website problems". Someday they're gonna find out just how little I really know about this stuff...

Seriously, thanx :)
You really helped alot!
DragonMom

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

Post by espicom » Tue Feb 15, 2005 6:15 am

Well, I did forget to mention one thing... You should probably delete clear_sessions.php when you don't need it. Running it when not needed will knock anyone who is logged in off the board unnecessarily, and there are all kinds of :evil: people out there that would try running it just for the fun of it.
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

DragonMom424
Registered User
Posts: 10
Joined: Tue Feb 15, 2005 12:17 am

Post by DragonMom424 » Tue Feb 15, 2005 1:02 pm

Thanx, I'll do that, or move it to another dirctory so that I can use it again when/if necessary. One more question... Is there a reason that something like this happens? I mean, obviously you had a script ready to go that worked a charm, so it's something that happens fairly often (?). Hopefully it's got nothing to do with "outside sources". I guess the next thing to tackle is getting the board upgraded... I just noticed when rechecking the board that it's running version 2.0.2
Thanx to this board, I've discovered that I need to upgrade ASAP. Hopefully that'll go off without a hitch!!
Have a great day!
DragonMom

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

Post by espicom » Tue Feb 15, 2005 3:30 pm

is there a reason that this happens?


Usually. :)

Any number of things can happen to corrupt an index file. Most have to do with power or other glitches in the computer running MySQL. In the years we've been running MySQL, I've only had to repair indexes when a power supply failed, or someone did something stupid, like letting a disk run out of space (honest, I meant to remove those 500 unused log files!), or resetting the machine while a massive data posting is going on.

There are times when I'll move a files between machines (bringing up a new MySQL server), and force a rebuild on all indexes (about a thousand tables) before making it "live", just to avoid problems.

I have the scripts ready now because I was tired of watching all the messages go by where people didn't have the tools necessary to fo the simple fixes required, and I was bored enough one afternoon to write it (and fortunate enough to have another program handy to pull the bits and pieces out of...).
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

Caymill
Registered User
Posts: 11
Joined: Tue Jan 13, 2004 5:17 pm

Post by Caymill » Tue Feb 15, 2005 7:36 pm

I had a "cannot connect to database" after migrating hosts, and the "clear_sessions.php" made partly the trick.

justinh
Registered User
Posts: 2
Joined: Mon Jan 06, 2003 4:56 pm

thanks for that espicom

Post by justinh » Thu Feb 17, 2005 4:03 pm

I've just had exactly the same problem as DragonMom and your instructions were so clear it was sorted in a few moments.

Thanks - like DragonMom, I have no scripting ability or knowledge at all.
That cold, rising terror I felt has been replaced by smug satisfaction 8) as everyone in the office said "hey Justin you fixed the BBS!"

seriously, you're the star of my week.

Justin

al-kittin
Registered User
Posts: 3
Joined: Sun Feb 13, 2005 1:07 pm

Post by al-kittin » Sat Feb 19, 2005 11:18 am

w00p that worked for me too
thanks espicom (and dragonmom for askin) :)

lckrause
Registered User
Posts: 6
Joined: Mon Nov 10, 2003 4:02 pm

Post by lckrause » Wed Apr 12, 2006 9:20 pm

Script worked great for me. Thanks, espicom! :)

Lisa

Locked

Return to “2.0.x Support Forum”