Project

General

Profile

Bug #4487

Katello is not displaying the error being raised by API

Added by Og Maciel over 8 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Notice that using the CLI (and therefore the API) to search for an organization by name fails:

# hammer -v organization list --search 'name=ACME_Corporation'
[ERROR 2014-02-27 17:51:54 Exception] Error: 400 Bad Request
Error: 400 Bad Request
[ERROR 2014-02-27 17:51:54 Exception]

RestClient::BadRequest (400 Bad Request):
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/abstract_response.rb:48:in `return!'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:220:in `process_result'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:169:in `transmit'
    /usr/lib/ruby/1.8/net/http.rb:543:in `start'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
    /usr/lib/ruby/gems/1.8/gems/rest-client-1.6.1/lib/restclient/resource.rb:54:in `get'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `send'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:70:in `http_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/base.rb:51:in `perform_call'
    /usr/lib/ruby/gems/1.8/gems/katello_api-0.0.8/lib/katello_api/resources/organization.rb:22:in `index'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `send'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/resource.rb:53:in `call'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/read_command.rb:17:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:48:in `retrieve_data'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:93:in `retrieve_and_print'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/commands.rb:68:in `execute'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli_foreman-0.0.18/lib/hammer_cli_foreman/resource_supported_test.rb:9:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/lib/hammer_cli/./apipie/../abstract.rb:22:in `run'
    /usr/lib/ruby/gems/1.8/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
    /usr/lib/ruby/gems/1.8/gems/hammer_cli-0.0.18/bin/hammer:61
    /usr/bin/hammer:19:in `load'
    /usr/bin/hammer:19

Logs show:

Started GET "/katello/api/organizations?sort=&search=name%3DACME_Corporation" for 127.0.0.1 at 2014-02-27 17:51:54 -0500
Processing by Katello::Api::V2::OrganizationsController#index as JSON
  Parameters: {"sort"=>"", "search"=>"name=ACME_Corporation", "api_version"=>"v2", "organization"=>{}}
Authorized user admin(Admin User)
Field 'name' not recognized for searching! (ScopedSearch::QueryNotSupported)
  Rendered api/v2/errors/param_error.json.rabl within api/v2/layouts/error_layout (0.6ms)
Completed 400 Bad Request in 58ms (Views: 1.5ms | ActiveRecord: 13.9ms)

As per issue #4486 the API is raising a massive error but katello's organization controller isn't passing the error back

History

#1 Updated by Dominic Cleal over 8 years ago

  • Description updated (diff)

Foreman's organizations controller returns JSON in the body of the error 400 response:

{
    "error": {
        "message": "Field 'name' not recognized for searching!",
        "class": "ScopedSearch::QueryNotSupported" 
    }
}

#2 Updated by Eric Helms about 8 years ago

  • Status changed from New to Closed
  • Triaged set to No

Tested upstream and this appears to be returning the same format as Foreman now.

#3 Updated by Eric Helms about 8 years ago

  • Triaged changed from No to Yes

#4 Updated by Eric Helms almost 8 years ago

  • Legacy Backlogs Release (now unused) set to 13

Also available in: Atom PDF