Internal Server Error when query isn't specified

Bug #1514738 reported by Liyingjun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Searchlight
Fix Released
Medium
Liyingjun

Bug Description

curl -H 'X-Auth-Token: e8a674c4e3cc4467ab9b77fcbf6b0697' -d '{"all_projects": true, "type": "OS::Glance::Image"}' http://127.0.0.1:9393/v1/search
<html>
 <head>
  <title>500 Internal Server Error</title>
 </head>
 <body>
  <h1>500 Internal Server Error</h1>
  The server has either erred or is incapable of performing the requested operation.<br /><br />

 </body>
</html>

Liyingjun (liyingjun)
Changed in searchlight:
assignee: nobody → Liyingjun (liyingjun)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to searchlight (master)

Fix proposed to branch: master
Review: https://review.openstack.org/243478

Changed in searchlight:
status: New → In Progress
Revision history for this message
Steve McLellan (sjmc7) wrote :

With current master, it runs a search with query: null for me:

curl -H"Content-Type: application/json" -H"X-Auth-Token: $token" -d '{"type": "OS::Nova::Server"}' http://localhost:9393/v1/search

{"hits": {"hits": [{"_score": 1.0, "_type": "OS::Nova::Server", "_id": "02b1c1e4-a6c2-439c-9527-62c964f2788b", "_source": {"OS-EXT-STS:task_state": null, ....}, "_index": "searchlight"}], "total": 1, "max_score": 1.0}, "_shards": {"successful": 5, "failed": 0, "total": 5}, "took": 16, "timed_out": false}

py-elasticsearch log:

{"query": {"bool": {"should": [{"filtered": {"filter": [{"indices": {"filter": {"and": [{"term": {"tenant_id": "aaabbbccc"}}, {"type": {"value": "OS::Nova::Server"}}]}, "index": "searchlight", "no_match_filter": "none"}}], "query": null}}]}}}

I would actually prefer not to force a query to be specified.

Revision history for this message
Liyingjun (liyingjun) wrote :

Hi, Steve, the error happens when `"all_projects": true ` is specified.

Changed in searchlight:
importance: Undecided → Medium
milestone: none → mitaka-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to searchlight (master)

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

commit b94757de84e07d189e2fcdc4cd5c826167952fdc
Author: liyingjun <email address hidden>
Date: Tue Nov 10 17:15:40 2015 +0800

    Fix Internal Server Error when query isn't specified

    When calling search api, if 'query' is not specified with
    'all_projects': true, an Internal Server Error will be raised.

    Change-Id: I81497d4f7ea480f499ccf0ece06f0ef19536370f
    Closes-bug: #1514738

Changed in searchlight:
status: In Progress → Fix Committed
Changed in searchlight:
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.