Elasticsearch: Searching for a particular term breaks when logged in to mahara.org

Bug #1389446 reported by Aaron Barnes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned
1.10
Fix Released
Medium
Unassigned
15.04
Fix Released
Medium
Unassigned

Bug Description

This happens while using the search box in the upper right hand corner of the page on http://mahara.org

I can consistently get the search to throw an error when searching for "Jaybee" while logged in. This does not occur while logged out, or the other user I tested.

The error is: "A nonrecoverable error occurred. This probably means you have encountered a bug in the system"

Revision history for this message
Aaron Wells (u-aaronw) wrote :
Download full text (10.7 KiB)

Replicated. It errors out when I'm logged in, but it works when I'm logged out.

Here is the error from the Apache logs. It's unclear whether this is a code problem, or a mahara.org infrastructure problem.

[Thu Nov 06 14:57:56 2014] (lib/errors.php:457) An exception was thrown of class Elastica\\Exception\\ResponseException. , referer: https://mahara.org/admin/users/edit.php?id=680
[Thu Nov 06 14:57:56 2014] (lib/errors.php:457) THIS IS BAD and should be changed to something extending MaharaException,, referer: https://mahara.org/admin/users/edit.php?id=680
[Thu Nov 06 14:57:56 2014] (lib/errors.php:457) unless the exception is from a third party library., referer: https://mahara.org/admin/users/edit.php?id=680
[Thu Nov 06 14:57:56 2014] (lib/errors.php:457) Original trace follows, referer: https://mahara.org/admin/users/edit.php?id=680
[Thu Nov 06 14:57:56 2014] (lib/elastica/lib/Elastica/Transport/Http.php:137) SearchPhaseExecutionException[Failed to execute phase [query], total failure; shardFailures {[EQCeqgZKTf6i_3a2-8Bz6Q][mahara-mahara-org-prod-index-one][2]: RemoteTransportException[[learn-search2][inet[/10.24.128.40:9300]][search/phase/query]]; nested: SearchParseException[[mahara-mahara-org-prod-index-one][2]: query[_all:jaybe],from[0],size[10]: Parse Failure [Failed to parse source [{"from":0,"size":10,"query":{"query_string":{"query":"Jaybee","analyzer":"mahara_analyzer","default_operator":"AND"}},"filter":{"and":[{"or":[{"missing":{"field":"access.general"}},{"term":{"access.general":"public"}},{"term":{"access.general":"loggedin"}},{"and":[{"term":{"access.general":"friends"}},{"terms":{"owner":["206","1688","33864","2491","35573","4872","801"]}}]},{"terms":{"access.groups.member":["1033","3","3","1028","1028","1","6","6","118","118","40","20","20","37","37"]}},{"terms":{"access.groups.ad
min":["1033","1","40"]}},{"term":{"owner":"32554"}},{"term":{"access.usrs":"32554"}}]},{"term":{"mainfacetterm":null}}]},"facets":{"mainFacetTerm":{"facet_filter":{"and":[{"or":[{"missing":{"field":"access.general"}},{"term":{"access.general":"public"}},{"term":{"access.general":"loggedin"}},{"and":[{"term":{"access.general":"friends"}},{"terms":{"owner":["206","1688","33864","2491","35573","4872","801"]}}]},{"terms":{"access.groups.member":["1033","3","3","1028","1028","1","6","6","118","118","40","20","20","37","37"]}},{"terms":{"access.groups.admin":["1033","1","40"]}},{"term":{"owner":"32554"}},{"term":{"access.usrs":"32554"}}]}]},"terms":{"field":"mainfacetterm","order":"count"}},"secFacetTerm":{"facet_filter":{"and":[{"or":[{"missing":{"field":"access.general"}},{"term":{"access.general":"public"}},{"term":{"access.general":"loggedin"}},{"and":[{"term":{"access.general":"friends"}},{"terms":{"owner":["206","1688","33864","2491","35573","4872","801"]}}]},{"terms":{"access.groups.member":["1033","3","3",
"1028","1028","1","6","6","118","118","40","20","20","37","37"]}},{"terms":{"access.groups.admin":["1033","1","40"]}},{"term":{"owner":"32554"}},{"term":{"access.usrs":"32554"}}]},{"term":{"mainfacetterm":null}}]},"terms":{"field":"secfacetterm","order":"count"}}},"sort":[{"_score":{"order":"desc"}},{"_score":{"order":"desc"}}]}]]]; nested...

tags: added: elasticsearch
tags: added: mahara.org
Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Aaron Wells (u-aaronw)
milestone: none → 15.04.0
milestone: 15.04.0 → 1.9.4
summary: - Searching for a particular term breaks when logged in
+ Elasticsearch: Searching for a particular term breaks when logged in to
+ mahara.org
Revision history for this message
Aaron Barnes (aaron-barnes) wrote :

Have replicated with:

Jaybee
AaronB
Sonn

But only while logged in.

I think it might be terms in email address that don't appear anywhere else.

Or perhaps something to do with pending friend requests.

Robert Lyon (robertl-9)
Changed in mahara:
milestone: 1.9.4 → 1.9.5
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.9.5 → 1.9.6
Revision history for this message
Aaron Wells (u-aaronw) wrote :

Confirmed that this problem is still present on mahara.org after the upgrade to 15.04.

It's either a problem in our particular Elasticsearch server setup at Mahara HQ, or it's a bug in our Elasticsearch code itself.

Changed in mahara:
milestone: 1.9.6 → 1.9.7
Revision history for this message
Aaron Wells (u-aaronw) wrote :

This problem no longer happens on mahara.org. Whatever it was, the problem was probably fixed in the last round of Elasticsearch bug fixes.

no longer affects: mahara/15.10
no longer affects: mahara/1.9
Aaron Wells (u-aaronw)
Changed in mahara:
status: Triaged → Fix Committed
milestone: 15.10.0 → none
Revision history for this message
Dirk Meyer (dirkca68) wrote :

Just a comment that we had to use ElasticSearch 1.5.2 to make it work in Mahara 15.10 on Debian and Mysql.

Revision history for this message
Dirk Meyer (dirkca68) wrote :

and php 5.4

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hi Dirk,

For clarification, what version of ElasticSearch did you try before 1.5.2?

I tried to make the code backwards-compatible with the previous version of Elasticsearch required by Mahara (0.90). But I haven't yet tested it against Elasticsearch 2.0

Cheers,
Aaron

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I checked with Dirk, and he verified that the versions they tried which don't work were later than 1.5.2. Specifically: 1.6 (possibly), 1.7.3, and 2.0.

So, it looks like Elasticsearch is not trying to hard to maintain backwards compatibility, and we'll need to upgrade the elasticsearch plugin again sometime soon.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

I've filed a couple of bugs based on this discussion:

Upgrade Elastica to latest version (currently 2.3.1): https://bugs.launchpad.net/mahara/+bug/1517732

Improve the documentation of which version of Elasticsearch we support: https://bugs.launchpad.net/mahara/+bug/1517729

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.