#1376 500 when no results and short=True is used
Closed: Fixed 4 years ago by jkaluza. Opened 4 years ago by lucarval.

When using the API to query for module builds, if there are no matching results, and short=true is used, 500 error is returned:

$ curl -Lk 'https://mbs.fedoraproject.org/module-build-service/1/module-builds/?name=httpd&stream=8000020190404151421&short=true'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

Removing short=true returns the correct JSON response:

$ curl -Lk 'https://mbs.fedoraproject.org/module-build-service/1/module-builds/?name=httpd&stream=8000020190404151421'
{
  "items": [], 
  "meta": {
    "first": "http://mbs.fedoraproject.org/module-build-service/1/module-builds/?per_page=10&page=1&name=httpd&stream=8000020190404151421", 
    "last": "http://mbs.fedoraproject.org/module-build-service/1/module-builds/?per_page=10&page=0&name=httpd&stream=8000020190404151421", 
    "next": null, 
    "page": 1, 
    "pages": 0, 
    "per_page": 10, 
    "prev": null, 
    "total": 0
  }
}

Metadata Update from @cqi:
- Issue assigned to cqi

4 years ago

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #1377 Merged 4 years ago