create new tag
, view all tags

SID-02289: /var/www/twiki/bin/view fails to execute due to @INC

Status: Answered Answered TWiki version: 6.0.2 Perl version: 5.016
Category: CategoryInstallation Server OS: RHEL 7 Last update: 1 year ago

Hello, I, a TWiki newbie, installed a fresh TWiki 6.0.2 on RHEL 7, Apache 2.4, Perl 5.016, following the TWiki Installation guide. The configure script displays @INC defined as:

/var/www/twiki/lib . /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /var/www/twiki/lib /var/www/twiki/lib/CGI /var/www/twiki/lib/CPAN/lib//arch /var/www/twiki/lib/CPAN/lib//5.16.3/x86_64-linux-thread-multi /var/www/twiki/lib/CPAN/lib//5.16.3 /var/www/twiki/lib/CPAN/lib/

The configure script shows no errors for me to fix.

However, when trying to execute /var/www/twiki/bin/view, it throws the error:

Can't locate CGI/Carp.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /var/www/twiki/bin/view line 28. BEGIN failed--compilation aborted at /var/www/twiki/bin/view line 28.

I'm at a loss as to why the @INC values are different since running the configure script.

Can anyone provide any advice?


-- Cori Johnson - 2017-01-11

Discussion and Answer

There are two questions in there, and I think I know the answers.

  1. Why does @INC show different values: TWiki does a bit of internal bookkeeping with directories, and that's what you see in configure. This script does some extra heuristics since it must be able to run before TWiki is configured. However, in line 28 of view, this bookkeeping has not yet been initiated (this happens in line 38).
  2. Why do you get the error? Well, that's a bit... disturbing. We know about a notorious problem with Red Hat, coming from the fact that they don't ship their Perl with the CGI module, which belongs to the Perl core for the rest of the world. As a countermeasure, I developed CgiContrib, which brings its own set of CGI modules which are compatible with TWiki, and which is part of TWiki 6.0.2. But as I realize now, this doesn't help at all: CgiContrib is located in the same directories where TWiki itself is, and hence CGI::Carp, which is part of the CGI distribution, can't be found as early as line 28 of view. Bummer. (To my excuse, while I run several operating systems for testing, Red Hat Linux isn't one of them.)

This is bad news, and slightly embarrassing that we didn't see it coming. So it is back to the drawing board for TWiki on Red Hat. The advice I've got for you is, unfortunately, a bit cumbersome:

Only the last step of this needs root privileges. It will install the modules to one of the paths under /usr/local/ (so I guess), which is available "in time" for view.

Another solution would be to run TWiki in a persistent interpreter (e.g. mod_perl): This would allow to pre-load the modules from TWiki's directories before view starts. This gives better performance but is usually considered even more cumbersome than the solution above. If you want to go for it, we can help.

-- Harald Jörg - 2017-01-11

Thanks for your reply and advice. I will attempt the CGI install and see how far I get.

-- Cori Johnson - 2017-01-13

Well, trying to work with CPAN on RHEL 7 didn't get me very far. My RHEL server may not have been installed for software dev. The 'perl Makefile.PL immediately failed to find the ExtUtils/MakeMaker.pm package. I finally found success by 'yum install'ing ExtUtils/MakeMaker and Digest/MD5 perl packages. At last the twiki/bin/view/ script ran successfully.

Thanks for the advice. It got me going after several days of struggling.

-- Cori Johnson - 2017-01-17

Thanks for the feedback! ExtUtils::MakeMaker is another module which belongs to the Perl core, and apparently is another one suppressed by Red Hat in what they ship as Perl. I was not aware of that.

I found an article by Dave Cross (http://perlhacks.com/2015/12/long-death-cgi-pm/) where he gives background when Red Hat removed CGI from their Perl distribution, and writes that for RHEL 6 and RHEL 7, yum install perl-core would fix the problem. That would have been easier for you, too, sorry for missing that. He concludes his article with the question I wonder why we haven't seen a tsunami of complaints? Well, as far as I can say, we had lots of complaints from people trying to install TWiki on Red Hat (and its various derivatives).

-- Harald Jörg - 2017-01-17

      Change status to:
ALERT! 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.
Status Answered
Title /var/www/twiki/bin/view fails to execute due to @INC
SupportCategory CategoryInstallation
TWiki version 6.0.2
Server OS RHEL 7
Web server Apache 2.4
Perl version 5.016
Browser & version Chrome, Firefox latest
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2017-01-17 - HaraldJoerg
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.