Sessions table is lost after a system crash

(user)@webrt:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.24-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn’t find any fields in table ‘sessions’
Database changed
mysql>

When I try to connect to RT (from cli) I get similar error

RT couldn’t store your session.
This may mean that that the directory
‘/opt/rt3/var/session_data’
isn’t writable or a database table is missing or corrupt.

How do I fix it?

I am using RT 3.4.5 with Perl 5.8.6 and mysql 4.0.24

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

(user)@webrt:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.24-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn’t find any fields in table ‘sessions’
Database changed
mysql>

mysql> desc sessions;
ERROR 1016: Can’t open file: ‘sessions.MYI’. (errno: 145)

Looks like sessions table is gone? Do I need to recreate it ?

When I try to connect to RT (from cli) I get similar error

RT couldn’t store your session.
This may mean that that the directory
‘/opt/rt3/var/session_data’
isn’t writable or a database table is missing or corrupt.

How do I fix it?

I am using RT 3.4.5 with Perl 5.8.6 and mysql 4.0.24


Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

(user)@webrt:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.24-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn’t find any fields in table ‘sessions’
Database changed
mysql>

mysql> desc sessions;
ERROR 1016: Can’t open file: ‘sessions.MYI’. (errno: 145)

Looks like sessions table is gone? Do I need to recreate it ?

ls -al /usr/local/mysql/data/rt3
[…]

-rw-rw---- 1 mysql mysql 149122960 Apr 12 07:42 sessions.MYD
-rw-rw---- 1 mysql mysql 12666880 Apr 12 08:29 sessions.MYI

Is it possible that the sessions table is corrupted?

When I try to connect to RT (from cli) I get similar error

RT couldn’t store your session.
This may mean that that the directory
‘/opt/rt3/var/session_data’
isn’t writable or a database table is missing or corrupt.

How do I fix it?

I am using RT 3.4.5 with Perl 5.8.6 and mysql 4.0.24

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Asif Iqbal wrote:

(user)@webrt:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.24-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn’t find any fields in table ‘sessions’
Database changed
mysql>

When I try to connect to RT (from cli) I get similar error

RT couldn’t store your session.
This may mean that that the directory
‘/opt/rt3/var/session_data’
isn’t writable or a database table is missing or corrupt.

How do I fix it?
Have a look at the mysql.sql file in your setup folder of RT or download
rt and recreate the table.

Regards,

Joop

Asif Iqbal wrote:

(user)@webrt:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11 to server version: 4.0.24-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> use rt3;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Didn’t find any fields in table ‘sessions’
Database changed
mysql>

When I try to connect to RT (from cli) I get similar error

RT couldn’t store your session.
This may mean that that the directory
‘/opt/rt3/var/session_data’
isn’t writable or a database table is missing or corrupt.

How do I fix it?

Have a look at the mysql.sql file in your setup folder of RT or download rt
and recreate the table.

I do not see any mysql.sql file in the src dir of rt 3.4.5

(root)@webrt:/usr/src/rt-3.4.5# find . -type f | grep mysql
./etc/upgrade/3.1.0/acl.mysql
./etc/upgrade/3.1.0/schema.mysql
./etc/upgrade/3.3.0/acl.mysql
./etc/upgrade/3.3.0/schema.mysql
./etc/upgrade/3.3.11/acl.mysql
./etc/upgrade/3.3.11/schema.mysql
./etc/constraints.mysql
./etc/acl.mysql
./etc/schema.mysql

Regards,

Joop

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Asif Iqbal wrote:

    How do I fix it?

Have a look at the mysql.sql file in your setup folder of RT or
download rt and recreate the table.

I do not see any mysql.sql file in the src dir of rt 3.4.5
./etc/schema.mysql
Maybe I meant this file. Did you look at the sql file to determine if
they would be useful??

Regards,

Joop

Asif Iqbal wrote:

   How do I fix it?

Have a look at the mysql.sql file in your setup folder of RT or
download rt and recreate the table.

I do not see any mysql.sql file in the src dir of rt 3.4.5
./etc/schema.mysql

Maybe I meant this file. Did you look at the sql file to determine if they
would be useful??

I looked at it now. So I can just delete the sessions.MYI, sessions.MYD and
frm files and recreate the sessions table as in the schema? I am assuming it
wont break the RT

Regards,

Joop

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Asif Iqbal wrote:

   How do I fix it?

Have a look at the mysql.sql file in your setup folder of RT or
download rt and recreate the table.

I do not see any mysql.sql file in the src dir of rt 3.4.5
./etc/schema.mysql

Maybe I meant this file. Did you look at the sql file to determine if they
would be useful??

I looked at it now. So I can just delete the sessions.MYI, sessions.MYD and
frm files and recreate the sessions table as in the schema? I am assuming it
wont break the RT

mysqlcheck says this btw,

[…all OK…]
rt3.Users OK
rt3.sessions
warning : Table is marked as crashed and last repair failed
warning : 9 clients are using or haven’t closed the table properly
warning : Size of indexfile is: 12666880 Should be: 1024
error : Found too long record at 82812800
error : Corrupt

Regards,

Joop

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

Asif Iqbal wrote:

I looked at it now. So I can just delete the sessions.MYI,
sessions.MYD and frm files and recreate the sessions table as in the
schema? I am assuming it wont break the RT

mysqlcheck says this btw,

