Closed lfu closed 6 years ago
@lfu looks like this issue is introduced with changes in https://github.com/ManageIQ/manageiq/pull/17712 by this line change https://github.com/ManageIQ/manageiq/pull/17712/files#diff-489c4924423f9722859b2decd6371911R21 cc @tumido See error trace below:
[----] F, [2018-08-10T15:00:37.005571 #32628:6e087dc] FATAL -- : Error caught: [ActionView::Template::Error] The single-table inheritance mechanism failed to locate the subclass: 'ManageIQ::Providers::AnsibleTower::AutomationManager::WorkflowJob'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite OrchestrationStack.inheritance_column to use another column for that information.
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/inheritance.rb:182:in `rescue in find_sti_class'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/inheritance.rb:175:in `find_sti_class'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/inheritance.rb:163:in `discriminate_class_for_record'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/persistence.rb:67:in `instantiate'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/querying.rb:50:in `block (2 levels) in find_by_sql'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/result.rb:52:in `block in each'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/result.rb:52:in `each'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/result.rb:52:in `each'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/querying.rb:50:in `map'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/querying.rb:50:in `block in find_by_sql'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/querying.rb:49:in `find_by_sql'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/statement_cache.rb:109:in `execute'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/singular_association.rb:65:in `get_records'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/singular_association.rb:69:in `find_target'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/association.rb:148:in `load_target'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/association.rb:53:in `reload'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/singular_association.rb:14:in `reader'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activerecord-5.0.7/lib/active_record/associations/builder/association.rb:111:in `resource'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:17:in `public_send'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:17:in `try!'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:6:in `try'
/home/hkataria/dev/manageiq/app/models/service_ansible_tower.rb:21:in `job'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:17:in `public_send'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:17:in `try!'
/home/hkataria/.rvm/gems/ruby-2.4.4/gems/activesupport-5.0.7/lib/active_support/core_ext/object/try.rb:6:in `try'
/home/hkataria/dev/manageiq-ui-classic/app/views/service/_svcs_show.html.haml:15:in `__home_hkataria_dev_manageiq_ui_classic_app_views_service__svcs_show_html_haml__2902916322992597572_69892921278580'
@h-kataria I made a change to app/helpers/service_helper/textual_summary.rb as you suggested:
def textual_group_tower_job_plays
return nil unless fetch_job
return nil unless @job.respond_to?(:job_plays)
fetch_job_plays
end
Then the testing went further and hit another error:
[----] F, [2018-08-13T15:22:37.120113 #72904:3fdc866da2c0] FATAL -- : Error caught: [ActionView::Template::Error] undefined method `raw_stdout_via_worker' for #<ManageIQ::Providers::AnsibleTower::AutomationManager::WorkflowJob:0x00007fb913653dc0>
/Users/lfu/.gem/ruby/2.4.2/gems/activemodel-5.0.7/lib/active_model/attribute_methods.rb:433:in `method_missing'
/Users/lfu/code/miq/plugins/manageiq-ui-classic/app/views/service/_svcs_show.html.haml:45:in `block in _plugins_manageiq_ui_classic_app_views_service__svcs_show_html_haml___2342410185805835597_70216413423400'
which makes sense as raw_stdout_via_worker
is a template job method, not available for a workflow job.
UI should treat workflow job and template job differently, not sharing one code.
Found this error in development.log when testing https://github.com/ManageIQ/manageiq-providers-ansible_tower/pull/103.
Steps to re-create the issue: