Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1343006 - content view filter cannot be created
Summary: content view filter cannot be created
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Hammer
Version: 6.2.0
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: Unspecified
Assignee: Zach Huntington-Meath
QA Contact: Roman Plevka
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1353471
Blocks: 1228890
TreeView+ depends on / blocked
 
Reported: 2016-06-06 10:22 UTC by Oleksandr Shtaier
Modified: 2019-09-26 16:19 UTC (History)
2 users (show)

Fixed In Version: rubygem-hammer_cli_katello-0.0.22.18-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 11:01:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15395 0 Normal Closed content view filter cannot be created 2020-10-21 14:12:48 UTC

Description Oleksandr Shtaier 2016-06-06 10:22:10 UTC
Description of problem:
When I try to create new content view filter I am getting:
Could not create the filter:
  One of parameters [ organization_id ] required but not specified.

But organization-id was actually specified. For example:
>hammer -v -u user -p pass --output=csv content-view filter create --name="my_name" --inclusion="false" --repositories="zAlZrFsZGeQJvvK" --content-view-id="1748" --organization-id="1730" --type="rpm"

Just in case, chosen organization is a valid one:
>hammer -u user -p pass organization info --id 1730
Id:                     1730
Name:                   bHLGgI
Users:                  

Smart proxies:          
    liJQg0FLPr
Subnets:
...

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

How reproducible:
Always

Steps to Reproduce:
1. Create new organization
2. Create new product for that organization
3. Create yum repository for that product
4. Sync that repo
5. Create new content view for that organization
6. Add repository to content view
7. Try to use command that was used in example above

Actual results:
Unexpected error is raised

Expected results:
Content view filter is created successfully

Additional info:

Comment 1 Oleksandr Shtaier 2016-06-06 11:01:56 UTC
It seems that it is more related to all content view sub-commands

hammer -v -u user -p admin --output=csv content-view add-repository --organization-id="1731" --product="dxtZjHsVVJTsFOjCkvBY" --name="cSbGOWdXXf" --repository="xKQRUAyqdpgawck"

Comment 2 Oleksandr Shtaier 2016-06-06 11:03:05 UTC
Gives next error:

[ERROR 2016-06-06 06:49:28 Exception] One of parameters [ organization_id ] required but not specified.
Could not add repository:
  One of parameters [ organization_id ] required but not specified.

Comment 5 Roman Plevka 2016-06-07 08:14:31 UTC
WORKAROUND:

use --repository-ids or --product-id instead of --repositories and --product.
The error is actually related to these as the names of the ARs are not necessary unique across the orgs so it requires org-id to specify and this option is missing.
using the *-id[s] parameter uniquely specifies the AR.

Comment 6 Roman Plevka 2016-06-07 08:16:46 UTC
There are occurrences of this error in other subcommands too:
BZ #1309107
Setting it as related.

Comment 7 Oleksandr Shtaier 2016-06-07 09:37:10 UTC
Yes, it seems these defects are related. Of course, mentioned BZ #1309107 showed its behavior a long time ago, but current one only week ago. There is a chance that it was probably blocked by other defects and was unblocked recently.

Comment 8 Oleksandr Shtaier 2016-06-07 10:00:06 UTC
However, not exactly:

hammer -v -u admin -p changeme --output=csv content-view add-repository --organization="lpxKT2" --product="hDcByfFuRzICPjBkcjyR" --name="fDLiyTuHAP" --repository="agJQoVHXmGNCLaB"

[ERROR 2016-06-07 05:56:27 Exception] One of parameters [ organization_id ] required but not specified.
Could not add repository:
  One of parameters [ organization_id ] required but not specified.
[ERROR 2016-06-07 05:56:27 Exception] 
RestClient::ResourceNotFound (404 Resource Not Found)

Providing organization instead organization-id doesn't resolve the issue

Comment 9 Oleksandr Shtaier 2016-06-07 10:12:19 UTC
Same for upload content:
hammer -v -u admin -p changeme --output=csv repository upload-content --organization="L4e1n3" --product-id="784" --name="FeLSCgiipuJArpt" --path="/tmp/which-2.19-6.el6.x86_64.rpm"

[ERROR 2016-06-07 06:10:52 Exception] One of parameters [ organization_id ] required but not specified.
Could not upload the content:
  One of parameters [ organization_id ] required but not specified.

Comment 10 Zach Huntington-Meath 2016-06-13 20:37:11 UTC
Created redmine issue http://projects.theforeman.org/issues/15395 from this bug

Comment 11 Bryan Kearney 2016-06-27 18:15:33 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15395 has been closed

Comment 12 Roman Plevka 2016-07-11 12:34:18 UTC
VERIFIED
on sat6.2 snap19.1

The organization-id is correctly being picked up

# hammer --csv -u admin -p changeme content-view filter create --name="foo_filter_1" --inclusion="false" --repositories="foo_repo_1" --content-view-id 4 --organization foo_org_2 --type="rpm"
Message,Id,Name
Filter created,1,foo_filter_1

Comment 13 Bryan Kearney 2016-07-27 11:01:02 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/RHBA-2016:1501


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