Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: Solaris 9
Web server: Apache/2.0.53 (Unix)
Perl version: 5.8.5
Client OS: MS Windows 2000
Web Browser: Firefox, IE
Categories: Search

-- GilBenson - 08 Nov 2006

Answer

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.

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

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
HTMLhtml configure.html r1 manage 145.0 K 2006-11-08 - 17:57 UnknownUser  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r8 - 2006-12-04 - PeterThoeny
 
  • 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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.