Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1576129 - Unexpected Error when accessing SERVICE -> REQUESTS (undefined method find_tags_by_grouping)
Summary: Unexpected Error when accessing SERVICE -> REQUESTS (undefined method find_ta...
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Appliance
Version: 5.8.0
Hardware: x86_64
OS: Linux
Target Milestone: GA
: 5.10.0
Assignee: Yuri Rudman
QA Contact: Shveta
Depends On:
Blocks: 1583710 1583711
TreeView+ depends on / blocked
Reported: 2018-05-08 22:33 UTC by Reartes Guillermo
Modified: 2021-06-10 16:06 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1583710 1583711 (view as bug list)
Last Closed: 2019-02-11 13:58:58 UTC
Category: ---
Cloudforms Team: CFME Core
Target Upstream Version:

Attachments (Terms of Use)
tenant, role, group, user (121.31 KB, image/png)
2018-05-08 22:33 UTC, Reartes Guillermo
no flags Details
role details (119.27 KB, image/png)
2018-05-08 22:34 UTC, Reartes Guillermo
no flags Details
group (85.73 KB, image/png)
2018-05-08 22:34 UTC, Reartes Guillermo
no flags Details
unexpected error (47.45 KB, image/png)
2018-05-08 22:35 UTC, Reartes Guillermo
no flags Details
production.log showing the error (15.51 KB, text/plain)
2018-05-08 22:36 UTC, Reartes Guillermo
no flags Details

System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 3448281 0 None None None 2018-05-17 02:29:56 UTC

Description Reartes Guillermo 2018-05-08 22:33:49 UTC
Created attachment 1433453 [details]
tenant, role, group, user

Description of problem:


undefined method `find_tags_by_grouping' for #<MiqRequest::ActiveRecord_Relation:0x0000000021a278a0> [miq_request/show_list]

I tired several roles and permission combination.
It even happens when the role is given "everything".

Version-Release number of selected component (if applicable):
CF 4.6 (CFME

How reproducible:

Steps to Reproduce:
1. create tenant, role, group and user as in the screenshots
2. login as user

Actual results:
cannot access SERVICE -> REQUESTS UI Section

Expected results:
access SERVICE -> REQUESTS UI Section

Additional info:
admin is not affected.

Comment 2 Reartes Guillermo 2018-05-08 22:34:21 UTC
Created attachment 1433454 [details]
role details

Comment 3 Reartes Guillermo 2018-05-08 22:34:41 UTC
Created attachment 1433455 [details]

Comment 4 Reartes Guillermo 2018-05-08 22:35:00 UTC
Created attachment 1433456 [details]
unexpected error

Comment 5 Reartes Guillermo 2018-05-08 22:36:06 UTC
Created attachment 1433457 [details]
production.log showing the error

Comment 7 Felix Dewaleyne 2018-05-10 15:59:12 UTC
this affects all pages where the request list is present. the only role that can see anything is EVM_SuperAdministrator

Comment 13 Yuri Rudman 2018-05-22 20:03:19 UTC
I can reproduce "undefined method `find_tags_by_grouping'.. " error

Comment 16 CFME Bot 2018-05-23 15:17:10 UTC
New commit detected on ManageIQ/manageiq/master:

commit 582d4abc12cf7c94aed6d4885a42d68a00c9d5cc
Author:     Yuri Rudman <yrudman@redhat.com>
AuthorDate: Tue May 22 22:45:22 2018 -0400
Commit:     Yuri Rudman <yrudman@redhat.com>
CommitDate: Tue May 22 22:45:22 2018 -0400

    MiqRequest was added to RBAC in https://github.com/ManageIQ/manageiq/pull/17208 but did not include ActAsTaggable concern.
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1576129

 app/models/miq_request.rb | 2 +
 1 file changed, 2 insertions(+)

Comment 17 Shveta 2018-05-23 17:42:39 UTC
Dev was able to recreate

Comment 24 Joe Rafaniello 2018-06-29 14:36:18 UTC
Imaan, a user reported a problem with this bug fix in https://github.com/ManageIQ/manageiq/pull/17466#issuecomment-395747685.  I'm working on a complete fix for this issue.

Comment 25 CFME Bot 2018-06-29 16:51:51 UTC
New commit detected on ManageIQ/manageiq/master:

commit f8c05532cf654cff8e39bded83c25af8fbec281c
Author:     Joe Rafaniello <jrafanie@redhat.com>
AuthorDate: Fri Jun 29 10:59:11 2018 -0400
Commit:     Joe Rafaniello <jrafanie@redhat.com>
CommitDate: Fri Jun 29 10:59:11 2018 -0400

    Remove Request taggable and prevent tag filtering

    MiqRequest was changed to allow ownership for self service and limited
    self-service users in ManageIQ #17208, BZ #1545395

    This caused a problem if you had tag filters assign to a user's group
    undefined method `find_tags_by_grouping'.  This was fixed in
    ManageIQ #17466, BZ #1576129, and shipped with:

    Fine: BZ #1583711
    Gaprindindashvili: BZ #1583710

    Unfortunately, this second fix to add taggable caused a new bug: users in
    groups having tag filters could not see their own requests.

    This commit changes MiqRequest to no longer be taggable, since it's not
    even taggable in the UI and instead, we add MiqRequest to a list of
    models that are RBAC'able but not taggable so we don't try to filter
    MiqRequest based on a user's group tag filters.

    Credit goes to github user LorkScorguar who reported this issue and
    provided lots of diagnostics to help us fix this properly.

    To test this, simply assign managed filters to a user's group, such as
    /managed/environments/production, create a request for that user and
    try to see that user's request.  They couldn't see it if they received
    the intermediate fix, #17466, or if they didn't receive that fix, they'd
    receive the `find_tags_by_grouping` error shown above.

    For gaprindashvili and fine:
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1596738

    For hammer:
    Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1576129

 app/models/miq_request.rb | 2 -
 lib/rbac/filterer.rb | 2 +-
 spec/lib/rbac/filterer_spec.rb | 41 +
 3 files changed, 42 insertions(+), 3 deletions(-)

Comment 27 Yuri Rudman 2018-07-18 11:56:11 UTC
Fix for this BZ ("undefined method 'find_tags_by_grouping...' ") introduced another bug: user can not see requests if users are in groups with managed tags.

This new issue was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1596738 and fixed in https://github.com/ManageIQ/manageiq/pull/17656

Comment 28 Shveta 2018-07-18 19:11:06 UTC
Fixed in

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