Bug #19290
closedUnable to retrieve API bindings via hammer
Description
I have a development environment that includes foreman and several plugins (e.g. katello) for both the application and hammer. When attempting to run 'bundle exec hammer shell', I continuously see an error similar to the following in the foreman development.log when it attempts to retrieve the API bindings:
2017-04-17T16:01:57 149c1b20 [app] [I] Started GET "/apidoc/v2.json" for 192.168.121.167 at 2017-04-17 16:01:57 +0000 2017-04-17T16:01:57 149c1b20 [app] [I] Processing by Apipie::ApipiesController#index as JSON 2017-04-17T16:01:57 149c1b20 [app] [I] Parameters: {"version"=>"v2.json", "apipy"=>{}} 2017-04-17T16:01:58 149c1b20 [app] [I] Completed 500 Internal Server Error in 776ms (ActiveRecord: 1.5ms) 2017-04-17T16:01:58 149c1b20 [app] [F] | NoMethodError (undefined method `merge' for nil:NilClass): | lib/middleware/catch_json_parse_errors.rb:8:in `call' | lib/middleware/tagged_logging.rb:18:in `call' |
Note:
- I am running latest foreman(develop), katello(master), hammer* (master) and have fully updated gemset.
- The app and hammer were created using the forklift configurations
Updated by Brad Buckingham almost 8 years ago
The issue does appear unrelated to hammer, since I can generate the same error with curl on the same resource.
Updated by Dominic Cleal almost 8 years ago
- Status changed from New to Need more information
Please disable the backtrace silencer (config/initializers/backtrace_silencers.rb) and provide a full stack trace. Remove any plugins you have installed.
Updated by Brad Buckingham almost 8 years ago
Dominic, Thanks for the tip to obtain the full backtrace!
It looks like the issue is in Katello. Is it possible that something that something has changed in how facets are handled within Foreman? I will inquire in irc as well.
The following is the commit that originally introduced the block of code where the error occurs:
https://github.com/Katello/katello/blob/master/app/models/katello/concerns/content_facet_host_extensions.rb#L47
2017-04-18T11:55:19 94ca2b64 [app] [F] | NoMethodError (undefined method `merge' for nil:NilClass): | /home/vagrant/katello/app/models/katello/concerns/content_facet_host_extensions.rb:47:in `block in <module:ContentFacetHostExtensions>' | activesupport (4.2.8) lib/active_support/concern.rb:120:in `class_eval' | activesupport (4.2.8) lib/active_support/concern.rb:120:in `append_features' | /home/vagrant/katello/lib/katello/engine.rb:232:in `include' | /home/vagrant/katello/lib/katello/engine.rb:232:in `block in <class:Engine>' | activesupport (4.2.8) lib/active_support/callbacks.rb:446:in `instance_exec' | activesupport (4.2.8) lib/active_support/callbacks.rb:446:in `block in make_lambda' | activesupport (4.2.8) lib/active_support/callbacks.rb:192:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:192:in `block in simple' | activesupport (4.2.8) lib/active_support/callbacks.rb:504:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:504:in `block in call' | activesupport (4.2.8) lib/active_support/callbacks.rb:504:in `each' | activesupport (4.2.8) lib/active_support/callbacks.rb:504:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:92:in `__run_callbacks__' | activesupport (4.2.8) lib/active_support/callbacks.rb:778:in `_run_prepare_callbacks' | activesupport (4.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks' | actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:83:in `prepare!' | actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:55:in `prepare!' | apipie-rails (0.4.0) lib/apipie/application.rb:430:in `rails_mark_classes_for_reload' | apipie-rails (0.4.0) lib/apipie/application.rb:294:in `reload_documentation' | apipie-rails (0.4.0) lib/apipie/apipie_module.rb:18:in `method_missing' | apipie-rails (0.4.0) lib/apipie/application.rb:306:in `load_documentation' | apipie-rails (0.4.0) lib/apipie/apipie_module.rb:18:in `method_missing' | apipie-rails (0.4.0) app/controllers/apipie/apipies_controller.rb:31:in `block in index' | actionpack (4.2.8) lib/action_controller/metal/mime_responds.rb:212:in `respond_to' | apipie-rails (0.4.0) app/controllers/apipie/apipies_controller.rb:22:in `index' | actionpack (4.2.8) lib/action_controller/metal/implicit_render.rb:4:in `send_action' | actionpack (4.2.8) lib/abstract_controller/base.rb:198:in `process_action' | actionpack (4.2.8) lib/action_controller/metal/rendering.rb:10:in `process_action' | actionpack (4.2.8) lib/abstract_controller/callbacks.rb:20:in `block in process_action' | activesupport (4.2.8) lib/active_support/callbacks.rb:117:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:117:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:498:in `block (2 levels) in around' | activesupport (4.2.8) lib/active_support/callbacks.rb:313:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:313:in `block (2 levels) in halting' | apipie-rails (0.4.0) app/controllers/apipie/apipies_controller.rb:163:in `set_script_name' | activesupport (4.2.8) lib/active_support/callbacks.rb:432:in `block in make_lambda' | activesupport (4.2.8) lib/active_support/callbacks.rb:312:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:312:in `block in halting' | activesupport (4.2.8) lib/active_support/callbacks.rb:497:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:497:in `block in around' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:498:in `block (2 levels) in around' | activesupport (4.2.8) lib/active_support/callbacks.rb:313:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:313:in `block (2 levels) in halting' | audited (4.4.1) lib/audited/sweeper.rb:14:in `around' | activesupport (4.2.8) lib/active_support/callbacks.rb:455:in `public_send' | activesupport (4.2.8) lib/active_support/callbacks.rb:455:in `block in make_lambda' | activesupport (4.2.8) lib/active_support/callbacks.rb:312:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:312:in `block in halting' | activesupport (4.2.8) lib/active_support/callbacks.rb:497:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:497:in `block in around' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:505:in `call' | activesupport (4.2.8) lib/active_support/callbacks.rb:92:in `__run_callbacks__' | activesupport (4.2.8) lib/active_support/callbacks.rb:778:in `_run_process_action_callbacks' | activesupport (4.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks' | actionpack (4.2.8) lib/abstract_controller/callbacks.rb:19:in `process_action' | actionpack (4.2.8) lib/action_controller/metal/rescue.rb:29:in `process_action' | actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action' | activesupport (4.2.8) lib/active_support/notifications.rb:164:in `block in instrument' | activesupport (4.2.8) lib/active_support/notifications/instrumenter.rb:20:in `instrument' | activesupport (4.2.8) lib/active_support/notifications.rb:164:in `instrument' | actionpack (4.2.8) lib/action_controller/metal/instrumentation.rb:30:in `process_action' | actionpack (4.2.8) lib/action_controller/metal/params_wrapper.rb:250:in `process_action' | activerecord (4.2.8) lib/active_record/railties/controller_runtime.rb:18:in `process_action' | actionpack (4.2.8) lib/abstract_controller/base.rb:137:in `process' | actionview (4.2.8) lib/action_view/rendering.rb:30:in `process' | actionpack (4.2.8) lib/action_controller/metal.rb:196:in `dispatch' | actionpack (4.2.8) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' | actionpack (4.2.8) lib/action_controller/metal.rb:237:in `block in action' | actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:74:in `call' | actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:74:in `dispatch' | actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:43:in `serve' | actionpack (4.2.8) lib/action_dispatch/journey/router.rb:43:in `block in serve' | actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in `each' | actionpack (4.2.8) lib/action_dispatch/journey/router.rb:30:in `serve' | actionpack (4.2.8) lib/action_dispatch/routing/route_set.rb:817:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in `call' | apipie-rails (0.4.0) lib/apipie/static_dispatcher.rb:65:in `call' | bullet (5.5.1) lib/bullet/rack.rb:12:in `call' | apipie-rails (0.4.0) lib/apipie/extractor/recorder.rb:132:in `call' | apipie-rails (0.4.0) lib/apipie/middleware/checksum_in_headers.rb:27:in `call' | rack-openid (1.4.2) lib/rack/openid.rb:98:in `call' | rack (1.6.5) lib/rack/etag.rb:24:in `call' | rack (1.6.5) lib/rack/conditionalget.rb:25:in `call' | rack (1.6.5) lib/rack/head.rb:13:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/params_parser.rb:27:in `call' | lib/middleware/catch_json_parse_errors.rb:8:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/flash.rb:260:in `call' | rack (1.6.5) lib/rack/session/abstract/id.rb:225:in `context' | rack (1.6.5) lib/rack/session/abstract/id.rb:220:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/cookies.rb:560:in `call' | activerecord (4.2.8) lib/active_record/query_cache.rb:36:in `call' | activerecord (4.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call' | activerecord (4.2.8) lib/active_record/migration.rb:377:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' | activesupport (4.2.8) lib/active_support/callbacks.rb:88:in `__run_callbacks__' | activesupport (4.2.8) lib/active_support/callbacks.rb:778:in `_run_call_callbacks' | activesupport (4.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks' | actionpack (4.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/reloader.rb:73:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' | railties (4.2.8) lib/rails/rack/logger.rb:38:in `call_app' | railties (4.2.8) lib/rails/rack/logger.rb:22:in `call' | quiet_assets (1.1.0) lib/quiet_assets.rb:27:in `call_with_quiet_assets' | lib/middleware/tagged_logging.rb:18:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/request_id.rb:21:in `call' | rack (1.6.5) lib/rack/methodoverride.rb:22:in `call' | rack (1.6.5) lib/rack/runtime.rb:18:in `call' | activesupport (4.2.8) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' | rack (1.6.5) lib/rack/lock.rb:17:in `call' | actionpack (4.2.8) lib/action_dispatch/middleware/static.rb:120:in `call' | rack (1.6.5) lib/rack/sendfile.rb:113:in `call' | secure_headers (3.6.2) lib/secure_headers/middleware.rb:12:in `call' | railties (4.2.8) lib/rails/engine.rb:518:in `call' | railties (4.2.8) lib/rails/application.rb:165:in `call' | railties (4.2.8) lib/rails/railtie.rb:194:in `public_send' | railties (4.2.8) lib/rails/railtie.rb:194:in `method_missing' | rack (1.6.5) lib/rack/urlmap.rb:66:in `block in call' | rack (1.6.5) lib/rack/urlmap.rb:50:in `each' | rack (1.6.5) lib/rack/urlmap.rb:50:in `call' | rack (1.6.5) lib/rack/lock.rb:17:in `call' | rack (1.6.5) lib/rack/content_length.rb:15:in `call' | rack (1.6.5) lib/rack/handler/webrick.rb:88:in `service' | /home/vagrant/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' | /home/vagrant/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' | /home/vagrant/.rvm/rubies/ruby-2.2.4/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' | logging (2.2.2) lib/logging/diagnostic_context.rb:474:in `call' | logging (2.2.2) lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context' | |
Updated by Dominic Cleal almost 8 years ago
- Project changed from Foreman to Katello
- Category deleted (
API) - Status changed from Need more information to New
Updated by John Mitsch almost 8 years ago
This is what I am using as a workaround for this bug:
https://gist.github.com/johnpmitsch/0cdd4f5ba453b27c55d6fe1c71160005
Updated by John Mitsch almost 8 years ago
- Is duplicate of Bug #19317: Plugin and dashboard widget registry auto-reloaded added
Updated by John Mitsch almost 8 years ago
- Is duplicate of Bug #19268: Can't access apidocs upstream added
Updated by John Mitsch almost 8 years ago
- Translation missing: en.field_release set to 114
Updated by John Mitsch almost 8 years ago
- Translation missing: en.field_release changed from 114 to 166