Bug 1629945 - Reports do not run when submitted through a UI which does not have reporting role on.
Summary: Reports do not run when submitted through a UI which does not have reporting ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.9.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: GA
: 5.10.0
Assignee: Joe Rafaniello
QA Contact: Tasos Papaioannou
URL:
Whiteboard:
Depends On:
Blocks: 1635255
TreeView+ depends on / blocked
 
Reported: 2018-09-17 16:35 UTC by Jeffrey Cutter
Modified: 2020-03-30 11:50 UTC (History)
13 users (show)

Fixed In Version: 5.10.0.18
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1635255 (view as bug list)
Environment:
Last Closed: 2019-02-12 16:49:48 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jeffrey Cutter 2018-09-17 16:35:57 UTC
Description of problem:
If you queue a report to run using the OPS UI of an appliance which does not have the reporting role enabled, the report never runs.

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

How reproducible:
Always.

Steps to Reproduce:
1. Login to the OPS UI of an appliance which does not have the reporting role enabled.
2. Queue a report to run.
3. Wait and wait.

Actual results:
Report never generates.

Expected results:
An appliance with the reporting role should run the report.

Additional info:

Comment 2 Antonin Pagac 2018-09-18 15:14:14 UTC
I was asked to reproduce this issue but it seems it is not present.

Appliance version: 5.9.4.7

Testing setup:
 - first appliance with internal database region 0, Reporting role switched off
 - second appliance with external database region 0, Reporting role on (default)

Steps to Reproduce:
1. Login to an appliance with Reporting role disabled (first one in my setup)
2. Queue a report to run
3. Refresh the page

Results:
The report gets generated and runs fine. There's a date and time in the "Run At" column and the Status is "Complete".

Comment 3 Jeffrey Cutter 2018-09-18 15:25:07 UTC
Antonin,

Are your appliances in separate zones?

-Jeff

Comment 4 Antonin Pagac 2018-09-19 07:31:41 UTC
Hi Jeff,

my appliances were in the same (default) zone.

I tried creating a new zone and moving one of the appliances into it and with this setup, the original issue is indeed present. My report is queued and not running.

Comment 5 Joe Rafaniello 2018-09-24 19:10:01 UTC
Jeff,

There are two problems described here:
1) Appliance 1 is the UI, Appliance 2 has reporting role.  Both are in same region(database) but different zones.  Reporting messages are enqueued for the zone of the appliance 1 and never picked up by appliance 2.

2) No appliances have the reporting role enabled.  Messages are enqueued for the zone of the UI appliance.  Nothing picks up the messages.

I *think* we can fix 1).  It looks like we're defaulting the zone to the zone of the appliance taking the UI request, it should be easy enough to make this zone agnostic.

For 2), if you disable the reporting role on all the appliances, the best we could possibly do is have the UI check if the zone is enabled in the region before trying to queue it but that would introduce more changes and possibly unforeseen bugs.

For this bug, I will look into fixing 1)... is that what you're asking for?

Comment 6 Jeffrey Cutter 2018-09-25 18:44:07 UTC
Hi Joe,

Yes, #1 is what I'm asking for.  In my case, we have reporting enabled in the UI zone, but occasionally admins login to appliances not in the UI zone (a worker zone for example) and forget and when they queue reports they never run.  I was hoping for exactly what you are suggesting as a fix.

Thanks,
-Jeff

Comment 8 CFME Bot 2018-10-01 18:36:18 UTC
New commits detected on ManageIQ/manageiq/master:

https://github.com/ManageIQ/manageiq/commit/68dad680ff842c865dc1d9fb4b54dc67f279aff3
commit 68dad680ff842c865dc1d9fb4b54dc67f279aff3
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Fri Sep 28 18:09:57 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Fri Sep 28 18:09:57 2018 -0400

    Queue zone is handled in 'put' for regional roles

    Notifier is a regional role, so there's no need to set the zone for it
    here.  It's done lower in the stack, when 'put' calls 'determine_queue_zone'.

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

 app/models/miq_queue.rb | 4 +-
 1 file changed, 3 insertions(+), 1 deletion(-)


