Bug 498467 - Cloned channel generated name is longer than limit
Cloned channel generated name is longer than limit
Status: CLOSED CURRENTRELEASE
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI (Show other bugs)
530
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Dobies
John Matthews
: Regression
Depends On:
Blocks: 456985
  Show dependency treegraph
 
Reported: 2009-04-30 12:00 EDT by Corey Welton
Modified: 2009-09-10 16:36 EDT (History)
4 users (show)

See Also:
Fixed In Version: sat530
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-10 16:36:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Corey Welton 2009-04-30 12:00:40 EDT
Description of problem:
When cloning some channels -- for example, the RHEL 5 RHN Tools channel for x86_64 -- the channel name field is prepopulated using characters that are not accepted input.  We shouldn't be prepopulating fields with data that the user cannot, by default, submit/accept.


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

Satellite-5.3.0-RHEL5-re20090422.2-i386.iso but probably earlier.

How reproducible:
Every time.

Steps to Reproduce:
1. sync your RHEL5 x86_64 channel and associated RHN Tools channel.
2. (=) clone channel >  Clone from: Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64) 
3.  View populated fields on resulting page, and submit.
  
Actual results:

Form is submitted with value of "Clone of Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)" in the Channel Name field, and thus channel creation fails with the following error:

Invalid channel name 'Clone of Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)' - must be at least 6 characters long and no longer than 64 characters, begin with a letter, and contain only letters, digits, spaces, '-', ' / ', '_' and '.'


Expected results:

Default values pre-populated in fields should, by default, be valid data.

Additional info:
Comment 1 Brandon Perkins 2009-05-05 11:59:56 EDT
Changed summary to "Parenthesis are not respected as a valid character when cloning channels."  The real issue is that Red Hat and all versions of Satellite have always respected parenthesis as a valid character in channel names.  So we should allow this to work as we have in all previous versions of Satellite.  That makes this a regression that we don't allow parenthesis anymore.
Comment 2 Jay Dobies 2009-05-06 15:55:43 EDT
I'm not sure the parenthesis is the issue. I was able to clone a channel successfully with parentheses. The message is incorrect; it doesn't indicate parentheses are valid.

The example in this description fails because the name is too long (67 characters v. the maximum of 64). We need to either truncate when we generate the name or expand the name's possible length.
Comment 3 Jérôme Fenal 2009-05-06 17:59:47 EDT
FWIW, also had this issue in RHS 5.2. Limiting the name length did the trick. Same for Description IIRC.
Comment 4 Jay Dobies 2009-05-07 10:37:57 EDT
After some back and forth on the mailing list, we came up with the following:

- Increase the size of the channel name column to 256. If the Red Hat channels are already coming close to this, it's likely that the limit is too short for our needs.

- If the generated name is still too long, show a UI error about the length. This is already in place. There is an annoying amount of logic involved in the truncation and reverification that the name is unique, and it's a much more unlikely scenario with the column name increase.
Comment 5 Jay Dobies 2009-05-07 10:40:49 EDT
Also, this is basically a duplicate of 459827.
Comment 6 Jay Dobies 2009-05-07 10:49:35 EDT
Master
commit	c80bcc63b7b067b59692bc9332e0416699caab94
tree	ddf5fc4cf05fbd66fb0c208e576c2423adc830ac

Vader
commit	8537a8bd39324939affc4aaef040957ed503bbbb
tree	50023111d6686fc9876cd3f51c06d7cb770f6c59

schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/115-rhnChannel.sql

Increased size of channel name column
Comment 8 Jay Dobies 2009-05-08 10:57:26 EDT
No, it was just fixed back in January and will be in 5.3.
Comment 9 Milan Zazrivec 2009-05-14 04:40:13 EDT
(In reply to comment #6)
> Master
> commit c80bcc63b7b067b59692bc9332e0416699caab94
> tree ddf5fc4cf05fbd66fb0c208e576c2423adc830ac
> 
> Vader
> commit 8537a8bd39324939affc4aaef040957ed503bbbb
> tree 50023111d6686fc9876cd3f51c06d7cb770f6c59
> 
> schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/115-rhnChannel.sql
> 
> Increased size of channel name column  

You still need to change the definition of rhnChannel table (name column) in
rhnsat/tables/rhnChannel.sql for new installations.
Comment 10 Jay Dobies 2009-05-14 09:17:19 EDT
Thanks Milan, good pickup.

Master
commit	d461f48688232a868f1f193e69bb81a38934750d
tree	e3f69f4b6284bb52fcc67a8764149e7705b26c0a

Vader
commit	ef03621dd678acf034b019240ed9ea09ca7ab2cc
tree	cdd78ccbf8ac82de82c10ff0f5a801337d2a9224
Comment 11 John Matthews 2009-05-26 14:27:30 EDT
FAILS_QA
Tested with: Satellite-5.3.0-RHEL5-re20090520.0-i386-embedded-oracle.iso

Followed reproducer in comment #1, received error:
Invalid channel name 'Clone 2 of Red Hat Network Tools for RHEL Server (v.5 64-bit x86_64)' - must be at least 6 characters long and no longer than 64 characters, begin with a letter, and contain only letters, digits, spaces, '-', ' / ', '_' and '.'


If I shorten the name a little it works.  From comment #4 I'm assuming the intent is to raise the limit to 256 characters?  It seems like 64 is still the limit.

I verified that the change noted in comment #10 is present on the ISO I'm using.

describe rhnchannel;
 NAME					   NOT NULL VARCHAR2(256)
Comment 12 Jay Dobies 2009-05-27 16:30:53 EDT
Ah, ok. The clone channel workflow ends on the network/software/channels/manage/edit.pxt?clone_from=102&clone_type=original page. I'm guessing that page is doing its own validation of the name before hitting the DB that needs to be updated.
Comment 13 Jay Dobies 2009-05-27 16:58:50 EDT
Master
commit	e33a7fb3ca327feb9fd393d47c2e9fbc064b1624
tree	e2886e167da779e919a9bee36c0fab8096dc2ce4

Vader
commit	bd640fc879041579c3075e3015c9a49f7b173c7d
tree	9e692d750e28ea5eda8416a4fe9234342dd9054a

java/code/webapp/WEB-INF/pages/channel/manage/edit.jsp
schema/spacewalk/rhnsat/packages/rhn_channel.pkb
schema/spacewalk/upgrade/spacewalk-schema-0.5-to-spacewalk-schema-0.6/118-rhn_channel.pkb.sql
web/modules/sniglets/Sniglets/ChannelEditor.pm

A few changes related to the channel name limit increase.

- Increased max length of create channel name text field
- Clone channel destination page updated with correct new length
- Stored proc changed; increased size of channel_name variable
- Update script for stored proc created
Comment 14 John Matthews 2009-06-08 11:35:48 EDT
ISO: Satellite-5.3.0-RHEL5-re20090529.0-i386-embedded-oracle.iso
Verified
Comment 16 Brandon Perkins 2009-09-10 16:36:19 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html

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