Bug 1192356 - On updating the content-host limit with long integer under activation-key, UI neither raised any error nor save the changes
Summary: On updating the content-host limit with long integer under activation-key, UI...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Activation Keys
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium vote
Target Milestone: Unspecified
Assignee: Brad Buckingham
QA Contact: Perry Gagne
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-02-13 08:50 UTC by Sachin Ghai
Modified: 2019-09-26 16:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-27 09:13:15 UTC
Target Upstream Version:


Attachments (Terms of Use)
no error raised on UI, on updating content host limit with long integer value (30.20 KB, image/png)
2015-02-13 08:53 UTC, Sachin Ghai
no flags Details
Satellite 6.1.1: Activation Key validation error (95.59 KB, image/png)
2015-09-01 19:19 UTC, Brad Buckingham
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1501 normal SHIPPED_LIVE Red Hat Satellite 6.2 Capsule and Server 2016-07-27 12:28:58 UTC

Description Sachin Ghai 2015-02-13 08:50:14 UTC
Description of problem:
I created a activation-key with content-host limit 1 and later tried to update it with long integer value. But UI neither raise any error not save the changes.

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

Satellite-6.1.0-RHEL-6-20150210.0
Sat6.1.0 beta snap2


How reproducible:
always

Steps to Reproduce:
1. create activationkey with content-host limit '1'
2. update it with long integer value 111111111111

Actual results:
UI neither save changes nor raises any error

Expected results:
On saving the changes, UI should raise validation error.

Additional info:
production.log raises exception:
Processing by Katello::Api::V2::ActivationKeysController#update as JSON
  Parameters: {"organization"=>{"name"=>"testorg", "label"=>"testorg", "id"=>3}, "created_at"=>"2015-02-13T03:11:44Z", "updated_at"=>"2015-02-13T03:20:06Z", "id"=>"2", "name"=>"ak1", "description"=>nil, "unlimited_content_hosts"=>false, "auto_attach"=>true, "content_view"=>{"id"=>3, "name"=>"Default Organization View", "label"=>"73c34419-092f-4696-be48-5d0c7f8168b1", "description"=>nil, "organization_id"=>3, "default"=>true, "created_at"=>"2015-02-13T01:13:49Z", "updated_at"=>"2015-02-13T01:13:49Z", "composite"=>nil, "next_version"=>1, "organization"=>"testorg", "environments"=>["Library"], "versions"=>["1.0"], "versions_details"=>[{"version"=>"1.0", "published"=>"2015-02-13 01:13:49 UTC", "environments"=>["Library"]}]}, "content_view_id"=>3, "environment_id"=>5, "usage_count"=>0, "user_id"=>3, "max_content_hosts"=>11111111111, "release_version"=>nil, "service_level"=>nil, "content_overrides"=>[], "permissions"=>{"view_activation_keys"=>true, "edit_activation_keys"=>true, "destroy_activation_keys"=>true}, "environment"=>{"id"=>5, "name"=>"Library", "label"=>"Library", "description"=>nil, "organization"=>{"name"=>"testorg", "label"=>"testorg", "id"=>3}, "created_at"=>"2015-02-13T01:13:49Z", "updated_at"=>"2015-02-13T01:13:49Z", "library"=>true, "prior"=>nil, "successor"=>nil, "counts"=>{"content_hosts"=>0, "content_views"=>0, "packages"=>0, "puppet_modules"=>0, "errata"=>{"security"=>0, "bugfix"=>0, "enhancement"=>0, "total"=>0}, "yum_repositories"=>2, "docker_repositories"=>0, "products"=>2}, "permissions"=>{"view_lifecycle_environments"=>true, "edit_lifecycle_environments"=>true, "destroy_lifecycle_environments"=>false, "promote_or_remove_content_views_to_environments"=>true}, "selected"=>true}, "products"=>[], "host_collections"=>[], "api_version"=>"v2", "activation_key"=>{"id"=>"2", "name"=>"ak1", "description"=>nil, "environment_id"=>5, "created_at"=>"2015-02-13T03:11:44Z", "updated_at"=>"2015-02-13T03:20:06Z", "user_id"=>3, "max_content_hosts"=>11111111111, "content_view_id"=>3, "release_version"=>nil, "unlimited_content_hosts"=>false, "auto_attach"=>true, "service_level"=>nil}}
Validation failed: Max content hosts must be less than 2147483648 (ActiveRecord::RecordInvalid)
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in `save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `block in save!'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in `block in with_transaction_returning_status'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in `transaction'

Comment 1 Sachin Ghai 2015-02-13 08:53:11 UTC
Created attachment 991268 [details]
no error raised on UI, on updating content host limit with long integer value

Comment 3 Roman Plevka 2015-08-10 14:35:38 UTC
The issue seems to exist on all the numerical id-related attributes and originates from the API.

Here's the bug I created to cover the root cause issue: 1252046

Comment 4 Brad Buckingham 2015-09-01 19:19:08 UTC
I have tested this on a Satellite 6.1.1 GA install and am no longer observing
the behavior described.

RPMs:
ruby193-rubygem-katello-2.2.0.66-1.el7sat.noarch
foreman-1.7.2.34-1.el7sat.noarch

Attaching updated screenshot.

Comment 5 Brad Buckingham 2015-09-01 19:19:51 UTC
Created attachment 1069118 [details]
Satellite 6.1.1: Activation Key validation error

Comment 6 Roman Plevka 2016-03-09 12:24:35 UTC
VERIFIED
as Comment#5 states, the issue has been fixed in 6.1.1 and no longer occurs.

Comment 9 errata-xmlrpc 2016-07-27 09:13:15 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.