https://github.com/ManageIQ/manageiq/commit/c43619b5606215874fbb11ab61eaeb5aec06fbdd
commit c43619b5606215874fbb11ab61eaeb5aec06fbdd
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Fri Sep 28 18:14:16 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Fri Sep 28 18:14:16 2018 -0400

    Leverage submit_job for role based queueing

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

    Because the queue put was specifying a queue_name without a role OR
    zone, the zone was being set to MiqServer.my_zone.  By leveraging the
    higher level method, submit_job, specifying the service of "reporting"
    sets the role and because reporting is a regional role, there's no need
    to specify the zone, it will default to the "nil" (any) zone.

 app/models/miq_report/generator.rb | 9 +-
 app/models/miq_report/generator/async.rb | 1 -
 spec/models/miq_report/async_spec.rb | 33 +
 spec/models/miq_report/generator_spec.rb | 57 +
 4 files changed, 94 insertions(+), 6 deletions(-)


https://github.com/ManageIQ/manageiq/commit/c5c004cb2488da80ab6d91cdb55c0497612d92c2
commit c5c004cb2488da80ab6d91cdb55c0497612d92c2
Author:     Joe Rafaniello <jrafanie>
AuthorDate: Fri Sep 28 18:18:35 2018 -0400
Commit:     Joe Rafaniello <jrafanie>
CommitDate: Fri Sep 28 18:18:35 2018 -0400

    Specify "any" zone via a nil zone

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

 app/models/miq_widget.rb | 1 +
 spec/models/miq_widget_spec.rb | 1 +
 2 files changed, 2 insertions(+)

Comment 10 CFME Bot 2018-10-02 13:21:10 UTC
New commit detected on ManageIQ/manageiq/hammer:

https://github.com/ManageIQ/manageiq/commit/9d680ed61217a82f61fe964357ad65aac7ea8d25
commit 9d680ed61217a82f61fe964357ad65aac7ea8d25
Author:     Brandon Dunne <brandondunne>
AuthorDate: Mon Oct  1 14:34:36 2018 -0400
Commit:     Brandon Dunne <brandondunne>
CommitDate: Mon Oct  1 14:34:36 2018 -0400

    Merge pull request #18041 from jrafanie/queue_reporting_work_for_any_zone

    Queue reporting work for any zone

    (cherry picked from commit 65ef49c7d2bc27a56406d18bf9e40d1696871e94)

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

 app/models/miq_queue.rb | 4 +-
 app/models/miq_report/generator.rb | 9 +-
 app/models/miq_report/generator/async.rb | 1 -
 app/models/miq_widget.rb | 1 +
 spec/models/miq_report/async_spec.rb | 33 +
 spec/models/miq_report/generator_spec.rb | 57 +
 spec/models/miq_widget_spec.rb | 1 +
 7 files changed, 99 insertions(+), 7 deletions(-)

Comment 11 CFME Bot 2018-10-02 20:23:35 UTC
New commit detected on ManageIQ/manageiq-automation_engine/hammer:

https://github.com/ManageIQ/manageiq-automation_engine/commit/e8b937a19a727a64083b4a7424c17084bbaad070
commit e8b937a19a727a64083b4a7424c17084bbaad070
Author:     Madhu Kanoor <mkanoor>
AuthorDate: Tue Oct  2 15:35:56 2018 -0400
Commit:     Madhu Kanoor <mkanoor>
CommitDate: Tue Oct  2 15:35:56 2018 -0400

    Merge pull request #241 from gmcculloug/remove_nil_zone_check

    Remove check for nil zone during MiqQueue.put of GenericMailer

    (cherry picked from commit 1a1b0a03ca14ae8a230dc473a14c8003076871a6)

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

 spec/engine/miq_ae_method_service/miq_ae_service_methods_spec.rb | 3 +-
 1 file changed, 1 insertion(+), 2 deletions(-)

Comment 12 Tasos Papaioannou 2018-10-18 19:32:56 UTC
Verified on 5.10.0.20.


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