GET /search/facets throws an 500 internal server error

Bug #1499805 reported by Lakshmi N Sampath
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Searchlight
Fix Released
High
Steve McLellan

Bug Description

GET /search/facets throws an 500 internal server error.

The api log has this error.
2015-09-25 22:35:10.837 6164 ERROR searchlight.api.v1.search [req-ddebbf53-3a11-4744-85fa-1f3747bbbf75 5faafc11cfc34135a6b1e56774396688 ffb46508cd4e4912abb7e6b91c59b28b - - -] 'aggregations'

lakshmiS> sjmc7: with the latest git pull I get an error on GET facets api. do you see that too?
<lakshmiS> ERROR searchlight.api.v1.search [req-8f6c636...- - -] 'aggregations'
<sjmc7> no, it's been working fine for me and travis
<sjmc7> can you narrow down where the problem is?
<lakshmiS> yeah let me put some log
<lakshmiS> around aggregations query
<lakshmiS> sjmc7: _get_facet_terms() in base.py throws the error. Strangely all that exception says is 'aggregations'
<lakshmiS> i am running it as admin
<sjmc7> shouldn't matter who you're running as. it sounds like the error's coming from elasticsearch
<sjmc7> ah... maybe if the result set is empty
<sjmc7> that might be it. bug time!
<sjmc7> for term, aggregation in six.iteritems(results['aggregations']):
<sjmc7> try putting a check in
<sjmc7> or dumping out 'results'
<lakshmiS> thats it. aggregations key doesnt exist
<lakshmiS> will file a bug

Changed in searchlight:
milestone: none → liberty-rc1
Revision history for this message
Travis Tripp (travis-tripp) wrote :

Ok, took me a bit to figure out how to reproduce. But, I found if I deleted everything out of the index (including mappings) that I'd see the error.

2015-09-28 00:38:48.370 ERROR searchlight.api.v1.search [req-50f041b1-5f9c-4962-a837-fa58c39836cc f73168afd48e4851b74d6df1d4131d0c 195ce78c362e409ba0d3a40338ccccc2 - - -] 'aggregations'

Revision history for this message
Steve McLellan (sjmc7) wrote :

Ah, i had tried with no data but not no mapping. We can still return facets but no terms for them. Will put a patch up shortly.

Revision history for this message
Travis Tripp (travis-tripp) wrote :
Changed in searchlight:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Steve McLellan (sjmc7)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to searchlight (master)

Reviewed: https://review.openstack.org/228639
Committed: https://git.openstack.org/cgit/openstack/searchlight/commit/?id=91e9b4a896714a052a83324e545abf1b59bdff51
Submitter: Jenkins
Branch: master

commit 91e9b4a896714a052a83324e545abf1b59bdff51
Author: Steve McLellan <email address hidden>
Date: Mon Sep 28 16:43:22 2015 -0500

    Correct facet error when no mapping defined

    Corrects behavior when no mapping is defined and facet terms are
    requested; fields expected to be nested don't match the expected
    aggregation structure. Patch writes a warning log message and sets
    the options for the field to an empty list.

    Change-Id: I53c13c89dbf787368a8e0c860725a74bcec93668
    Closes-Bug: #1499805

Changed in searchlight:
status: In Progress → Fix Committed
Changed in searchlight:
status: Fix Committed → Fix Released
Changed in searchlight:
milestone: liberty-rc1 → 0.1.0.0
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.