Project

General

Profile

Bug #23536

apipie:cache:index NoMethodError when unattended=false

Added by John Marion 5 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Orchestration
Target version:
Difficulty:
easy
Triaged:
No
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

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

Associated revisions

Revision c189204f (diff)
Added by Shira Maximov 3 months ago

Fixes #23536 - No errors when unattended=false

History

#1 Updated by Tomer Brisker 4 months ago

  • Difficulty set to easy
  • Category set to Orchestration

This is caused by Host::Managed only including orchestration concern when unattended is set to true. Should be a fairly simple fix.

#2 Updated by Shira Maximov 3 months ago

  • Assignee set to Shira Maximov
  • Status changed from New to Assigned

#3 Updated by The Foreman Bot 3 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5687 added

#4 Updated by Tomer Brisker 3 months ago

  • Triaged set to No
  • Legacy Backlogs Release (now unused) set to 353

#5 Updated by Shira Maximov 3 months ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF