Bug 1735114 - After an upgrade from 5.10 ansible services stdout displays an error
Summary: After an upgrade from 5.10 ansible services stdout displays an error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.11.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.11.0
Assignee: Jason Frey
QA Contact: Jaroslav Henner
Red Hat CloudForms Documentation
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-31 18:38 UTC by Nick Carboni
Modified: 2020-01-02 11:56 UTC (History)
6 users (show)

Fixed In Version: 5.11.0.21
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-13 14:55:17 UTC
Category: Bug
Cloudforms Team: Ansible
Target Upstream Version:


Attachments (Terms of Use)

Description Nick Carboni 2019-07-31 18:38:03 UTC
Description of problem:
After an upgrade from 5.10 to 5.11 provisioned ansible playbook services show "Error loading data: undefined method `[]' for nil:NilClass" in place of the playbook stdout in the "Provisioning" tab.


Version-Release number of selected component (if applicable):
5.11.0.17

Steps to Reproduce:
1. Upgrade a 5.10 appliance with deployed ansible playbook services
2. Navigate to the service's provisioning tab in 5.11
3. Observe

Actual results:

Page shows "Error loading data: undefined method `[]' for nil:NilClass"

Backtrace in evm.log:
[----] I, [2019-07-31T14:31:07.407682 #9480:2adebb0b05bc]  INFO -- : MIQ(MiqPriorityWorker::Runner#get_message_via_drb) Message id: [273], MiqWorker id: [18], Zone: [default], Role: [], Server: [], MiqTask id: [8], Ident: [generic], Target id: [], Instance id: [1], Task id: [], Command: [ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job.raw_stdout], Timeout: [600], Priority: [20], State: [dequeue], Deliver On: [], Data: [], Args: ["html"], Dequeued in: [1.248996197] seconds
[----] I, [2019-07-31T14:31:07.407847 #9480:2adebb0b05bc]  INFO -- : MIQ(MiqQueue#deliver) Message id: [273], Delivering...
[----] I, [2019-07-31T14:31:07.594997 #9480:2adebb0b05bc]  INFO -- : MIQ(MiqTask#update_status) Task: [8] [Active] [Ok] [Task starting]
[----] E, [2019-07-31T14:31:07.636034 #9480:2adebb0b05bc] ERROR -- : MIQ(MiqQueue#deliver) Message id: [273], Error: [undefined method `[]' for nil:NilClass]
[----] E, [2019-07-31T14:31:07.636203 #9480:2adebb0b05bc] ERROR -- : [NoMethodError]: undefined method `[]' for nil:NilClass  Method:[block (2 levels) in <class:LogProxy>]
[----] E, [2019-07-31T14:31:07.636339 #9480:2adebb0b05bc] ERROR -- : /var/www/miq/vmdb/app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb:111:in `raw_stdout_json'
/var/www/miq/vmdb/app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb:115:in `raw_stdout_txt'
/var/www/miq/vmdb/app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb:119:in `raw_stdout_html'
/var/www/miq/vmdb/app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb:46:in `raw_stdout'
/var/www/miq/vmdb/app/models/miq_queue.rb:460:in `block in dispatch_method'
/usr/share/ruby/timeout.rb:93:in `block in timeout'
/usr/share/ruby/timeout.rb:33:in `block in catch'
/usr/share/ruby/timeout.rb:33:in `catch'
/usr/share/ruby/timeout.rb:33:in `catch'
/usr/share/ruby/timeout.rb:108:in `timeout'
/var/www/miq/vmdb/app/models/miq_queue.rb:458:in `dispatch_method'
/var/www/miq/vmdb/app/models/miq_queue.rb:435:in `block in deliver'
/var/www/miq/vmdb/app/models/user.rb:290:in `with_user_group'
/var/www/miq/vmdb/app/models/miq_queue.rb:435:in `deliver'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:104:in `deliver_queue_message'
/var/www/miq/vmdb/app/models/miq_queue_worker_base/runner.rb:137:in `deliver_message'


Expected results:
An empty section or a friendly message such as "No Output found for Service"

Additional info:
Previously we queried the built-in tower instance for this output live, since tower is no-longer running on the appliance the data is expected to be inaccessible.

Comment 3 CFME Bot 2019-08-16 18:36:06 UTC
New commit detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/69abc49102f8f04097b8c1f349b49839476eeab6
commit 69abc49102f8f04097b8c1f349b49839476eeab6
Author:     Jason Frey <jfrey@redhat.com>
AuthorDate: Thu Aug 15 14:31:19 2019 -0400
Commit:     Jason Frey <jfrey@redhat.com>
CommitDate: Thu Aug 15 14:31:19 2019 -0400

    Handle cases where an EmbeddedAnsible job may not have stdout

    Old jobs before the new embedded ansible code will not have the stdout
    in the database. In addition, there are timing issues where stdout may
    not yet be populated. This commit defensively handles all of these
    cases.

    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1735114

 app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb | 6 +-
 lib/terminal_to_html.rb | 2 +-
 spec/models/manageiq/providers/embedded_ansible/automation_manager/job_spec.rb | 86 +-
 3 files changed, 83 insertions(+), 11 deletions(-)

Comment 4 CFME Bot 2019-08-16 20:46:05 UTC
New commit detected on ManageIQ/manageiq/ivanchuk:

https://github.com/ManageIQ/manageiq/commit/1473b1acec15a7937f5eb933ccf8530fd778e6ca
commit 1473b1acec15a7937f5eb933ccf8530fd778e6ca
Author:     Nick Carboni <ncarboni@redhat.com>
AuthorDate: Fri Aug 16 14:32:14 2019 -0400
Commit:     Nick Carboni <ncarboni@redhat.com>
CommitDate: Fri Aug 16 14:32:14 2019 -0400

    Merge pull request #19155 from Fryguy/fix_missing_task_context

    Handle cases where an EmbeddedAnsible job may not have stdout

    (cherry picked from commit a6242cb9cdbdb32f902167f5b7db7a0f92504587)

    https://bugzilla.redhat.com/show_bug.cgi?id=1735114

 app/models/manageiq/providers/embedded_ansible/automation_manager/job.rb | 6 +-
 lib/terminal_to_html.rb | 2 +-
 spec/models/manageiq/providers/embedded_ansible/automation_manager/job_spec.rb | 86 +-
 3 files changed, 83 insertions(+), 11 deletions(-)

Comment 5 Jaroslav Henner 2019-09-02 12:48:14 UTC
I created an Ansible Playbook service in 5.10, dumped the db, and restored on two 5.11 appliances:
cfme-5.11.0.22-1.el8cf.x86_64
cfme-5.11.0.19-1.el8cf.x86_64

When I took a look on the service created on the 5.10 machine on the 5.11.0.19, I got
Error loading data: undefined method `collect' for nil:NilClass

on the newer one I got:
No output available

This was fixed


Note You need to log in before you can comment on or make changes to this bug.