Question
Search fails after upgrade to most recent release (Dakar), what's wrong?
Search always returns zero(0) results. Even searches on the default TWiki Webs (i.e. TWiki, Main, Sandbox). Configure returns no errors and no warnings and is attached for reference. Both
WebIndex and
WebChanges work fine and display the correct content.
Search had previously worked with our Beijing installation. After I upgraded to Cairo and then to Dakar, the search functionality no longer returns any hits.
Also, the SiteMap is empty -- likely because the SiteMap content uses the %search% functionality.
All content pages/links are navigated and displayed fine.
TWiki dumps out the following text whenever a search is invoked
[ In this file
/infinys/web/prod/apache/htdocs/twiki/data/warn200611.txt ]
| 08 Nov 2006 - 13:28 | exec failed: No such file or directory at /infinys/web/prod/apache/htdocs/twiki/lib/TWiki/Sandbox.pm line 359.
Any help appreciated.
Gil
Environment
--
GilBenson - 08 Nov 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.
Run the configure script. Likely an issue with
{RCS}{EgrepCmd} and
{RCS}{FgrepCmd} settings. Make sure you have the gnu grep tools installed on Solaris, and TWiki pointed to them.
--
PeterThoeny - 08 Nov 2006
Thanks Peter and I agree the problem is somehow related to fgrep.
However, the settings seem to be fine. I had reinstalled gnu grep
(
ftp://ftp.gnu.org/pub/gnu/grep/grep-2.5.1a.tar.gz
) the other
day just to be sure and also updated the configure settings to point
to this location. The configure output has been attached as an html
file to the initial post.
I did notice though that the fgrep and egrep files of the gnu installation are
shell scripts that exect the grep with arguments.
I modified Sandbox.pm to try and see the problem
$ diff -p Sandbox.pm Sandbox.pm.orig
*** Sandbox.pm Wed Nov 8 18:00:42 2006
--- Sandbox.pm.orig Wed Nov 8 16:21:46 2006
*************** sub sysCommand {
*** 357,363 ****
# Child - run the command
open (STDERR, '>'.File::Spec->devnull()) || die "Can't kill STDERR: '$!'";
exec( $path, @args ) ||
! throw Error::Simple( "exec failed($template): ".$! );
# can never get here
}
--- 357,363 ----
# Child - run the command
open (STDERR, '>'.File::Spec->devnull()) || die "Can't kill STDERR: '$!'";
exec( $path, @args ) ||
! throw Error::Simple( 'exec failed: '.$! );
# can never get here
}
The output shows:
| 08 Nov 2006 - 18:19 | exec failed(/home/web/prod/local/bin/fgrep): No such file or directory at /home/web/prod/apache/htdocs/twiki/lib/TWiki/Sandbox.pm line 359.
The file
/home/web/prod/local/bin/fgrep does exist and was put there from the gnu grep
make install.
The problem is failing in the above Sandbox.pm module because of fgrep setting.
However, configure reports that fgrep is fine and it has been installed from GNU.
I'm stumped at this point and I guess need to dig into the code more. Any help appreciated.
Thanks,
Gil
--
GilBenson - 08 Nov 2006
FWIW, on my Solaris, gnu fgrep is called
gfgrep and is
ELF 32-bit MSB executable SPARC Version 1, dynamically linked, stripped.
--
PeterThoeny - 09 Nov 2006
I grabbed my GNU grep tarball from here -->
ftp://ftp.gnu.org/pub/gnu/grep/grep-2.5.1a.tar.gz
Where'd you grab your gnu fgrep that generated a binary gfgrep?
BTW, I can search on "Topic Title" and get results. But searching the body yields zero(0) hits.
--
GilBenson - 09 Nov 2006
Search now WORKS!
Here's my fix and explanation:
GNU Grep installs a binary grep. However, the fgrep and egrep files are simply shell files that exec the grep file with the "-F" and "-E" options for fgrep and egrep, respectively. So, you can NOT specify fgrep and egrep on the configure lines. What you have to do is specify the following lines for
egrep and
fgrep completely (make sure you specify all the settings after the -F/-E options):
/your_local_bin/grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%
/your_local_bin/grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%
[ These lines are taken from LocalSite.cfg after running the twiki/bin/configure page ]
$TWiki::cfg{RCS}{FgrepCmd} = '/your_local_bin/grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
$TWiki::cfg{RCS}{EgrepCmd} = '/your_local_bin/grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
The configure page instructions could be a bit clearer for these settings to avoid confusion.
--
GilBenson - 09 Nov 2006
Thanks,
GilBenson. It helps solve my problem as well.
--
HenryLuo - 04 Dec 2006
See also
SolarisInstallCookbook, which recommends to use
/usr/sfw/bin/gegrep for egrep.
--
PeterThoeny - 04 Dec 2006