SQL Error : 1016 Can't open file: 'phpbb_sessions.MYI'

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
Locked
User avatar
mad72
Registered User
Posts: 74
Joined: Thu Mar 13, 2003 4:20 pm
Location: Milan, Italy
Contact:

SQL Error : 1016 Can't open file: 'phpbb_sessions.MYI'

Post by mad72 »

Hi again, I emptied the session table but this error came back again.

phpBB : Critical Error

Error creating new session

DEBUG MODE

SQL Error : 1016 Can't open file: 'phpbb_sessions.MYI' (errno: 145)

INSERT INTO phpbb_sessions (session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in, session_admin) VALUES ('8703f168b43a7e15a088969bb63a54c1', -1, 1129799919, 1129799919, '51d02419', 0, 0, 0)

Line : 172
File : sessions.php


the board is here: http://www.poverosub.com/forum5/

what can I do?

thank you for your help!
Marco

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69564
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Post by KevC »

Do a forum search for 1016. you'll find a lot of threads on how to fix this.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

User avatar
mad72
Registered User
Posts: 74
Joined: Thu Mar 13, 2003 4:20 pm
Location: Milan, Italy
Contact:

Post by mad72 »

the table was fixed using myisamchk but the problem persists (after 15 minutes the problem comes back).
We have about 4.600 users...

User avatar
mad72
Registered User
Posts: 74
Joined: Thu Mar 13, 2003 4:20 pm
Location: Milan, Italy
Contact:

Post by mad72 »

it works for 15 minutes only... then problem again.

Please, any solutions?

bye, Marco

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

Post by espicom »

Run the table repair twice; I have had numerous reports that 14x-series errors are rarely fixed in a single pass of a "REPAIR TABLE" query. It seems the first one fixes part of the problem, the second (or third, sometimes) finishes the process. If you don't, you can have a table do things like you're experiencing.

Alternatively, you can drop and recreate the sessions table, or try "REPAIR TABLE phpbb_sessions USE_FRM" for a type of repair that you can not do with myisamchk.
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

User avatar
mad72
Registered User
Posts: 74
Joined: Thu Mar 13, 2003 4:20 pm
Location: Milan, Italy
Contact:

Post by mad72 »

Hello,
Thank you for your quick reply. I tried everything you suggested but it did not fix it for good. After I run the fix script twice and repair table with USE_FRM option, the table seems ok. As soon as some user enters the forum I read the following running myisamchk:

Code: Select all

Checking MyISAM file: phpbb_sessions
Data records:       9   Deleted blocks:       0
myisamchk: warning: 1 client is using or hasn't closed the table properly
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check data record references index: 2
- check data record references index: 3
MyISAM-table 'phpbb_sessions' is usable but should be fixed
Then, after some other users entered the forum, this is the myisamchk error message:

Code: Select all

Checking MyISAM file: phpbb_sessions
Data records:      47   Deleted blocks:       0
myisamchk: warning: 1 client is using or hasn't closed the table properly
- check file-size
myisamchk: error: Size of datafile is: 2668              Should be: 2726
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
myisamchk: error: Found key at page 5120 that points to record outside datafile
MyISAM-table 'phpbb_sessions' is corrupted
Fix it using switch "-r" or "-o"
Now though the error message is different:

Code: Select all

SQL Error : 1034 Incorrect key file for table 's'; try to repair it

SELECT u.*, s.* FROM phpbb_sessions s, phpbb_users u WHERE s.session_id = 'da0518acd1d6582e0a743aa3863a0aa0' AND u.user_id = s.session_user_id

Line : 267
File : sessions.php
The database files have also been moved to a different hard drive to exclude any possible hardware issue. On the same server there are many other phpbb forums that work properly.

Is there anything else I could try?

Thanks

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

Post by espicom »

At this point, I would recommend dropping the existing table, and creating a new version of it:

Code: Select all

DROP TABLE IF EXISTS phpbb_sessions;
CREATE TABLE phpbb_sessions (
  session_id char(32) NOT NULL default '',
  session_user_id mediumint(8) NOT NULL default '0',
  session_start int(11) NOT NULL default '0',
  session_time int(11) NOT NULL default '0',
  session_ip char(8) NOT NULL default '0',
  session_page int(11) NOT NULL default '0',
  session_logged_in tinyint(1) NOT NULL default '0',
  session_admin tinyint(2) NOT NULL default '0',
  PRIMARY KEY  (session_id),
  KEY session_user_id (session_user_id),
  KEY session_id_ip_user_id (session_id,session_ip,session_user_id)
) TYPE=MyISAM;
This will make sure that everything is "up to snuff" with the table's internal structures.
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

Locked

Return to “2.0.x Support Forum”