Question
I'm trying to activate mod_perl (
SuSE's apache2-mod_perl-1.99_12_20040302-33 rpm) for my TWiki installation, following the instructions in
ModPerlUnix as much as possible. I've put
<FilesMatch "(view).*">
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
PerlOptions +ParseHeaders
Options +ExecCGI
</FilesMatch>
in
.../twiki/bin/.htaccess (the
... are substituted everywhere with the real path, of course), and added
PerlSwitches -T to
httpd.conf.
I've also tried adding
PerlRequire .../twiki/tools/mod_perl_startup.pl to
httpd.conf, with
.../twiki/tools/mod_perl_startup.pl being
chdir(".../twiki/bin");
eval "require 'setlib.cfg'";
but then Apache won't start, and gives the following error:
[Sat Feb 25 18:25:53 2006] [error] .../twiki/tools/mod_perl_startup.pl did not return a true value at (eval 4) line 1.\n
[Sat Feb 25 18:25:53 2006] [error] Can't load Perl file: .../twiki/tools/mod_perl_startup.pl for server www.example.com:0, exiting...
When viewing some of the topics, I get an error (see below). It doesn't neccessarily happen the first time I view the topic, and sometimes the topic will display fine again a couple of minutes later (but usually the error reoccurs every time). Also some topics that previously displayed fine, will now start giving the error.
Topics that are prone to trigger the error are Main.WebChanges, TWiki.WebChanges, Sandbox.WebHome and Sandbox.WebStatistics
The error messages when viewing Main.WebChanges are: In the browser:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.
RCS: path -h %FILENAME|F% of path-project.orgpath,v failed:
RCS file: path-project.orgpath,v
Working file: PatternSkinUserViewTemplate.txt
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1
=============================================================================
In apache's error_log:
********************************
RCS: /usr/bin/rlog -h %FILENAME|F% of .../twiki/data/Main/PatternSkinUserViewTemplate.txt,v failed:
RCS file: .../twiki/data/Main/PatternSkinUserViewTemplate.txt,v
Working file: PatternSkinUserViewTemplate.txt
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1
=============================================================================
(this is repeated once in
error_log).
For other topics, the named "Working file" can be WebTopicCreator.txt, PatternSkinJavascripts.txt or TWikiReleaseNotes04x00x00.txt (others have occurred, as well).
Sometimes, after this error has started occuring, a different error message occurs:
TWiki detected an internal error - please check your TWiki logs and webserver logs for more information.
Can't locate TWikipath in @INC (@INC contains: path-lib path-linux-thread-multi path path-linux-thread-multi path path path-linux-thread-multi path path path path)
The message in
error_log is
very long, but starts with
Can't locate TWiki/Plugins/SpreadSheetPlugin/Calc.pm in @INC (@INC contains: /srv/www/perl-lib /usr/lib/perl5/5.8.3/i586-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /srv/www/ /srv/www/lib/perl) at .../twiki/lib/TWiki/Plugins/SpreadSheetPlugin.pm line 83.
I've also tried to activate mod_perl on other scripts beside
view, but then I frequently get errors like
Can't locate TWiki/UI/Edit.pm in @INC (@INC contains: . /srv/www/perl-lib /usr/lib/perl5/5.8.3/i586-linux-thread-multi /usr/lib/perl5/5.8.3 /usr/lib/perl5/site_perl/5.8.3/i586-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.3/i586-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl . /srv/www/ /srv/www/lib/perl) at .../twiki/bin/edit line 32. BEGIN failed--compilation aborted at .../twiki/bin/edit line 32.
Any help would be appreciated!
Environment
--
BjornHelgeMevik - 25 Feb 2006
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
As for the
did not return a true value and
Can't locate TWikipath in @INC
: This looks like a bogus path to
setlib.cfg, or a bogus content in
setlib.cfg.
If you are using a mod_perl startup file, I think it is best to just set the library paths and include the modules there:
use lib "your/path/to/twiki/lib";
use CGI;
CGI->compile();
use TWiki;
use TWiki::UI;
# repeat ad nauseam for whatever modules you see fit
The problem with the lock files - hmmm. Have you been upgrading from Dakar? Or have you changed the userid of your webserver? It might be necessary to break the locks, or to
chown the files. Difficult to tell, from here.
--
HaraldJoerg - 25 Feb 2006
Thanks for the suggestions!
The
did not return a true value did turn out to happen because the
mod_perl_startup.pl did not end with
1;. Adding this (an a line of its own), made Apache happy.
However, it did not solve the other problems.
What did alleviate them, though, was to
remove the
PerlSwitches -T from
httpd.conf. The errors still occur from time to time, but much more seldom, and I've been able to activate
mod_perl for more scripts (I haven't tested thoroughly yet, but so far only
attach and
save seem to (consistently) give strange results.)
(I played around with the
-T, and found out that with
-T,
@INC does not contain
".", so the
require in
mod_perl_startup.pl will not find
setlib.cfg (but the error is suppressed because of the
eval). Probably something like
unshift @INC
, '.'; should be included prior to the
require (this is what's done in
view, etc.).)
As for the
RCS problems, the TWiki installation is not an upgraded Cairo, it is a freshly installed 4.0.1, and I have not changed the uid/gid of Apache. (Also, as mentioned, the error doesn't occur
every time i visit the topic.)
Now, removing the taint checking is bad for security, and the problems are not completely gone, so any help or ideas are greatly appreciated!
--
BjornHelgeMevik - 26 Feb 2006
Is there a reason you can't just use
PerlSwitches -T -I . ?
--
CrawfordCurrie - 27 Feb 2006
Nothing except my ignorance.
-- BjornHelgeMevik - 01 Mar 2006
i think you can get by by doing something along the lines of:
require './setlib.cfg'; (just put
./ in the filename).
--
WillNorris - 27 Feb 2006
With your suggestions I now have a
mod_perl setup with taint checking and correct
@INC. Thanks!
Unfortunately, that didn't solve the
RCS problem mentioned above. It still occurs (in a seemingly-random fashion).
--
BjornHelgeMevik - 01 Mar 2006
Now I have researched a little more. The
rlog error gets thrown in
TWiki::Store::RcsWrap::numRevisions because the
$error from
sysCommand is 16777215.
From the error log, it seems that
rlog returns what it is supposed to. I wrapped
rlog in a shell script that logged the exit code (
$?) of
rlog before exiting with the same exit code, and indeed
rlog finishes successfully, i.e., with zero exit code.
I then logged
$? and
$! after
close $handle in
TWiki::Sandbox::sysCommand, and it turns out that
$? is
-1 and
$! is
'No child processes' when the problem occurs.
Could this mean that
rlog runs withtout error, but finishes before
close is called? And is this something that can be caught (by treating
$? = -1= specially), or would
$? = -1= occur for "real" errors as well?
--
BjornHelgeMevik - 02 Mar 2006
I have the same problem as Bjorn. In our TWiki install at my work the 'Erroneous RLog Internal Error' (ERIE) appearing more and more often on submitting a page. I have to say that this error is the one that might cause me to migrate from TWiki. I'll take a look at it myself, but I haven't much time to spend on it. Any help would be gratefully received.
I'm taking the liberty of changing the Support Status back to 'Asked Questions'...if that's not the correct procedure, then I apologise.
--
AnthonyDervish - 22 May 2006
I stopped investigating the problem after I discovered another show stopper for using mod_perl with TWiki (at least for me): It seems more or less impossible to have several TWikis running under mod_perl on the same physical host. And the host I use does run several TWikis.
It would be nice to see the problem solved, though.
--
BjornHelgeMevik - 22 May 2006
Closing this. Please drop by IRC if you want to investigate this further, "Lavr" and others have gained some mod_perl knowledge and might have suggestions worth exploring.
--
SteffenPoulsen - 16 Jun 2006