Bug 1123815 - subnet name char limit is capped to 238 instead of 255
Summary: subnet name char limit is capped to 238 instead of 255
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI
Version: 6.0.3
Hardware: Unspecified
OS: Unspecified
low
low vote
Target Milestone: Unspecified
Assignee: orabin
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1120181
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-28 10:24 UTC by Kedar Bidarkar
Modified: 2017-02-23 21:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:11:44 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:1592 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC
Foreman Issue Tracker 7139 None None None 2016-04-22 15:06:41 UTC

Description Kedar Bidarkar 2014-07-28 10:24:52 UTC
Description of problem:

subnet names throw PGError when char limit is greater than 238.

PGError: ERROR: value too long for type character varying(255) : INSERT INTO "audits" ("action", "associated_id", "associated_name", "associated_type", "auditable_id", "auditable_name", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "user_id", "user_type", "username", "version") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15) RETURNING "id"



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

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

currently subnet name accepts only 238 chars only. 
anything above 238 chars throws error.

Expected results:

We need both the below fixes for the subnet.

a) subnet char should accept upto 255 chars
b) subnet's name field should handle the char limit issues and report "more than 255 chars is not allowed", instead of the UI throwing the PGError.

Additional info:

Comment 1 Dominic Cleal 2014-07-28 10:53:48 UTC
I think we're getting the picture.  These BZs are causing a lot of work and overhead.  Please use the existing top level bug #1120271 in future.

Comment 3 orabin 2014-08-05 15:39:31 UTC
see 1120199

Comment 5 Sachin Ghai 2014-08-18 06:21:18 UTC
In sat6 GA snap5, I can create a subnet with more than 255 characters in name. However I didn't see issue related to PGError. UI successfully create a subnet with any length of name.

We should add a validation here if name increases 255 char, UI should raise an error message. So moving it back to assigned state. 

--
Processing by SubnetsController#index as HTML
  Parameters: {"utf8"=>"✓", "search"=>"name = \"UcZNeuEsQLmPEfKyIooaJnbVyeDbCOkZMuzXLLHtcnpiVrDowVsJhweVbINhSRDLIQrReOwAHWmCepUNasLudQMHKGBDTHGpTSZOcepUDnoiFFfCwjXnfLfzbrZcLCqZXPQmOtAWfCGbtrrtdNFZZspiaCzJKvDGOhmdhyFpGetKsNEHgbBLIhRtBnJuFdanUxBYtAZvAHkqYwYytAcvjnQirHsZapnuOSTYmrEmCUypPGhszUkhsFFBQMjgisqR\""}
--

Comment 6 Sachin Ghai 2014-08-18 06:22:29 UTC
logs generated in production.log while creating subnet > 255 char

--
Processing by SubnetsController#create as */*
  Parameters: {"utf8"=>"✓", "search"=>"", "authenticity_token"=>"4kt4+IYKrYfOwbpXLUsyMFIiE3rkA2Qq5eBP60KAzAw=", "subnet"=>{"name"=>"UcZNeuEsQLmPEfKyIooaJnbVyeDbCOkZMuzXLLHtcnpiVrDowVsJhweVbINhSRDLIQrReOwAHWmCepUNasLudQMHKGBDTHGpTSZOcepUDnoiFFfCwjXnfLfzbrZcLCqZXPQmOtAWfCGbtrrtdNFZZspiaCzJKvDGOhmdhyFpGetKsNEHgbBLIhRtBnJuFdanUxBYtAZvAHkqYwYytAcvjnQirHsZapnuOSTYmrEmCUypPGhszUkhsFFBQMjgisqR", "network"=>"53.242.105.0", "mask"=>"255.255.255.0", "gateway"=>"", "dns_primary"=>"", "dns_secondary"=>"", "from"=>"", "to"=>"", "vlanid"=>"", "domain_ids"=>[""], "dhcp_id"=>"", "tftp_id"=>"", "dns_id"=>"", "location_ids"=>[""], "organization_ids"=>[""]}}
Redirected to https://qetello02.usersys.redhat.com/subnets
Completed 302 Found in 41ms (ActiveRecord: 6.4ms)
--

Comment 7 Dominic Cleal 2014-08-18 08:05:29 UTC
If the subnet is created successfully with that name, it's not a bug.  Lack of errors is a good thing.

Comment 8 Sachin Ghai 2014-08-18 14:34:24 UTC
@Dominic: the behaviour should be consistent across the UI and with other entities too.

On creating subnet with more than 255 char in name, UI should throw validation error like: "is too long (maximum is 255 characters)"

It is also part of expected result.

Comment 9 Bryan Kearney 2014-08-24 12:03:41 UTC
Upstream bug assigned to orabin@redhat.com

Comment 10 orabin 2014-09-24 12:13:40 UTC
this bug was fixed with BZ 1120181

Comment 11 jcallaha 2014-10-17 18:14:56 UTC
*** Verified ***

foreman-release-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-gce-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el6.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410gitc96619d.git.0.37f3704.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-foreman-proxy-1.0-1.noarch
foreman-postgresql-1.7.0-0.develop.201410150839gitb948163.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-qpid-broker-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-qpid-client-cert-1.0-1.noarch
foreman-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-ovirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-vmware-1.7.0-0.develop.201410150839gitb948163.el6.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6.noarch
ruby193-rubygem-foreman_discovery-1.4.0-0.1.rc4.el6.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201410151235gitbc8c449.el6.noarch
ruby193-rubygem-foreman_bootdisk-4.0.0-1.el6.noarch
foreman-proxy-1.7.0-0.develop.201410101404git7961640.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-puppet-client-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-foreman-client-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-apache-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-parent-cert-1.0-1.noarch
foreman-compute-1.7.0-0.develop.201410150839gitb948163.el6.noarch
ruby193-rubygem-foreman-tasks-0.6.10-1.el6.noarch
foreman-libvirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch

Comment 12 Bryan Kearney 2015-08-11 13:30:45 UTC
This bug is slated to be released with Satellite 6.1.

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


Note You need to log in before you can comment on or make changes to this bug.