Bug 841121

Summary: Long description while creating system group returns PG error
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: WebUIAssignee: Bryan Kearney <bkearney>
Status: CLOSED UPSTREAM QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: bbuckingham, bkearney, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-19 18:12:22 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
PG Error: while creating sys group with long description none

Description Sachin Ghai 2012-07-18 08:26:17 UTC
Created attachment 598814 [details]
PG Error: while creating sys group with long description

Description of problem:
I was trying to create a system group and when I enter a long description ( more than 255 charcters) and click on save, UI riased a long error message:

PGError: ERROR: value too long for type character varying(255) : INSERT INTO "system_groups" ("created_at", "organization_id", "description", "updated_at", "pulp_id", "name", "max_systems") VALUES ('2012-07-18 05:14:19.114868', 1, 'and to test the decription with long text. Description with long text is supported. But I guess not in this case as I got an PG error and trying to reproduce. Not sure if I can reproduce it but just giving it a try. Let see what happens in this case. Lets try to add more text to reproduce that PG error.', '2012-07-18 05:14:19.114868', 'ACME_Corporation-testgrp-54a00821', 'testgrp', -1) RETURNING "id"

Version-Release number of selected component (if applicable):
katello-0.2.45-1.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. Go to systems => select system groups
2. Click 'new system group" and enter name and long description
3. click on save
  
Actual results:
PGError: ERROR: value too long for type character varying(255) : INSERT INTO "system_groups" ("created_at", "organization_id", "description", "updated_at"
<truncated>

Expected results:
Error message should be improved like:
Validation failed: System group description can not contain more than 255 characters.

Additional info:

Comment 1 Sachin Ghai 2012-07-18 08:30:16 UTC
The same issue appears when we pass long description while copying an existing sys_group.

Comment 2 Pavel Pokorny 2012-09-06 12:25:37 UTC
Fixed in b372ab1

Comment 3 Brad Buckingham 2012-09-06 12:44:35 UTC
From looking at the code, it looks like this issue may exist in multiple models.  I'd recommend that we address all of them with this BZ and document the impacted models in the BZ resolution.  Given this is a small change, I think that would be better than creating a separate BZ for each case.

Comment 4 Pavel Pokorny 2012-09-06 13:23:50 UTC
I checked:

activation_key - ok
changeset - ok
kt_environment - ok
organization - ok
permission - ok
provider - ok
role - there was limit in migration to 250 chars so i modified validation
sync_plan - added validation
system_group - ok
system_template - ok
system - ok

Comment 6 Mike McCune 2013-08-16 17:53:16 UTC
getting rid of 6.0.0 version since that doesn't exist

Comment 7 Mike McCune 2013-09-19 18:12:22 UTC
These bugs have been resolved in upstream projects for a period of months so I'm mass-closing them as CLOSED:UPSTREAM.  If this is a mistake feel free to re-open.