This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 476730 - need to field check custom errata creation
need to field check custom errata creation
Product: Spacewalk
Classification: Community
Component: WebUI (Show other bugs)
All Linux
urgent Severity urgent
: ---
: ---
Assigned To: Jesus M. Rodriguez
wes hayutin
Depends On:
Blocks: space04
  Show dependency treegraph
Reported: 2008-12-16 14:57 EST by wes hayutin
Modified: 2009-01-22 11:31 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-01-22 11:31:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description wes hayutin 2008-12-16 14:57:53 EST
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 17:32:59 EST
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 17:38:05 EST
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 17:46:12 EST
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 16:04:11 EST
83317b2a0e275a2a06b870c305bee94f7f353cb7 - increases advisory column to 37
35d62eb0f2f7ba0efe2cd376e135db1025f4d8e6 - ensure we validate the content from ui and api.
Comment 5 Jesus M. Rodriguez 2009-01-14 22:19:36 EST
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.