Bug 970125 - Internal Server Error (db SPACEUSER.RHN_DCM_RELEASE_CAID_OID_UQ) when "New Distribution Channel Mapping" was created
Summary: Internal Server Error (db SPACEUSER.RHN_DCM_RELEASE_CAID_OID_UQ) when "New Di...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: WebUI
Version: 560
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Dobes
QA Contact: Jiří Mikulka
URL:
Whiteboard:
Depends On:
Blocks: sat560-lowbug
TreeView+ depends on / blocked
 
Reported: 2013-06-03 13:45 UTC by Pavel Studeník
Modified: 2014-10-06 13:45 UTC (History)
5 users (show)

Fixed In Version: spacewalk-java-2.0.2-2
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-01 21:53:16 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Pavel Studeník 2013-06-03 13:45:49 UTC
Description of problem:
I tried to create new distribution channel mapping when same channel mapping exists. I filled these fields with identical values - Release, Architecture Channel Label. This channel mapping wasn't created and I got Internal Server Error.

Version-Release number of selected component (if applicable):
spacewalk-java-1.9.83-40.el6sat.noarch

How reproducible:
always (external oracle)

Steps to Reproduce:
1. go to page Channels -> Distribution Channel Mapping -> create new distribution channel mapping
2. create two channels with same values: Release, Architecture Channel Label

Actual results:
Internal Server Error and Channel wasn't created

Expected results:
Without ISE, show error message in WebUI

Additional info:

>> tail /var/log/tomcat6/catalina.out
java.sql.SQLException: ORA-00001: unique constraint (SPACEUSER.RHN_DCM_RELEASE_CAID_OID_UQ) violated

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:676)
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:602)
        at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:571)
        at oracle.jdbc.driver.T2CPreparedStatement.executeForRows(T2CPreparedStatement.java:764)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:79)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2265)
        ... 31 more
2013-06-03 09:30:50,234 [TP-Processor9] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
org.hibernate.exception.ConstraintViolationException: could not insert: [com.redhat.rhn.domain.channel.DistChannelMap]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2285)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2678)
        at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:79)
        at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:278)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:262)
        at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:166)
        at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
        at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
        at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1030)
        at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:367)
        at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
        at com.redhat.rhn.common.hibernate.ConnectionManager.commitTransaction(ConnectionManager.java:253)
        at com.redhat.rhn.common.hibernate.HibernateFactory.commitTransaction(HibernateFactory.java:328)
        at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:56)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.redhat.rhn.frontend.servlets.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:97)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:736)
Caused by: 
java.sql.SQLException: ORA-00001: unique constraint (SPACEUSER.RHN_DCM_RELEASE_CAID_OID_UQ) violated

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:676)
        at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:602)
        at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:571)
        at oracle.jdbc.driver.T2CPreparedStatement.executeForRows(T2CPreparedStatement.java:764)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1190)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3370)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3454)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:79)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2265)
        ... 31 more

Comment 1 Pavel Studeník 2013-06-04 09:28:52 UTC
Satellite with db postgresql:

spacewalk-java-1.9.83-35.el6sat.noarch
spacewalk-java-postgresql-1.9.83-35.el6sat.noarch

>> tail /var/log/catalina.out
...
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "rhn_dcm_release_caid_oid_uq"
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1795)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:479)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:367)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:321)
        at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:79)
        at org.hibernate.jdbc.NonBatchingBatcher.addToBatch(NonBatchingBatcher.java:46)
        at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2265)
        ... 31 more

Comment 2 Jan Dobes 2013-06-11 16:57:51 UTC
fixed in spacewalk master: 0116589c7658c34de44ca019a7c40af3c068b378

Comment 5 Clifford Perry 2013-10-01 21:53:16 UTC
Satellite 5.6 has been released. This bug was tracked under the release.  

This bug was either VERIFIED or RELEASE_PENDING (re-verified prior shortly
before release). 

Moving to CLOSED CURRENT_RELEASE. 

Text from Upgrade Erratum follows:

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.

http://rhn.redhat.com/errata/RHEA-2013-1395.html


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