Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 476730 - need to field check custom errata creation
Summary: need to field check custom errata creation
Alias: None
Product: Spacewalk
Classification: Community
Component: WebUI
Version: 0.4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jesus M. Rodriguez
QA Contact: wes hayutin
Depends On:
Blocks: space04
TreeView+ depends on / blocked
Reported: 2008-12-16 19:57 UTC by wes hayutin
Modified: 2009-01-22 16:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2009-01-22 16:31:16 UTC

Attachments (Terms of Use)

Description wes hayutin 2008-12-16 19:57:53 UTC
Description of problem:

I'm entering in a name that is too long and I'm getting an ISE

1. go to errata, manage errata, create custom errata
2. enter names and entries longer than 32 characters..

2008-12-16 14:40:01,548 [TP-Processor1] ERROR org.hibernate.event.def.AbstractFlushingEventListener - Could not synchronize database state with 
org.hibernate.exception.GenericJDBCException: could not insert: [com.redhat.rhn.domain.errata.impl.UnpublishedErrata]
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(
        at org.hibernate.exception.SQLStateConverter.convert(
        at org.hibernate.exception.JDBCExceptionHelper.convert(
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(
        at org.hibernate.action.EntityInsertAction.execute(
        at org.hibernate.engine.ActionQueue.execute(
        at org.hibernate.engine.ActionQueue.executeActions(
        at org.hibernate.engine.ActionQueue.executeActions(
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
        at org.hibernate.impl.SessionImpl.flush(
        at org.hibernate.impl.SessionImpl.managedFlush(
        at org.hibernate.transaction.JDBCTransaction.commit(
        at com.redhat.rhn.common.hibernate.ConnectionManager.commitTransaction(
        at com.redhat.rhn.common.hibernate.HibernateFactory.commitTransaction(
        at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
        at org.apache.catalina.core.StandardWrapperValve.invoke(
        at org.apache.catalina.core.StandardContextValve.invoke(
        at org.apache.catalina.core.StandardHostValve.invoke(
        at org.apache.catalina.valves.ErrorReportValve.invoke(
        at org.apache.catalina.core.StandardEngineValve.invoke(
        at org.apache.catalina.connector.CoyoteAdapter.service(
        at org.apache.jk.server.JkCoyoteHandler.invoke(
        at org.apache.jk.common.HandlerRequest.invoke(
        at org.apache.jk.common.ChannelSocket.invoke(
        at org.apache.jk.common.ChannelSocket.processConnection(
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(
        at org.apache.tomcat.util.threads.ThreadPool$
Caused by: java.sql.SQLException: ORA-12899: value too large for column "SPACEWALK"."RHNERRATATMP"."ADVISORY" (actual: 34, maximum: 32)

        at oracle.jdbc.driver.DatabaseError.throwSqlException(
        at oracle.jdbc.driver.T4CTTIoer.processError(
        at oracle.jdbc.driver.T4CTTIoer.processError(
        at oracle.jdbc.driver.T4C8Oall.receive(
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(
        ... 31 more


Comment 1 Jesus M. Rodriguez 2009-01-09 22:32:59 UTC
rhnErrata(Tmp) tables have the following definition:

 Name					   Null?    Type
 ----------------------------------------- -------- ----------------------------

ADVISORY is actually the concatenation of ADVISORY_NAME and ADVISORY_REL seperated by a hyphen(-). For example, if ADVISORY_NAME were 'HELLO MY DARLING'
and ADVISORY_REL were 9999, ADVISORY would be assigned the value:

This 32 character limit is only a problem for customer errata where the 
user is able to enter anything for ADVISORY_NAME. Official and cloned errata
have a defined structure which is less than 32 characters for the ADVISORY.
That is ADVISORY_NAME is of the format RHXX-YYYY:ZZZZZ and the ADVISORY_REL
is limited to 9999. Therefore, the maximum ADVISORY length would be 20.

Comment 2 Jesus M. Rodriguez 2009-01-09 22:38:05 UTC
one approach is to increase the ADVISORY column to be 37 which is 32 + 1 (hyphen) + 4 (digits of ADVISORY_REL). Not ideal, IMO.

Another approach is to shorten the ADVISORY_NAME column to be 27 that is account
for the maximum 5 extra spaces needed for ADVISORY_REL with a value of 9999.
Again not ideal.

I'd like to enforce this in the UI layer, if the user enters a maximum value
of 32 characters for the ADVISORY_NAME and 4 digits for ADVISORY_REL, a message
is posted to the user explaining that the total number of characters for
ADVISORY_NAME and ADVISORY_REL can not exceed 32 characters. This gives them
the chance to edit their values accordingly.

Comment 3 Clifford Perry 2009-01-11 22:46:12 UTC
Thinking of regressions for upgrades. Decrease in Advisory is not ideal, same could be same for Advisory_name, though in theory a customer could never have entered anything above 30 - <name-up-to-30>-X. Humm - we also have to consider that Satellite would consume any code change. RHN Hosted is the source for Errata for Satellite - we have to ensure any changes we make to schema will always be compatible with Red Hat Errata in future that we sync. So - maybe:

Advisory_name - 32
Advisory_rel - number - app and api code enforce 4 to be entered. 
Advisory - 37 (increase)

We also do enforce for creation of custom errata. 

There is also a chance that in the future we want 5 digit Errata numbers, we once only did 3 digit only. 


Comment 4 Jesus M. Rodriguez 2009-01-12 21:04:11 UTC
83317b2a0e275a2a06b870c305bee94f7f353cb7 - increases advisory column to 37
35d62eb0f2f7ba0efe2cd376e135db1025f4d8e6 - ensure we validate the content from ui and api.

Comment 5 Jesus M. Rodriguez 2009-01-15 03:19:36 UTC
Entered the following values:

advisory (name): abcd:efgh:ijkl:mnop:qrst:uvwx:yz
advisory release: 9999

Resulted in Advisory of abcd:efgh:ijkl:mnop:qrst:uvwx:yz-9999
Which is greater than the 32 columns from the bug.

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