Bug 1127090

Summary: ActivationKey: UI raises misleading validation error on updating the content-host limit from finite number to 'unlimited'
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Christine Fouant <cfouant>
WebUI sub component: Katello QA Contact: jcallaha
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: bbuckingham, bkearney, sthirugn
Version: 6.0.4Keywords: Regression, Triaged
Target Milestone: Unspecified   
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/7730
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-12 05:13:35 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:
Attachments:
Description Flags
updating the limit to 'unlimited' throws misleading error none

Description Sachin Ghai 2014-08-06 06:52:40 UTC
Created attachment 924366 [details]
updating the limit to 'unlimited' throws misleading error

Description of problem:
I created a activation-key with "content host limit" 6.

Later, I updated the limit to unlimited and UI raises error:

An error occurred saving the Activation Key: Validation failed: Max content hosts cannot be nil 

Firstly, I updated the limit to 'unlimited' and error message says "Max content hosts cannot be nil" This error message is misleading here, isn't it ?

Please correct me if I misunderstood something..

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

How reproducible:
always

Steps to Reproduce:
1. create a activation-eky with content-host limit with finite no ( say 6)
2. Update the limit to 'unlimited'
3.

Actual results:
UI throws error:
An error occurred saving the Activation Key: Validation failed: Max content hosts cannot be nil 

Expected results:
The limit should be updated to 'unlimited' without any error

Additional info:

logs from production.log on updating limit:

---
Processing by Katello::Api::V2::ActivationKeysController#update as JSON
  Parameters: {"organization"=>{"name"=>"Default_Organization", "label"=>"Default_Organization"}, "created_at"=>"2014-08-06T06:42:49Z", "updated_at"=>"2014-08-06T06:42:59Z", "id"=>"4", "name"=>"testkey", "description"=>nil, "unlimited_content_hosts"=>true, "content_view"=>{"id"=>1, "name"=>"Default Organization View", "label"=>"Default_Organization_View", "description"=>nil, "organization_id"=>1, "default"=>true, "created_at"=>"2014-07-31T11:59:07Z", "updated_at"=>"2014-07-31T11:59:07Z", "composite"=>nil, "next_version"=>1, "organization"=>"Default_Organization", "environments"=>["Library"], "versions"=>[1], "versions_details"=>[{"version"=>1, "published"=>"2014-07-31 11:59:07 UTC", "environments"=>["Library"]}]}, "content_view_id"=>1, "environment_id"=>1, "usage_count"=>0, "user_id"=>3, "max_content_hosts"=>6, "release_version"=>nil, "service_level"=>nil, "pools"=>[], "content_overrides"=>[], "permissions"=>{"view_activation_keys"=>true, "edit_activation_keys"=>true, "destroy_activation_keys"=>true}, "environment"=>{"id"=>1, "name"=>"Library", "selected"=>true}, "products"=>[], "host_collections"=>[], "api_version"=>"v2", "activation_key"=>{"id"=>"4", "name"=>"testkey", "description"=>nil, "environment_id"=>1, "created_at"=>"2014-08-06T06:42:49Z", "updated_at"=>"2014-08-06T06:42:59Z", "user_id"=>3, "max_content_hosts"=>6, "content_view_id"=>1, "release_version"=>nil, "unlimited_content_hosts"=>true, "service_level"=>nil}}
ActiveRecord::RecordInvalid
max_content_hosts: ["cannot be nil"]
Completed 422 Unprocessable Entity in 245ms (Views: 0.8ms | ActiveRecord: 4.6ms)
Client disconnected.

----

Comment 5 jcallaha 2014-12-05 14:30:37 UTC
*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

Version Tested:
RHEL 65/66/7

katello-server-ca-1.0-1.noarch
rubygem-hammer_cli_katello-0.0.6-1.201412050102git3acc58e.git.0.c645b3c.el7.noarch
katello-certs-tools-2.0.1-1.el7.noarch
pulp-katello-0.3-3.el7.noarch
katello-repos-2.1.1-1.el7.noarch
ruby193-rubygem-katello-2.1.0-1.201412050047git1f935b9.el7.noarch
katello-default-ca-1.0-1.noarch
katello-2.1.0-1.201411061509gitb0b8f43.el7.noarch
katello-installer-2.1.0-1.201412031757git1434d70.el7.noarch

Comment 6 Bryan Kearney 2015-08-11 13:20:05 UTC
This bug is slated to be released with Satellite 6.1.

Comment 7 errata-xmlrpc 2015-08-12 05:13:35 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-2015:1592