Bug 1750924

Summary: Report Template execution via hammer fails with "unknown parent permission"
Product: Red Hat Satellite Reporter: Dylan Gross <dgross>
Component: ReportingAssignee: Marek Hulan <mhulan>
Status: CLOSED ERRATA QA Contact: Lukáš Hellebrandt <lhellebr>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.5.0CC: bkearney, egolov, inecas, mhulan, oprazak
Target Milestone: 6.7.0Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: foreman-1.24.0-0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-14 13:25:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dylan Gross 2019-09-10 18:46:24 UTC
Description of problem:

  When attempting to execute a report template permission via the CLI, it fails with an error if you attempt to use "--name" of the report template:   "ERF42-5227 [Foreman::Exception]: unknown parent permission for api/v2/report_templates#generate"

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

  Red Hat Satellite 6.5.2

How reproducible:

  Always.  

Steps to Reproduce:
1.  # hammer report-template generate --name "Applicable errata" --organization myorg


Actual results:  Returns error:  ERF42-5227 [Foreman::Exception]: unknown parent permission for api/v2/report_templates#generate


Expected results:  Report is executed and out is displayed.


Additional info:

Workaround:  Specifying the ID number of the report template (from "hammer report-template list" does work).  


# hammer report-template list
----|------------------
ID  | NAME             
----|------------------
197 | Applicable errata
198 | Host statuses CSV
199 | Registered hosts 
200 | Subscriptions    
----|------------------

# hammer report-template generate --id 197
 (Resulting successful data omitted)

Comment 3 Dylan Gross 2019-09-10 18:51:31 UTC
Correction - This error is only produced if the --organization is specified.

If left off, it runs the report correctly.   Though since the "hammer report-template generate --help" shows --organization ORGANIZATION_NAME as an option, it's still a bug.

So ... 

  (works):   # hammer report-template generate --name "Applicable errata"

  (doesn't): # hammer report-template generate --name "Applicable errata" --organization myorg

Comment 6 Lukáš Hellebrandt 2019-10-17 10:29:25 UTC
Just reproduced, this is a valid bug even in 6.6.

Comment 8 Marek Hulan 2019-10-31 15:15:48 UTC
Created redmine issue https://projects.theforeman.org/issues/28167 from this bug

Comment 9 Bryan Kearney 2019-11-05 20:30:41 UTC
Upstream bug assigned to mhulan

Comment 10 Bryan Kearney 2019-11-05 20:30:42 UTC
Upstream bug assigned to mhulan

Comment 11 Bryan Kearney 2019-11-06 17:03:43 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28167 has been resolved.

Comment 13 Lukáš Hellebrandt 2019-12-05 09:24:52 UTC
Verified with Sat 6.7 snap 4.

Tried manually using reproducer from comment 3. Also, corresponding test in automation passed.

Comment 16 errata-xmlrpc 2020-04-14 13:25:37 UTC
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-2020:1454