[…all OK…]
rt3.Users OK
rt3.sessions
warning : Table is marked as crashed and last repair failed
warning : 9 clients are using or haven’t closed the table properly
warning : Size of indexfile is: 12666880 Should be: 1024
error : Found too long record at 82812800
error : Corrupt
Make a backup or your RT database and remove the sessions table and
recreate it. How you should remove the corrupt sessions table I don’t
know for sure, thats whats the backup for in case things go really wrong.
I would try to drop the table and if that fails, remove the files from
that table. If things go wrong, use the backup. Better, restore the
backup on a backup machine and practice on the backup instead of the
original.

Regards,

Joop

Asif Iqbal wrote:

I looked at it now. So I can just delete the sessions.MYI,
sessions.MYD and frm files and recreate the sessions table as in the
schema? I am assuming it wont break the RT

mysqlcheck says this btw,

[…all OK…]
rt3.Users OK
rt3.sessions
warning : Table is marked as crashed and last repair failed
warning : 9 clients are using or haven’t closed the table properly
warning : Size of indexfile is: 12666880 Should be: 1024
error : Found too long record at 82812800
error : Corrupt

Make a backup or your RT database and remove the sessions table and
recreate it. How you should remove the corrupt sessions table I don’t know
for sure, thats whats the backup for in case things go really wrong.
I would try to drop the table and if that fails, remove the files from that
table. If things go wrong, use the backup. Better, restore the backup on a
backup machine and practice on the backup instead of the original.

yes drop the table and recreate based on the sessions schema worked.

thanks a lot

Regards,

Joop

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

mysqlcheck says this btw,

[…all OK…]
rt3.Users OK
rt3.sessions
warning : Table is marked as crashed and last repair failed
warning : 9 clients are using or haven’t closed the table properly
warning : Size of indexfile is: 12666880 Should be: 1024
error : Found too long record at 82812800
error : Corrupt

This happened to me the other day when the VM running our RT fell
over. I shut down the web interface, shut down mysql, and then used
myisamchk to repair the table:

myisamchk --max-record-length=1000000 --safe-recover /var/lib/mysql/
rtdb/sessions.MYI

I then restarted the database and apache, and all was well.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Tim,

I am curious. Are you using InnoDB tables or MyISAM tables?
I thought that RT needed InnoDB. Does it have a problem with
system crashes and recovery with InnoDB?

Just wondering.
KenOn Thu, Apr 23, 2009 at 06:31:10PM +0100, Tim Cutts wrote:

On 12 Apr 2009, at 11:51 am, Asif Iqbal wrote:

mysqlcheck says this btw,

[…all OK…]
rt3.Users OK
rt3.sessions
warning : Table is marked as crashed and last repair failed
warning : 9 clients are using or haven’t closed the table properly
warning : Size of indexfile is: 12666880 Should be: 1024
error : Found too long record at 82812800
error : Corrupt

This happened to me the other day when the VM running our RT fell
over. I shut down the web interface, shut down mysql, and then used
myisamchk to repair the table:

myisamchk --max-record-length=1000000 --safe-recover /var/lib/mysql/
rtdb/sessions.MYI

I then restarted the database and apache, and all was well.

Tim


The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Kenneth Marshall wrote:

Tim,

I am curious. Are you using InnoDB tables or MyISAM tables?
I thought that RT needed InnoDB. Does it have a problem with
system crashes and recovery with InnoDB?

Just wondering.
Ken

I was just about to say the same thing when this came in. I think you want
InnoDB tables, not MyISAM. In particular, large tables like the attachment
table will have problems, and frequently updated tables like the session
table will have crash recovery issues. The crash recovery in the InnoDB
backend is more robust, as is the indexing methodology.

– ============================
Tom Lahti
BIT Statement LLC

(425)251-0833 x 117
http://www.bitstatement.net/
– ============================

Kenneth Marshall wrote:

Tim,

I am curious. Are you using InnoDB tables or MyISAM tables?
I thought that RT needed InnoDB. Does it have a problem with
system crashes and recovery with InnoDB?

Just wondering.
Ken

I was just about to say the same thing when this came in. I think
you want
InnoDB tables, not MyISAM. In particular, large tables like the
attachment
table will have problems, and frequently updated tables like the
session
table will have crash recovery issues. The crash recovery in the
InnoDB
backend is more robust, as is the indexing methodology.

Preaching to the choir. In a default RT installation on MySQL, all
the tables are InnoDB except for the sessions table. I don’t know
why that particular table is MyISAM, and I don’t know whether there
would be any consequences of converting it.

Tim

The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.

Kenneth Marshall wrote:

Tim,

I am curious. Are you using InnoDB tables or MyISAM tables?
I thought that RT needed InnoDB. Does it have a problem with
system crashes and recovery with InnoDB?

Just wondering.
Ken

I was just about to say the same thing when this came in. I think
you want
InnoDB tables, not MyISAM. In particular, large tables like the
attachment
table will have problems, and frequently updated tables like the
session
table will have crash recovery issues. The crash recovery in the
InnoDB
backend is more robust, as is the indexing methodology.

Preaching to the choir. In a default RT installation on MySQL, all
the tables are InnoDB except for the sessions table. I don’t know
why that particular table is MyISAM, and I don’t know whether there
would be any consequences of converting it.

No consequences, it’s just legacy.

Tim


The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.