• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4262: Could not perform search error message

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine   Normal Closed   n/a  

Edit Form Data

Reported By:
Applies To:
Current State:
Waiting For:
Target Release:
Released In:


On my latest svn 14181 I get this message, just below the heading in TWiki.WebSearch when there is no search term specified:

Could not perform search. Error was: /bin/egrep -i -l -H -- %TOKEN|U% %FILES|F% returned an error

Search works normally though. Seems to be related to an empty search.

develop.twiki.org does not have this error.

My env:

Linux example.com 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686 i686 i386 GNU/Linux

$TWiki::cfg{RCS}{EgrepCmd} = '/bin/egrep %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
$TWiki::cfg{RCS}{FgrepCmd} = '/bin/fgrep %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';

-- TWiki:Main/PeterThoeny - 17 Jun 2007

There have been several changes in the search code recently; do you still get it? What is the diff between WebSearch.txt on d.t.o and on your install?


I am at latest SVN 14244 and still get the error.

-- TWiki:Main.PeterThoeny - 22 Jun 2007

I was able to reproduce this in a raw checkout. it looks like the status checking code is correct, because grep returns a non-zero exit code for that search. The fix is to avoid feeding a null string to grep (that also banjaxed Native search a while ago, and i wasn't seeing the error because native handles it correctly)


Hmm, there used to be a "something.Very/unLikelyTo+search-for;-)" search string default if the search string was empty. Possibly lost in a refactor?

-- TWiki:Main.PeterThoeny - 23 Jun 2007

No. It fails because it invokes egrep using the formulation for a regex search, and the string default contains regex meta-characters ., + and ). It invokes a regex search because the new wordboundary search mode is enabled. It only blows up with forking search.

It works fine if I change the $emptySearch to the null string ''. Out of interest, what was the idea behind that string? I never understood it. Was it because you used to generate command lines for backtick execution, and without some text there the parameter order would be lost? If so, why didn't you just put quotes around the search string? Or was it because you wanted to be sure there would be no hits for an empty search? In that case, why did you invoke grep for an empty string search at all? it seems to me to be a simple tests to eliminate the search for an empty string in Search.pm.


Summary Could not perform search error message
ReportedBy TWiki:Main.PeterThoeny
Codebase ~twiki4
SVN Range TWiki-4.1.2, Thu, 14 Jun 2007, build 14128
AppliesTo Engine

Priority Normal
CurrentState Closed

Checkins TWikirev:14285 TWikirev:14293
TargetRelease n/a

Edit | Attach | Watch | Print version | History: r12 < r11 < r10 < r9 < r8 | Backlinks | Raw View |  Raw edit | More topic actions
Topic revision: r12 - 2007-06-27 - TWikiUserMapping_CrawfordCurrie
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback