This error message will randomly show up when customers search for items, I think only for IE users (6 and 7), so far I haven't been able to replicate it in Firefox. When the error shows up it doesn't give any results, even though the query is valid:
simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: ^ in C:\web\htdocs\sites\all\modules\google_appliance\GoogleMini.php on line 318.
simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Temporary server error. Try again in a minute. in C:\web\htdocs\sites\all\modules\google_appliance\GoogleMini.php on line 318.
simplexml_load_string() [<a href='function.simplexml-load-string'>function.simplexml-load-string</a>]: Entity: line 1: parser error : Start tag expected, '<' not found in C:\web\htdocs\sites\all\modules\google_appliance\GoogleMini.php on line 318.
Comments
Comment #1
OldAccount commentedUpdate: it's not IE-specific, I just got the error using Firefox 3.5, trying to view page 2 of some search results.
Comment #2
jweowu commentedCheck near the end of this page:
http://www.justindeltener.com/google-mini-appliance-review-and-integrati...
This page also lists the error:
https://uisapp2.iu.edu/confluence-prd/display/SEA/Release+Notes
It may or may not be the same cause, as that seems like it would be a HUGE number of keymatches/synonyms!
At any rate, it rather sounds like it's a problem with the GSA, and GoogleMini::resultFactory() ought to test for it so it can process the errors properly.
This looks appropriate:
http://www.php.net/manual/en/simplexml.examples-errors.php
Comment #3
OldAccount commentedThanks, we definitely don't have that many lines of KeyMatches or Synonyms.
That last link seems like it might be close to helping (http://www.php.net/manual/en/simplexml.examples-errors.php) but I'm not familiar enough with PHP to know what to really do with that info?
Comment #4
jweowu commentedlrobeson: I think you really ought to be looking into software updates for your GSA.
All we can do with simplexml.examples-errors is to hide those error messages away (or rather, pass them to watchdog in a cleaner fashion). It won't make the query work.
Well, we could sleep and re-try the query a few times, I guess.
(I presume that on your live site you have error reporting set to log to the database only, btw?)
Comment #5
OldAccount commentedActually, I'm glad you mentioned that -- I still had errors writing to the log and screen, thanks for reminding me to change that! So now I'm guessing when this error comes up, they'll just see "no results" instead of the XML error and "no results". Still not good, but better.
I'm not sure how firmware updates work with the GSA, if we're automatically notified or not, I'll look into that.
Comment #6
jweowu commentedNo problem. I wasn't sure whether your previous comments meant that customers were seeing the errors, or merely that you were noticing them in the logs, but I thought it might be worth mentioning just in case. And yes, that will stop errors from being displayed to users.
If you wanted to try a work-around, something along the lines of the following might do the trick as a replacement for the
$resultXML = curl_exec($ch);line in GoogleMini.phpThat's completely untested, and I'm unsure about raising the exception, but with any luck that will do what I intended (which is automatically attempt the query up to three times if that error is being returned, and then provide a user-friendly failure message).
It relies on simplexml_load_string() having no side-effects, as it's now getting called in query() as well as in resultFactory().
Those max_attempts and sleep values should probably be constants, but otherwise this might be potential patch material.
Comment #7
OldAccount commentedThanks, that looks promising! I tried out the code but now it only returns a white-screen-of-death page (removed the opening and closing php tags of course.) No error messages or anything so I'm not sure how to go about getting it to work? It doesn't return an error to the log or anything, I don't think it gets that far.