More Notes: Need Help: RT can't write to sessiondir

Here’s more information, things I’ve tried since exchanging some emails
with some very helpful people on the list:

Apache is actually running as apache…but even more disturbing…I set
this:
MasonSessionDir = “/tmp”;
and still no go.

I get:

[Thu Jul 26 13:46:48 2001] [error] RT Couldn’t write to session
directory ‘/tmp’. Check that this directory’s permissions are correct.
at /opt/rt2/bin/webmux.pl line 143.

I then set apache to run as apache:rt, set it back to the
/opt/rt2/WebRT/sessiondir and it still breaks.
Tried chmod -R /opt/rt2 to 777, 775, 700 and still not go.

The relevant code bit is this mysterious (to me) block or perl:

my %cookies = Apache::cookie::parse($r->header_in(‘Cookie’));

eval {
    tie %HTML::Mason::Commands::session, 'Apache::Session::File',
      ( $cookies{'AF_SID'} ? $cookies{'AF_SID'}->value() : undef ),
        { Directory => $RT::MasonSessionDir,
          LockDirectory => $RT::MasonSessionDir,
        }   ;
};
if ( $@ ) {
    # If the session is invalid, create a new session.
    if ( $@ =~ m#^Object does not exist in the data store# ) {
         tie %HTML::Mason::Commands::session,

‘Apache::Session::File’, undef,
{ Directory => $RT::MasonSessionDir,
LockDirectory => $RT::MasonSessionDir,
};
undef $cookies{‘AF_SID’};
}
else {
die “RT Couldn’t write to session directory
’$RT::MasonSessionDir’. Che
ck that this directory’s permissions are correct.”;
}
}

I am beginning to suspect that this isn’t really a permissions issue at
all.

???

Baffled,

nathan olla

smime.p7s (3.07 KB)

When you installed it, what where the values for WEB_USER and WEB_GROUP in Makefile? Check that they are the same as the values for User and Group in your mod_perl httpd.conf
AFAIK, the sessiondata should be owned by WEB_USER:WEB_GROUP, I doubt rt is the group that apache runs as.
If they were wrong, change the values, and run ‘make fixperms’ that should solve it.

If not, possibly it’s some malformed cookie or something - try from different browser & machine. (That’s a uninformed, wildly speculative, shot in the dark)

Also, have you tried reinstalling mason? Check that the version you have isn’t a bleeding edge release or something.

-Feargal.

Here’s more information, things I’ve tried since exchanging some emails
with some very helpful people on the list:

Apache is actually running as apache…but even more disturbing…I set
this:
MasonSessionDir = “/tmp”;
and still no go.

I get:

[Thu Jul 26 13:46:48 2001] [error] RT Couldn’t write to session
directory ‘/tmp’. Check that this directory’s permissions are correct.
at /opt/rt2/bin/webmux.pl line 143.

I then set apache to run as apache:rt, set it back to the
/opt/rt2/WebRT/sessiondir and it still breaks.
Tried chmod -R /opt/rt2 to 777, 775, 700 and still not go.

The relevant code bit is this mysterious (to me) block or perl:

my %cookies = Apache::cookie::parse($r->header_in(‘Cookie’));

eval {
    tie %HTML::Mason::Commands::session, 'Apache::Session::File',
      ( $cookies{'AF_SID'} ? $cookies{'AF_SID'}->value() : undef ),
        { Directory => $RT::MasonSessionDir,
          LockDirectory => $RT::MasonSessionDir,
        }   ;
};
if ( $@ ) {
    # If the session is invalid, create a new session.
    if ( $@ =~ m#^Object does not exist in the data store# ) {
         tie %HTML::Mason::Commands::session,

‘Apache::Session::File’, undef,
{ Directory => $RT::MasonSessionDir,
LockDirectory => $RT::MasonSessionDir,
};
undef $cookies{‘AF_SID’};
}
else {
die “RT Couldn’t write to session directory
‘$RT::MasonSessionDir’. Che
ck that this directory’s permissions are correct.”;
}
}

I am beginning to suspect that this isn’t really a permissions issue at
all.

???

Baffled,

nathan olla

Feargal Reilly,
Systems Administrator,
The CIA.

The actual error that the eval is returning is this:

[error] ERROR IS : Permission denied at
/usr/lib/perl5/site_perl/5.6.0/Apache/Session/SysVSemaphoreLocker.pm
line 63.
(in cleanup) Permission denied at
/usr/lib/perl5/site_perl/5.6.0/Apache/Session/SysVSemaphoreLocker.pm
line 63.

webmux.pl reports: RT Couldn’t write to session directory
‘/opt/rt2/WebRT/sessiondata’. Check that this directory’s permissions
are correct. at /opt/rt2/bin/webmux.pl line 144.

Hmm… it may be probs with your semaphores, but I’m a FreeBSD head, you’ll need a Red Hat person to help methinks…

ipcs -bS may list the number of semaphores allowed by your kernel
ipcs -s may list what’s in use, check that there isn’t a huge NSEM value.
If there is, and appears to be from a dead process, ipcrm can be use to remove it. Read the man pages for both on your system, usage may be different.

And check you’re not out of diskspace.

What’s SysVSemaphoreLocker.pm doing at line 63?

“NO” == Nathan Olla nathan.olla@newisys.com writes:

NO> Here’s more information, things I’ve tried since exchanging some emails
NO> with some very helpful people on the list:

NO> Apache is actually running as apache…but even more disturbing…I set
NO> this:
NO> MasonSessionDir = “/tmp”;
NO> and still no go.

NO> I get:

NO> [Thu Jul 26 13:46:48 2001] [error] RT Couldn’t write to session
NO> directory ‘/tmp’. Check that this directory’s permissions are correct.
NO> at /opt/rt2/bin/webmux.pl line 143.

On line 143, at the end of the die, inside the double quotes, add $@
which is the perl variable to describe the original error from the
eval. This should provide more clues.