Problem running RT 3.2.1 with Apache 2.x & FastCGI

Hi All,

Just upgrading from RT 3.0 on Apache 1.x, mod_perl & MySQL to RT 3.2.1
on Apache 2.x, FastCGI & PostgreSQL (quite an upgrade, huh?). I had
reasons for switching to PostgreSQL. The server is running PostgreSQL
7.3.x and MySQL 3.x. RT requires MySQL 4.x (or later) or PostgreSQL 7.2
(or later). It seemed like a much bigger job to upgrade MySQL (just
incase anything else broke) to 4.x than to just convert the RT database
to PostgreSQL, so I did that.

I did run the upgrade scripts in etc/upgrade following the RT install.

After fulfilling all the Perl module requirements, and installing
FastCGI, I’m ready to test RT. The virtualhost stanza looks like this:

ServerName support.domain.com DocumentRoot /path/to/rt3/share/html AddHandler fastcgi-script fcgi Alias /NoAuth/images/ /path/to/rt3/share/html/NoAuth/images/ ScriptAlias / /path/to/rt3/bin/mason_handler.fcgi/ AddDefaultCharset UTF-8 SetHandler fastcgi-script

… and the FastCGI settings in httpd.conf are:

LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp
FastCgiServer /path/to/rt3/bin/mason_handler.fcgi

Anyway, the bottom line is in the Apache logs I’m getting the following
error when trying to access support.domain.com:

[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI: comm
with server “/path/to/rt3/bin/mason_handler.fcgi” aborted: idle timeout
(30 sec)
[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI:
incomplete headers (0 bytes) received from server “/path/to/rt3/bin/
mason_handler.fcgi”

… and on the browser just repots back an Internal Server Error.

I did some google’ing, and found I gotta switch the first line of mason.
fcgi to suidperl, which I did, but it didn’t help (restarted Apache
too). The only other match I got from google was somebody having the
same issue on MacOSX, but Linux supports setuid perl so it’s not the
same scenario.

Any help would be greatly appreciated.

Regards,
Gonzalo

Hi again,

Just wanted to add that for some reason, /var/log/httpd/error_log showed
the real problem after a while which was that there was no entry in
pg_hba.conf for 127.0.0.1 and the RT user. Anyway, after adding the
appropriate entry, I’m getting somewhere! The new problem is:

                          System error

error:
RT Couldn’t write to session
directory ‘/path/to/rt3/var/
session_data’: DBD::Pg::st execute
failed: ERROR: ExecInsert: Fail to
add null value in not null attribute
lastupdated at /usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm line 44.

Stack:
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:530]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:477]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/path/to/rt3/share/html/
autohandler:57]
. Check that this dir ectory’s
permissions are correct. at /path/
to/rt3/share/html/Elements/
SetupSessionCookie line 67.

I don’t think the problem is the session directory as Apache has full
write permissions to it. For some reason it’s trying to insert a null
value into a field that doesn’t allow null values (???).

Any ideas??

Thanks in advance.

Regards,
GonzaloOn Sat, 2004-07-17 at 23:47 +1000, Gonzalo Servat wrote:

Hi All,

Just upgrading from RT 3.0 on Apache 1.x, mod_perl & MySQL to RT 3.2.1
on Apache 2.x, FastCGI & PostgreSQL (quite an upgrade, huh?). I had
reasons for switching to PostgreSQL. The server is running PostgreSQL
7.3.x and MySQL 3.x. RT requires MySQL 4.x (or later) or PostgreSQL 7.2
(or later). It seemed like a much bigger job to upgrade MySQL (just
incase anything else broke) to 4.x than to just convert the RT database
to PostgreSQL, so I did that.

I did run the upgrade scripts in etc/upgrade following the RT install.

After fulfilling all the Perl module requirements, and installing
FastCGI, I’m ready to test RT. The virtualhost stanza looks like this:

ServerName support.domain.com DocumentRoot /path/to/rt3/share/html AddHandler fastcgi-script fcgi Alias /NoAuth/images/ /path/to/rt3/share/html/NoAuth/images/ ScriptAlias / /path/to/rt3/bin/mason_handler.fcgi/ AddDefaultCharset UTF-8 SetHandler fastcgi-script

… and the FastCGI settings in httpd.conf are:

LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp
FastCgiServer /path/to/rt3/bin/mason_handler.fcgi

Anyway, the bottom line is in the Apache logs I’m getting the following
error when trying to access support.domain.com:

[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI: comm
with server “/path/to/rt3/bin/mason_handler.fcgi” aborted: idle timeout
(30 sec)
[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI:
incomplete headers (0 bytes) received from server “/path/to/rt3/bin/
mason_handler.fcgi”

… and on the browser just repots back an Internal Server Error.

I did some google’ing, and found I gotta switch the first line of mason.
fcgi to suidperl, which I did, but it didn’t help (restarted Apache
too). The only other match I got from google was somebody having the
same issue on MacOSX, but Linux supports setuid perl so it’s not the
same scenario.

Any help would be greatly appreciated.

Regards,
Gonzalo


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Hi yet again :slight_smile:

Responding to my post one more time. It seems like the problem is that
the PostgreSQL schema has the sessions table defined like so:

CREATE TABLE sessions (
id char(32) NOT NULL,
a_session bytea,
LastUpdated TIMESTAMP not null default current_timestamp,
PRIMARY KEY (id)

);

As you can see by the error in my previous email, it had an error
writing to some table (I’m guessing the sessions table) as the
“LastUpdated” value was blank. Looking at this schema file the
LastUpdated column says NOT NULL.
On the mysql schema, the sessions table is defined as:

CREATE TABLE sessions (
id char(32) NOT NULL,
a_session LONGTEXT,
LastUpdated TIMESTAMP,
PRIMARY KEY (id)
);

As you can see LastUpdated is not set to “NOT NULL”. What I’m wondering
is whether the “default current_timestamp” in the Pg schema makes it
auto-insert the current timestamp? In which case it shouldn’t have spat
out the error in my previous email.

Anyway, I’m now connecting to my RT3 MySQL 3.x database and it works
now, so it’s definately something DB related. I’d like to use Pg instead
of mysql, simply because RT3 docs all recommend using MySQL 4.x and I
rather not upgrade if I can get away with using PostgreSQL.

I’d really appreciate some help on this one. I’ve come a long way to get
RT installed with Apache2, FastCGI + custom Perl compile after ironing
out a million and one problems so if I can just iron out this last one,
I should have a working RT3 instance :slight_smile:

Regards,
GonzaloOn Sun, 2004-07-18 at 14:28 +1000, Gonzalo Servat wrote:

Hi again,

Just wanted to add that for some reason, /var/log/httpd/error_log showed
the real problem after a while which was that there was no entry in
pg_hba.conf for 127.0.0.1 and the RT user. Anyway, after adding the
appropriate entry, I’m getting somewhere! The new problem is:

                          System error

error:
RT Couldn’t write to session
directory ‘/path/to/rt3/var/
session_data’: DBD::Pg::st execute
failed: ERROR: ExecInsert: Fail to
add null value in not null attribute
lastupdated at /usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm line 44.

Stack:
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:530]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:477]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/path/to/rt3/share/html/
autohandler:57]
. Check that this dir ectory’s
permissions are correct. at /path/
to/rt3/share/html/Elements/
SetupSessionCookie line 67.

I don’t think the problem is the session directory as Apache has full
write permissions to it. For some reason it’s trying to insert a null
value into a field that doesn’t allow null values (???).

Any ideas??

Thanks in advance.

Regards,
Gonzalo

On Sat, 2004-07-17 at 23:47 +1000, Gonzalo Servat wrote:

Hi All,

Just upgrading from RT 3.0 on Apache 1.x, mod_perl & MySQL to RT 3.2.1
on Apache 2.x, FastCGI & PostgreSQL (quite an upgrade, huh?). I had
reasons for switching to PostgreSQL. The server is running PostgreSQL
7.3.x and MySQL 3.x. RT requires MySQL 4.x (or later) or PostgreSQL 7.2
(or later). It seemed like a much bigger job to upgrade MySQL (just
incase anything else broke) to 4.x than to just convert the RT database
to PostgreSQL, so I did that.

I did run the upgrade scripts in etc/upgrade following the RT install.

After fulfilling all the Perl module requirements, and installing
FastCGI, I’m ready to test RT. The virtualhost stanza looks like this:

ServerName support.domain.com DocumentRoot /path/to/rt3/share/html AddHandler fastcgi-script fcgi Alias /NoAuth/images/ /path/to/rt3/share/html/NoAuth/images/ ScriptAlias / /path/to/rt3/bin/mason_handler.fcgi/ AddDefaultCharset UTF-8 SetHandler fastcgi-script

… and the FastCGI settings in httpd.conf are:

LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp
FastCgiServer /path/to/rt3/bin/mason_handler.fcgi

Anyway, the bottom line is in the Apache logs I’m getting the following
error when trying to access support.domain.com:

[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI: comm
with server “/path/to/rt3/bin/mason_handler.fcgi” aborted: idle timeout
(30 sec)
[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI:
incomplete headers (0 bytes) received from server “/path/to/rt3/bin/
mason_handler.fcgi”

… and on the browser just repots back an Internal Server Error.

I did some google’ing, and found I gotta switch the first line of mason.
fcgi to suidperl, which I did, but it didn’t help (restarted Apache
too). The only other match I got from google was somebody having the
same issue on MacOSX, but Linux supports setuid perl so it’s not the
same scenario.

Any help would be greatly appreciated.

Regards,
Gonzalo


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

What the heck, I’ll solve it myself :slight_smile:

What I ended up doing was using a script called My2Pg.pl
(http://www.omnistarinc.com/~fonin/downloads.php) and just taking out
all the SQL that creates tables, indexes & sequences. Instead, I created
a blank PostgreSQL database, inserted the schema.Pg (/path/to/rt3/etc/
schema.Pg) and populated the tables with the data converted by My2Pg.pl
(minus the SQL that creates the tables, indexes & sequences) and done!
Worked great.

OT to this thread, but does anyone know where one can find a copy of the
RT contrib script to delete tickets? If it’s not available anymore, what
needs to be done to delete a ticket? I’ve got a whole bunch of test &
spam emails I rather not have taking up space in my DB.

BTW, the RT WiKi has a page on Mysql2Pg but if you read into it you can
see that it’s actually Pg2Mysql. Maybe the page should be renamed?

Regards,
GonzaloOn Sun, 2004-07-18 at 17:49 +1000, Gonzalo Servat wrote:

Hi yet again :slight_smile:

Responding to my post one more time. It seems like the problem is that
the PostgreSQL schema has the sessions table defined like so:

CREATE TABLE sessions (
id char(32) NOT NULL,
a_session bytea,
LastUpdated TIMESTAMP not null default current_timestamp,
PRIMARY KEY (id)

);

As you can see by the error in my previous email, it had an error
writing to some table (I’m guessing the sessions table) as the
“LastUpdated” value was blank. Looking at this schema file the
LastUpdated column says NOT NULL.
On the mysql schema, the sessions table is defined as:

CREATE TABLE sessions (
id char(32) NOT NULL,
a_session LONGTEXT,
LastUpdated TIMESTAMP,
PRIMARY KEY (id)
);

As you can see LastUpdated is not set to “NOT NULL”. What I’m wondering
is whether the “default current_timestamp” in the Pg schema makes it
auto-insert the current timestamp? In which case it shouldn’t have spat
out the error in my previous email.

Anyway, I’m now connecting to my RT3 MySQL 3.x database and it works
now, so it’s definately something DB related. I’d like to use Pg instead
of mysql, simply because RT3 docs all recommend using MySQL 4.x and I
rather not upgrade if I can get away with using PostgreSQL.

I’d really appreciate some help on this one. I’ve come a long way to get
RT installed with Apache2, FastCGI + custom Perl compile after ironing
out a million and one problems so if I can just iron out this last one,
I should have a working RT3 instance :slight_smile:

Regards,
Gonzalo

On Sun, 2004-07-18 at 14:28 +1000, Gonzalo Servat wrote:

Hi again,

Just wanted to add that for some reason, /var/log/httpd/error_log showed
the real problem after a while which was that there was no entry in
pg_hba.conf for 127.0.0.1 and the RT user. Anyway, after adding the
appropriate entry, I’m getting somewhere! The new problem is:

                          System error

error:
RT Couldn’t write to session
directory ‘/path/to/rt3/var/
session_data’: DBD::Pg::st execute
failed: ERROR: ExecInsert: Fail to
add null value in not null attribute
lastupdated at /usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm line 44.

Stack:
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:530]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session.
pm:477]
[/usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm:44]
[/path/to/rt3/share/html/
autohandler:57]
. Check that this dir ectory’s
permissions are correct. at /path/
to/rt3/share/html/Elements/
SetupSessionCookie line 67.

I don’t think the problem is the session directory as Apache has full
write permissions to it. For some reason it’s trying to insert a null
value into a field that doesn’t allow null values (???).

Any ideas??

Thanks in advance.

Regards,
Gonzalo

On Sat, 2004-07-17 at 23:47 +1000, Gonzalo Servat wrote:

Hi All,

Just upgrading from RT 3.0 on Apache 1.x, mod_perl & MySQL to RT 3.2.1
on Apache 2.x, FastCGI & PostgreSQL (quite an upgrade, huh?). I had
reasons for switching to PostgreSQL. The server is running PostgreSQL
7.3.x and MySQL 3.x. RT requires MySQL 4.x (or later) or PostgreSQL 7.2
(or later). It seemed like a much bigger job to upgrade MySQL (just
incase anything else broke) to 4.x than to just convert the RT database
to PostgreSQL, so I did that.

I did run the upgrade scripts in etc/upgrade following the RT install.

After fulfilling all the Perl module requirements, and installing
FastCGI, I’m ready to test RT. The virtualhost stanza looks like this:

ServerName support.domain.com DocumentRoot /path/to/rt3/share/html AddHandler fastcgi-script fcgi Alias /NoAuth/images/ /path/to/rt3/share/html/NoAuth/images/ ScriptAlias / /path/to/rt3/bin/mason_handler.fcgi/ AddDefaultCharset UTF-8 SetHandler fastcgi-script

… and the FastCGI settings in httpd.conf are:

LoadModule fastcgi_module modules/mod_fastcgi.so
FastCgiIpcDir /tmp
FastCgiServer /path/to/rt3/bin/mason_handler.fcgi

Anyway, the bottom line is in the Apache logs I’m getting the following
error when trying to access support.domain.com:

[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI: comm
with server “/path/to/rt3/bin/mason_handler.fcgi” aborted: idle timeout
(30 sec)
[Sat Jul 17 23:43:59 2004] [error] [client 209.50.252.138] FastCGI:
incomplete headers (0 bytes) received from server “/path/to/rt3/bin/
mason_handler.fcgi”

… and on the browser just repots back an Internal Server Error.

I did some google’ing, and found I gotta switch the first line of mason.
fcgi to suidperl, which I did, but it didn’t help (restarted Apache
too). The only other match I got from google was somebody having the
same issue on MacOSX, but Linux supports setuid perl so it’s not the
same scenario.

Any help would be greatly appreciated.

Regards,
Gonzalo


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

At 11:46 AM 7/18/2004, Gonzalo Servat wrote:

OT to this thread, but does anyone know where one can find a copy of the
RT contrib script to delete tickets?

RTx::Shredder is available via CPAN.

[snip happens]

BTW, the RT WiKi has a page on Mysql2Pg but if you read into it you can
see that it’s actually Pg2Mysql. Maybe the page should be renamed?

Go for it. It is a wiki after all. :slight_smile:

Michael

Michael S. Liebman m-liebman@northwestern.edu
http://msl521.freeshell.org/
“I have vision and the rest of the world wears bifocals.”
-Paul Newman in “Butch Cassidy & the Sundance Kid”

The wiki has the shreader in the contrib section.

Thanks Bernacle.

Interesting way of using the script. It deletes all tickets before
(where argument is a date). Isn’t there a nicer script where
you can delete by ticket #? (or a range of tickets)

Gonzalo

I’ve run into this with DBD::Pg 1.3x and mod_perl. Try DBD::Pg 1.22
which is the last version I know to work well and see if it goes away.
None of my production servers has any DBD::Pg newer than that.

Basically, I find the DBD::Pg 1.3x loses values from placeholders and
tries to insert NULLs where it should be inserting real values.On Jul 18, 2004, at 12:28 AM, Gonzalo Servat wrote:

error:
RT Couldn’t write to session
directory ‘/path/to/rt3/var/
session_data’: DBD::Pg::st execute
failed: ERROR: ExecInsert: Fail to
add null value in not null attribute
lastupdated at /usr/local/lib/perl5/
site_perl/5.8.4/Apache/Session/
Store/DBI.pm line 44.

I’ve run into this with DBD::Pg 1.3x and mod_perl. Try DBD::Pg 1.22
which is the last version I know to work well and see if it goes away.
None of my production servers has any DBD::Pg newer than that.

Basically, I find the DBD::Pg 1.3x loses values from placeholders and
tries to insert NULLs where it should be inserting real values.

Hi Vivek,

I’ve actually fixed all my problems. I have a working RT installation
with Apache2, FastCGI & PostgreSQL. What I ended up doing was dumping
the data from MySQL into Pg format (using a my2pg.pl script) and editing
the output to remove any commands to create indexes, schemas &
sequences. Instead, I created the schemas, indexes & sequences from the
schema.Pg supplied with rt-3.2.1. I then inserted the data from the SQL
file generated by my2pg.pl and it worked fine. :slight_smile: (I had to replace a
few empty values (‘’) in integer fields as dumped by my2pg.pl to say
‘NULL’ instead, as PostgreSQL didn’t like using ‘’ in an integer field)

Regards,
Gonzalo