Bug 1129202 - PGError when hostgroup name exceeds 245 characters
Summary: PGError when hostgroup name exceeds 245 characters
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI
Version: 6.0.4
Hardware: Unspecified
OS: Unspecified
low
medium vote
Target Milestone: Unspecified
Assignee: orabin
QA Contact: jcallaha
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On: 1120271
Blocks: 1123818
TreeView+ depends on / blocked
 
Reported: 2014-08-12 09:54 UTC by Sachin Ghai
Modified: 2017-02-23 21:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:14:05 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 7038 None None None 2016-04-22 16:19:43 UTC

Description Sachin Ghai 2014-08-12 09:54:32 UTC
Description of problem:
I was trying to validate the hostgroup form and found that if we enter more than 245 chars in 'Name' field of hostgroup, It raises PGError:

--
Processing by HostgroupsController#update as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"8YKMIr6xgzHyJpwH0LC3VbHzoQSwOk+VOG2XoH0FhiE=", "hostgroup"=>{"name"=>"SSTQOPqJiwFllLmBmDRZoWsarPNwQhcEypKFfTozMHnmPtTqkgebNCMSMxBdywiWmEbraUdMnjnSIvdKFeioxAgvPTutMitBTTRExegkJRTzxlAHDIasfjwEAabNhzvevKiTDbYXbaqVFArexnApWfavHFpPSoDothzHwKVZOYrqGtSicQxHHrBoLcuNwrANGduNLMCurtGjlrkweKZNVqDaxmOPfvHBQjwapFpfbhLxGPksMwxGn1", "environment_id"=>"", "content_source_id"=>"", "puppet_ca_proxy_id"=>"", "puppet_proxy_id"=>"", "domain_id"=>"", "realm_id"=>"", "architecture_id"=>"", "root_pass"=>"[FILTERED]", "location_ids"=>[""], "organization_ids"=>[""]}, "kt_environment_id"=>"", "kt_activation_keys"=>"", "commit"=>"Submit", "id"=>"16-sstqopqjiwflllmbmdrzowsarpnwqhceypkfftozmhnmpttqkgebncmsmxbdywiwmebraudmnjnsivdkfeioxagvptutmitbttrexegkjrtzxlahdiasfjweaabnhzvevkitdbyxbaqvfarexnapwfavhfppsodothzhwkvzoyrqgtsicqxhhrbolcunwrangdunlmcurtgjlrkwekznvqdaxmopfvhbqjwapfpfbhlxgpksmwxgn"}
Operation FAILED: PGError: ERROR:  value too long for type character varying(255)
: UPDATE "lookup_values" SET "match" = 'hostgroup=SSTQOPqJiwFllLmBmDRZoWsarPNwQhcEypKFfTozMHnmPtTqkgebNCMSMxBdywiWmEbraUdMnjnSIvdKFeioxAgvPTutMitBTTRExegkJRTzxlAHDIasfjwEAabNhzvevKiTDbYXbaqVFArexnApWfavHFpPSoDothzHwKVZOYrqGtSicQxHHrBoLcuNwrANGduNLMCurtGjlrkweKZNVqDaxmOPfvHBQjwapFpfbhLxGPksMwxGn1' WHERE "lookup_values"."match" = 'hostgroup=SSTQOPqJiwFllLmBmDRZoWsarPNwQhcEypKFfTozMHnmPtTqkgebNCMSMxBdywiWmEbraUdMnjnSIvdKFeioxAgvPTutMitBTTRExegkJRTzxlAHDIasfjwEAabNhzvevKiTDbYXbaqVFArexnApWfavHFpPSoDothzHwKVZOYrqGtSicQxHHrBoLcuNwrANGduNLMCurtGjlrkweKZNVqDaxmOPfvHBQjwapFpfbhLxGPksMwxGn'
  Rendered common/500.html.erb within layouts/application (5.7ms)
  Rendered layouts/base.html.erb (1.4ms)
Completed 500 Internal Server Error in 67ms (Views: 9.7ms | ActiveRecord: 8.1ms)
---

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

How reproducible:
always

Steps to Reproduce:
1. create hostgroup with more than 245 char in name
2.
3.

Actual results:
Operation FAILED: PGError: ERROR:  value too long for type character varying(255)

Expected results:
User should be allowed to enter 255 char in name field and if it exceeds 255 char then UI should throw a clean validation error instead of PGError

Additional info:

Comment 1 Dominic Cleal 2014-08-12 09:59:14 UTC
Created redmine issue http://projects.theforeman.org/issues/7038 from this bug

Comment 3 Bryan Kearney 2014-09-15 13:45:15 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/7038 has been closed
-------------
Ori Rabin
Applied in changeset commit:5fbe760e04c27400c054c6260f6ffcfec72c2c8c.

Comment 4 jcallaha 2014-12-05 21:47:05 UTC
*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

Version Tested:
RHEL 65/66/7

ruby193-rubygem-foreman_hooks-0.3.7-2.el7.noarch
foreman-postgresql-1.8.0-0.develop.201412040955git563fa28.el7.noarch
qe-foreman-rhel7.usersys.redhat.com-qpid-client-cert-1.0-1.noarch
foreman-libvirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_bootdisk-4.0.2-1.el7.noarch
foreman-compute-1.8.0-0.develop.201412040955git563fa28.el7.noarch
ruby193-rubygem-foreman_discovery-1.4.1-1.el7.noarch
foreman-proxy-1.8.0-0.develop.201411261259git6ddd00d.el7.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410git163c264.git.0.988ca80.el7.noarch
qe-foreman-rhel7.usersys.redhat.com-foreman-proxy-1.0-1.noarch
foreman-release-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-gce-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-vmware-1.8.0-0.develop.201412040955git563fa28.el7.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201411121216git9381fc5.el7.noarch
ruby193-rubygem-foreman-tasks-0.6.9-1.el7.noarch
foreman-ovirt-1.8.0-0.develop.201412040955git563fa28.el7.noarch
foreman-selinux-1.8.0-0.develop.201411281557gitf4a857f.el7.noarch
foreman-1.8.0-0.develop.201412040955git563fa28.el7.noarch
qe-foreman-rhel7.usersys.redhat.com-foreman-client-1.0-1.noarch
qe-foreman-rhel7.usersys.redhat.com-apache-1.0-1.noarch
qe-foreman-rhel7.usersys.redhat.com-parent-cert-1.0-1.noarch
ruby193-rubygem-foreman_docker-0.2.0-2.el7.noarch
qe-foreman-rhel7.usersys.redhat.com-puppet-client-1.0-1.noarch
qe-foreman-rhel7.usersys.redhat.com-qpid-broker-1.0-1.noarch

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

Comment 6 errata-xmlrpc 2015-08-12 05:14:05 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.