Created attachment 1262443 [details] appliance log Description of problem: Items such as credentials, playbooks and repositories cannot be shown in CFME UI due the error in refresh procedure. Version-Release number of selected component (if applicable): 5.8.0.4-nightly.20170310135842_5075263 How reproducible: Always Steps to Reproduce: 1. Enable Embedded Ansible. 2. Add some project, inventory and template via embedded ansible tower ui. 3. Navigate to Automation->Ansible->Credentials, Playbooks or Repositories. Actual results: These screens are empty. Expected results: Appropriate items should be shown in that screens. Additional info: If you try to refresh embedded ansible provider manually with this command: ManageIQ::Providers::EmbeddedAnsible::Provider.first.refresh_ems you got such output: PostgreSQLAdapter#log_after_checkout, connection_pool: size: 5, connections: 1, in use: 1, waiting_in_queue: 0 => [#<ManageIQ::Providers::EmbeddedAnsible::AutomationManager id: 1, name: "Embedded Ansible Automation Manager", created_on: "2017-03-13 10:24:37", updated_on: "2017-03-13 12:56:02", guid: "428c46e6-07d7-11e7-b1c1-001a4a44260e", zone_id: 1, type: "ManageIQ::Providers::EmbeddedAnsible::AutomationMa...", api_version: "3.1.0-0.git201702280600", uid_ems: nil, host_default_vnc_port_start: nil, host_default_vnc_port_end: nil, provider_region: nil, last_refresh_error: "undefined method `credential_id' for #<AnsibleTowe...", last_refresh_date: "2017-03-13 12:56:02", provider_id: 1, realm: nil, tenant_id: 1, project: nil, parent_ems_id: nil, subscription: nil, last_metrics_error: nil, last_metrics_update_date: nil, last_metrics_success_date: nil, tenant_mapping_enabled: nil>] Pay attention to string "last_refresh_error: "undefined method `credential_id' for #<AnsibleTowe...""
Stacktrace: [----] E, [2017-03-13T06:41:32.047702 #15462:e35134] ERROR -- : /var/www/miq/vmdb/app/models/ems_refresh/refreshers/ems_refresher_mixin.rb:50:in `refresh' /var/www/miq/vmdb/app/models/manageiq/providers/base_manager/refresher.rb:10:in `refresh' /var/www/miq/vmdb/app/models/ems_refresh.rb:99:in `block in refresh' /var/www/miq/vmdb/app/models/ems_refresh.rb:98:in `each' /var/www/miq/vmdb/app/models/ems_refresh.rb:98:in `refresh' /var/www/miq/vmdb/app/models/miq_queue.rb:347:in `block in deliver' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:91:in `block in timeout' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `block in catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:33:in `catch' /opt/rh/rh-ruby23/root/usr/share/ruby/timeout.rb:106:in `timeout' /var/www/miq/vmdb/app/models/miq_queue.rb:343:in `deliver' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:106:in `deliver_queue_message' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:134:in `deliver_message' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:152:in `block in do_work' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `loop' /var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:146:in `do_work' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:334:in `block in do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:331:in `do_work_loop' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:153:in `run' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:128:in `start' /var/www/miq/vmdb/app/models/miq_worker/runner.rb:21:in `start_worker' /var/www/miq/vmdb/app/models/miq_worker.rb:343:in `block in start_runner' /opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork' /opt/rh/cfme-gemset/gems/nakayoshi_fork-0.0.3/lib/nakayoshi_fork.rb:24:in `fork' /var/www/miq/vmdb/app/models/miq_worker.rb:341:in `start_runner' /var/www/miq/vmdb/app/models/miq_worker.rb:352:in `start' /var/www/miq/vmdb/app/models/miq_worker.rb:270:in `start_worker' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:68:in `start_worker_for_ems' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:46:in `block in sync_workers' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `each' /var/www/miq/vmdb/app/models/mixins/per_ems_worker_mixin.rb:45:in `sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:53:in `block in sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `each' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:50:in `sync_workers' /var/www/miq/vmdb/app/models/miq_server/worker_management/monitor.rb:22:in `monitor_workers' /var/www/miq/vmdb/app/models/miq_server.rb:348:in `block in monitor' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-0441a53b546e/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-0441a53b546e/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block' /var/www/miq/vmdb/app/models/miq_server.rb:348:in `monitor' /var/www/miq/vmdb/app/models/miq_server.rb:370:in `block (2 levels) in monitor_loop' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-0441a53b546e/lib/gems/pending/util/extensions/miq-benchmark.rb:11:in `realtime_store' /opt/rh/cfme-gemset/bundler/gems/manageiq-gems-pending-0441a53b546e/lib/gems/pending/util/extensions/miq-benchmark.rb:30:in `realtime_block' /var/www/miq/vmdb/app/models/miq_server.rb:370:in `block in monitor_loop' /var/www/miq/vmdb/app/models/miq_server.rb:369:in `loop' /var/www/miq/vmdb/app/models/miq_server.rb:369:in `monitor_loop' /var/www/miq/vmdb/app/models/miq_server.rb:252:in `start' /var/www/miq/vmdb/lib/workers/evm_server.rb:65:in `start' /var/www/miq/vmdb/lib/workers/evm_server.rb:91:in `start' /var/www/miq/vmdb/lib/workers/bin/evm_server.rb:4:in `<main>'
Just a early findings: For the dev-ansible-tower-3 we have, (byebug) collector.projects.collect(&:credential) [nil, nil, 3, nil, nil, nil, nil, nil, nil] (byebug) collector.projects.collect(&:credential_id) [nil, nil, 3, nil, nil, nil, nil, nil, nil] And it complete successfully I am intercepting the refresh at https://github.com/jameswnl/manageiq/blob/c9e9ae107ecc16d13517f019c5616e33a268c1f7/app/models/manageiq/providers/ansible_tower/shared/inventory/parser/automation_manager.rb#L47 but for a newly downloaded Tower (byebug) collector.projects.collect(&:credential) [nil] (byebug) collector.projects.collect(&:credential_id) *** NoMethodError Exception: undefined method `credential_id' for #<AnsibleTowerClient::Project:0x007feac176ea90> Did you mean? credential credential= nil
https://github.com/ManageIQ/manageiq/pull/14297
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/853078d5ad49df5fa9ad9fae1582538a7c2d3015 commit 853078d5ad49df5fa9ad9fae1582538a7c2d3015 Author: James Wong <jwong> AuthorDate: Mon Mar 13 11:34:50 2017 -0400 Commit: James Wong <jwong> CommitDate: Thu Mar 16 13:28:25 2017 -0400 check if project has credential before try to use it https://bugzilla.redhat.com/show_bug.cgi?id=1431629 .../ansible_tower/shared/inventory/parser/automation_manager.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
The cause to this problem is due to https://github.com/ansible/ansible_tower_client_ruby/issues/68 The reason that an existing Tower instance and the recorded vcr cassette for the spec tests don't have problem is: they have in the mix some projects that have credential associated and that would make the ruby class have the 'credential_id' field defined. The newly deployed appliance in question has no projects with credential associated. So this fix will eliminate our problem here (during refresh).
PR https://github.com/ManageIQ/manageiq/pull/14297 is merged to upstream.
Verified in 5.8.0.7.20170321164727_1c97ccd. Embedded ansible data such as playbooks, credentials and repositories are shown in the ui.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2017:1367