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 1654944 - No validation on download policy for non-yum repositories
Summary: No validation on download policy for non-yum repositories
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Repositories
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.5.0
Assignee: Samir Jha
QA Contact: vijsingh
URL:
Whiteboard:
: 1645748 1658527 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-30 06:38 UTC by Nikhil Kathole
Modified: 2019-11-05 22:40 UTC (History)
6 users (show)

Fixed In Version: tfm-rubygem-katello-3.10.0.6-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:39:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 25793 0 Normal Closed No validation on download policy for non-yum repositories 2020-02-25 11:11:10 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:39:27 UTC

Description Nikhil Kathole 2018-11-30 06:38:09 UTC
Description of problem:

Trying to create non-yum repositories via hammer did not throw exception if user specified on_demand download policy.


Version-Release number of selected component (if applicable):
Satellite 6.5 snap 5

How reproducible: always


Steps to Reproduce:
1. # hammer -v -u admin -p changeme --output=csv product create --description="aSTvrQbvLPZBmCPYlBce" --label="pdLSDBiObZmxSzcQzYhg" --name="YLqaeUGVtk" --organization-id="1"
Message,Id,Name
Product created.,71,YLqaeUGVtk

2. # hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="71" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Message,Id,Name
Repository created.,85,VBOjhSxRofEyePL


Actual results: No validation error.


Expected results: Should throw validation error.


Additional info:

On 6.4,

# hammer -v -u admin -p changeme --output=csv product create --description="aSTvrQbvLPZBmCPYlBce" --label="pdLSDBiObZmxSzcQzYhg" --name="YLqaeUGVtk" --organization-id="1"
Message,Id,Name
Product created,632,YLqaeUGVtk

# hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="632" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
[ERROR 2018-11-30T07:29:21 API] 422 Unprocessable Entity
[ERROR 2018-11-30T07:29:21 Exception] Validation failed: Download policy cannot be set for non-yum repositories.
Could not create the repository:
  Validation failed: Download policy cannot be set for non-yum repositories.
[ERROR 2018-11-30T07:29:21 Exception] 

RestClient::UnprocessableEntity (422 Unprocessable Entity):
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:223:in `exception_with_response'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/abstract_response.rb:103:in `return!'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:353:in `block in rest_client_call_block'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:807:in `process_result'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:725:in `block in transmit'
    /opt/rh/rh-ruby24/root/usr/share/ruby/net/http.rb:877:in `start'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:715:in `transmit'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:145:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/request.rb:52:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/rest-client-2.0.1/lib/restclient/resource.rb:67:in `post'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:327:in `call_client'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:240:in `http_call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:190:in `call_action'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/api.rb:185:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/apipie-bindings-0.2.2/lib/apipie_bindings/resource.rb:21:in `call'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/apipie/command.rb:51:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli_foreman-0.13.2.2/lib/hammer_cli_foreman/commands.rb:168:in `send_request'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/apipie/command.rb:34:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/subcommand/execution.rb:11:in `execute'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/lib/hammer_cli/abstract.rb:29:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    /opt/theforeman/tfm/root/usr/share/gems/gems/hammer_cli-0.13.1.1/bin/hammer:143:in `<top (required)>'
    /usr/bin/hammer:23:in `load'
    /usr/bin/hammer:23:in `<main>'

Comment 7 Nikhil Kathole 2019-01-07 15:58:23 UTC
*** Bug 1658527 has been marked as a duplicate of this bug. ***

Comment 8 Samir Jha 2019-01-07 18:58:28 UTC
Created redmine issue http://projects.theforeman.org/issues/25793 from this bug

Comment 10 Bryan Kearney 2019-01-08 15:29:49 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/25793 has been resolved.

Comment 12 vijsingh 2019-01-14 06:21:30 UTC
Verified:

@Satellite 6.5.0 Snap 11.0

Steps:

>> unable to create repo non-yum repo with download policy:

# hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="131" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Could not create the repository:
  Validation failed: Download policy Cannot set attribute download_policy for content type puppet

# hammer -v -u admin -p changeme --output=csv repository create --content-type="file" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="131" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Could not create the repository:
  Validation failed: Download policy Cannot set attribute download_policy for content type file

# hammer -v -u admin -p changeme --output=csv repository create --content-type="ostree" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="131" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Could not create the repository:
  Validation failed: OSTree Repositories cannot be unprotected., Download policy Cannot set attribute download_policy for content type ostree

# hammer -v -u admin -p changeme --output=csv repository create --content-type="docker" --download-policy="on_demand" --name="VBOjhSxRofEyePL" --product-id="131" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Could not create the repository:
  Validation failed: Docker upstream name cannot be blank when Repository URL is provided., Upstream Name cannot be blank when Repository URL is provided., Download policy Cannot set attribute download_policy for content type docker

>> Able to create repo non-yum repo without download policy:

# hammer -v -u admin -p changeme --output=csv repository create --content-type="puppet" --name="VBOjhSxRofEyePL" --product-id="131" --publish-via-http="true" --url="http://inecas.fedorapeople.org/fakerepos/zoo3/"
Message,Id,Name
Repository created.,287,VBOjhSxRofEyePL



Observation:

 - Unable to create repo non-yum repo with download policy and seen validation error: "Download policy Cannot set attribute download_policy for content type"
 - Able to create repo non-yum repo without download policy

Comment 13 Brad Buckingham 2019-01-14 16:23:22 UTC
*** Bug 1645748 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2019-05-14 12:39:19 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-2019:1222


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