Created attachment 935588 [details] complete logs from production.log Description of problem: I defined a long integer value under content-host limit field, while creating activation-key and nothing happens on save. The form neither submitted nor UI raised any error. But production.log filled with a long traceback. Similar issue on update, but on update, UI raises error. production.log on create: --- Processing by Katello::Api::V2::ActivationKeysController#create as JSON Parameters: {"unlimited_content_hosts"=>false, "name"=>"test_key", "max_content_hosts"=>1.1111111111111111e+42, "environment"=>{"id"=>244, "name"=>"Library", "selected"=>true}, "content_view_id"=>255, "organization_id"=>"209", "api_version"=>"v2", "activation_key"=>{"name"=>"test_key", "organization_id"=>"209", "max_content_hosts"=>1.1111111111111111e+42, "content_view_id"=>255, "unlimited_content_hosts"=>false}} PGError: ERROR: value "1111111111111111126596901884379344347856896" is out of range for type integer : INSERT INTO "katello_activation_keys" ("content_view_id", "cp_id", "created_at", "description", "environment_id", "max_content_hosts", "name", "organization_id", "release_version", "unlimited_content_hosts", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) RETURNING "id" (ActiveRecord::StatementInvalid) /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1171:in `get_last_result' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1171:in `exec_cache' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:665:in `block in exec_query' --- Version-Release number of selected component (if applicable): sat6 GA rc2 How reproducible: always Steps to Reproduce: 1. define long integer value (11111111111111) under content-host limit field while creating/updating a activation-key 2. 3. Actual results: PGError: ERROR: value "1111111111111111126596901884379344347856896" is out of range for type integer Expected results: UI should throw proper validation error or Content-Host limit field should be highlighted with red border. Additional info:
Created attachment 935589 [details] PGError: ERROR: integer out of range : On updating content-host limit to long integer value
Created redmine issue http://projects.theforeman.org/issues/8220 from this bug
Moving to POST since upstream bug http://projects.theforeman.org/issues/8220 has been closed ------------- Christine Fouant Applied in changeset commit:katello|d2bcce043c3057700d92e1f0e2b0389f4fb8539c.
Verified with: Satellite-6.1.0-RHEL-6-20150210.0 Sat6.1.0 beta snap2 On creating actvation-key with below content-host limit: "1111111111111111126596901884379344347856896", error thrown on UI: must be less than 2147483648 This error appears twice. Also with long traceback in production.log. Is this message expected ? Processing by Katello::Api::V2::ActivationKeysController#create as JSON Parameters: {"unlimited_content_hosts"=>false, "max_content_hosts"=>1.1111111111111111e+42, "name"=>"ak1", "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}, "content_view_id"=>3, "organization_id"=>"3", "api_version"=>"v2", "activation_key"=>{"name"=>"ak1", "organization_id"=>"3", "max_content_hosts"=>1.1111111111111111e+42, "content_view_id"=>3, "unlimited_content_hosts"=>false}} 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' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in `with_transaction_returning_status' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in `save!' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0/app/lib/katello/lazy_accessor.rb:102:in `save!' /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.2.0/app/lib/actions/katello/activation_key/create.rb:19:in `plan' /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.3/lib/dynflow/action.rb:398:in `block (3 levels) in execute_plan' /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.3/lib/dynflow/middleware/stack.rb:26:in `call' /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.3/lib/dynflow/middleware/stack.rb:26:in `pass' /opt/rh/ruby193/root/usr/share/gems/gems/dynflow-0.7.3/lib/dynflow/middleware.rb:16:in `pass'
Created attachment 991252 [details] error thrown twice and with unknown range, is is expected range ?
Verified in Satellite 6.1.0 snap 4 compose 2. Version tested: RHEL 66 RHEL 71
This bug is slated to be released with Satellite 6.1.
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