Topic on Project:Support desk

Unexpected non-MediaWiki exception encountered, of type "Exception" /extensions/yambe/yambe.php:553

10
Mahmoodch (talkcontribs)

I have installed mediawiki latest verison 1.20.. I am receiving the following below error when I click this link "http://edn-wki-02/assyst10SP4Wiki/index.php/Lucene_Operators_in_assyst" Can any one please help to rectify the issue

Unexpected non-MediaWiki exception encountered, of type "Exception" exception 'Exception' with message 'String could not be parsed as XML' in /var/www/assyst10SP4Wiki/extensions/yambe/yambe.php:553 Stack trace:

  1. 0 /var/www/assyst10SP4Wiki/extensions/yambe/yambe.php(553): SimpleXMLElement->__construct('<?xml version='...')
  2. 1 /var/www/assyst10SP4Wiki/extensions/yambe/yambe.php(399): yambeUnpackTag(':<yam...')
  3. 2 /var/www/assyst10SP4Wiki/extensions/yambe/yambe.php(199): getTagFromParent('Global_Free_Tex...', 0)
  4. 3 [internal function]: yambeBreadcrumb('Global_Free_Tex...', Array, Object(Parser), Object(PPFrame_DOM))
  5. 4 /var/www/assyst10SP4Wiki/includes/parser/Parser.php(3806): call_user_func_array('yambeBreadcrumb', Array)
  6. 5 /var/www/assyst10SP4Wiki/includes/parser/Preprocessor_DOM.php(1150): Parser->extensionSubstitution(Array, Object(PPFrame_DOM))
  7. 6 /var/www/assyst10SP4Wiki/includes/parser/Parser.php(3043): PPFrame_DOM->expand(Object(PPNode_DOM), 0)
  8. 7 /var/www/assyst10SP4Wiki/includes/parser/Parser.php(1141): Parser->replaceVariables('<yamb...')
  9. 8 /var/www/assyst10SP4Wiki/includes/parser/Parser.php(370): Parser->internalParse('<yamb...')
  10. 9 /var/www/assyst10SP4Wiki/includes/WikiPage.php(3110): Parser->parse('<yamb...', Object(Title), Object(ParserOptions), true, true, 45681)
  11. 10 /var/www/assyst10SP4Wiki/includes/PoolCounter.php(209): PoolWorkArticleView->doWork()
  12. 11 /var/www/assyst10SP4Wiki/includes/Article.php(631): PoolCounterWork->execute()
  13. 12 /var/www/assyst10SP4Wiki/includes/actions/ViewAction.php(37): Article->view()
  14. 13 /var/www/assyst10SP4Wiki/includes/Wiki.php(427): ViewAction->show()
  15. 14 /var/www/assyst10SP4Wiki/includes/Wiki.php(304): MediaWiki->performAction(Object(Article))
  16. 15 /var/www/assyst10SP4Wiki/includes/Wiki.php(536): MediaWiki->performRequest()
  17. 16 /var/www/assyst10SP4Wiki/includes/Wiki.php(446): MediaWiki->main()
  18. 17 /var/www/assyst10SP4Wiki/index.php(59): MediaWiki->run()
  19. 18 {main}
MarkAHershberger (talkcontribs)
Mahmoodch (talkcontribs)

Please find the content of tag I got from this link "http://edn-wki-02/assyst10SP4Wiki/index.php/Lucene_Operators_in_assyst?action=edit"

<yambe:breadcrumb>Global_Free_Text_Searching|Global Free Text Searching</yambe:breadcrumb> <yambe:breadcrumb>Search_Engine_-_How_Search_Engine_Works|Search Engine - How Search Engine Works</yambe:breadcrumb> <yambe:breadcrumb>Knowledge_Search_Form|Knowledge Search Form</yambe:breadcrumb>


Lucene searching capabilities are integrated into assyst Search which is used in Free Text Searching and in Knowledge in assyst.

This allows search queries to be built around the syntax operators. The commonly used operators are:

  • Single Term - A search based on single words, such as for Error. Where a number of single words are listed in a search, such as Error blue screen then these are presumed to be using the AND Boolean Operator.
  • Phrase - A group of words bounded by double quote marks "" that will be searched for as a perfect match, such as "Blue screen error".
  • Boolean Operators - These operators can be used between Singled Terms and Phrases to further define the search;
  • AND or + - Both terms will be found in the search results, such as Error AND "blue screen".
  • OR or | - Either one term or another will be found in the search results, such as Error OR "blue screen".
  • NOT or - - A term will not be present in the search results, such as Error NOT "blue screen" Error -"blue screen" where Error results will only be returned if the Knowledge Procedure does not contain the phrase blue screen.
Note: Curved brackets () can be used to group operator groups, such as (Error OR Errors) AND ("blue screen" OR "blue page").
  • Wildcards - These can be used to substitute unknown characters in the search;
  • * - This wildcard can be used in the place of a range of unknown characters, such as Sc*n where Screen will be returned along with Scorn, Scoop and Scan.
  • ? - This wildcard can be used in the place of an individual character, with several being used as required, such as Sc???n where Screen will be returned along with Scorn and Scoop but not Scan.

A more detailed explanation of the full Lucene Search syntax is provided in Lucene's Query Parser Syntax PDF.

Lucene and Boolean Logic

Mahmoodch (talkcontribs)

Yes I have the latest code installed

88.130.80.115 (talkcontribs)
MarkAHershberger (talkcontribs)

I tried to reproduce your problem by using the wikitext you provided and the yambeUnpackTag() function and couldn't get the problem. And then I realized you didn't give us a PHP version.

In any case could you edit the Yambe extension where it says:

   $xml = new SimpleXMLElement($xmlstr);

so that I says:

   error_log("XML: $xmlstr");
   $xml = new SimpleXMLElement($xmlstr);

and then reproduce the error. After that, could you look at your error log and see what error it printed out?

If you don't have access to the error log, then something like the following should work on the page that usually displays the error:

   var_dump($xmlstr); exit;
   $xml = new SimpleXMLElement($xmlstr);

Of course, after you've done that, you'll want to remove it.

Mahmoodch (talkcontribs)

Hi Mark

When I added the following line "var_dump($xmlstr); exit;" in yambe.php

The following below error was displayed on web page

string(136) "Search Engine Installation & Configuration Guide"

The php version I use is: "PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48) Copyright (c) 1997-2012 The PHP Group"

I could not find any error log file can you please let me know where it would be.

Thanks a lot for your help

Thanks

Mahmoood

MarkAHershberger (talkcontribs)

Ah, I missed this the first time through. The & should be encoded, otherwise SimpleXML will complain like it is doing. I don't have time to fix that right now, but maybe that will give enough of a clue to continue.

Mahmoodch (talkcontribs)

Hi Mark

Thanks a lot for your reply. I am not expert in scripting and don't know how to encode. Can you please help when you will have time.

Thanks

Mahmood

Mahmoodch (talkcontribs)

Hi Mark

The problem rectified. I have renamed the page Search Engine Installation & Configuration Guide to Search Engine Installation and Configuration Guide and this solved the issue for all child pages that have this as one of their parents. The YAMBE breadcrumb does not seem to like ‘&’ in page titles. The strange thing is the immediate child of Search Engine Installation & Configuration Guide did not have the issue.

Thanks a lot for your help

Mahmood

Reply to "Unexpected non-MediaWiki exception encountered, of type "Exception" /extensions/yambe/yambe.php:553"