Actions
Bug #23536
closedapipie:cache:index NoMethodError when unattended=false
Description
Running the apipie:cache:index task via foreman-rake causes a NoMethodError when unattended is set to false in settings.yaml.
This occurred on a 1.16.1 installation via the Forge module (theforeman/foreman). The host is CentOS 7 on x86_64.
NoMethodError: undefined method 'rebuild_methods' for #<Class:0x000000077f03d0> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/dynamic_matchers.rb:26:in 'method_missing' /usr/share/foreman/app/models/host/managed.rb:490:in 'valid_rebuild_only_values' /usr/share/foreman/config/initializers/apipie.rb:25:in 'block (2 levels) in <top (required)>' /usr/share/foreman/config/initializers/apipie.rb:33:in 'call' /usr/share/foreman/config/initializers/apipie.rb:33:in 'block (3 levels) in <top (required)>' /usr/share/foreman/config/initializers/apipie.rb:33:in 'each' /usr/share/foreman/config/initializers/apipie.rb:33:in 'map' /usr/share/foreman/config/initializers/apipie.rb:33:in 'block (2 levels) in <top (required)>' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:365:in 'call' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:365:in 'translate' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:131:in 'block in method_apis_to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:127:in 'each' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:127:in 'each' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:127:in 'collect' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:127:in 'method_apis_to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/method_description.rb:149:in 'to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/resource_description.rb:99:in 'block in to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/resource_description.rb:99:in 'each' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/resource_description.rb:99:in 'collect' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/resource_description.rb:99:in 'to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:264:in 'block in to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:263:in 'each' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:263:in 'inject' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/application.rb:263:in 'to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/apipie/apipie_module.rb:13:in 'to_json' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/tasks/apipie.rake:77:in 'block (4 levels) in <top (required)>' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/tasks/apipie.rake:66:in 'each' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/tasks/apipie.rake:66:in 'block (3 levels) in <top (required)>' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/tasks/apipie.rake:192:in 'with_loaded_documentation' /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-rails-0.5.6/lib/tasks/apipie.rake:64:in 'block (2 levels) in <top (required)>' /usr/share/foreman/lib/tasks/apipie.rake:6:in 'block (2 levels) in <top (required)>' Tasks: TOP => apipie:cache (See full trace by running task with --trace) 2018-05-02 14:44:19 -0700 | Started 2018-05-02 14:44:24 -0700 | Documents loaded... 2018-05-02 14:44:24 -0700 | Processing docs for
Community thread: https://community.theforeman.org/t/apipieindex-nomethoderror/8967
Updated by Tomer Brisker over 6 years ago
- Category set to Orchestration
- Difficulty set to easy
This is caused by Host::Managed only including orchestration concern when unattended is set to true. Should be a fairly simple fix.
Updated by Shira Maximov over 6 years ago
- Status changed from New to Assigned
- Assignee set to Shira Maximov
Updated by The Foreman Bot over 6 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/5687 added
Updated by Tomer Brisker over 6 years ago
- Translation missing: en.field_release set to 353
- Triaged set to No
Updated by Shira Maximov over 6 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset c189204f22219354a22e43ba82f0d33e74438d3c.
Actions