Project

General

Profile

Actions

Bug #8220

closed

creating/updating activation-key with long integer value under content-host limit raises PGError: integer out of range

Added by Christine Fouant about 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Web UI
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1139576
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:


Related issues 1 (0 open1 closed)

Copied to Katello - Bug #9455: creating/updating activation-key with long integer value under content-host limit raises PGError: integer out of rangeClosedChristine Fouant10/30/2014Actions
Actions #1

Updated by The Foreman Bot about 10 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 59
  • Pull request https://github.com/Katello/katello/pull/4785 added
  • Pull request deleted ()
Actions #2

Updated by Eric Helms about 10 years ago

  • Translation missing: en.field_release set to 14
  • Triaged changed from No to Yes
Actions #3

Updated by Christine Fouant about 10 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #4

Updated by Christine Fouant almost 10 years ago

  • Copied to Bug #9455: creating/updating activation-key with long integer value under content-host limit raises PGError: integer out of range added
Actions

Also available in: Atom PDF