Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1445868

Summary: ISE 500 when user tries to create duplicated records on page "ISS Configuration"
Product: Red Hat Satellite 5 Reporter: Pavel Studeník <pstudeni>
Component: WebUIAssignee: Grant Gainey <ggainey>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Studeník <pstudeni>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 580CC: galtukho, ggainey, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-2.5.14-82-sat Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-21 12:13:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1358815    

Description Pavel Studeník 2017-04-26 16:34:37 UTC
Description of problem:
I receive ISE 500 when I try to create duplicated records on this pages:

   * Master Setup - /rhn/admin/iss/Slave.do
   * Slave Setup - /rhn/admin/iss/Master.do

I suppose that correct behavior is that the error message is shown on page of webUI.

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

How reproducible:
always

Steps to Reproduce:
1. go to page "ISS Configuration - Master Setup" or "... Slave Setup"
2. try to create duplicated records
3. receive ISE 500

Actual results:
2017-04-26 19:27:46,871 [TP-Processor14] ERROR com.redhat.rhn.frontend.servlets.SessionFilter - Error during transaction. Rolling back
org.hibernate.exception.ConstraintViolationException: could not update: [com.redhat.rhn.domain.iss.IssSlave#4]
	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94)
	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2443)
	at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)
	at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)
	at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
	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:167)
	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:233)
	at com.redhat.rhn.common.hibernate.HibernateFactory.commitTransaction(HibernateFactory.java:331)
	at com.redhat.rhn.frontend.servlets.SessionFilter.doFilter(SessionFilter.java:58)
	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:299)
	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:785)
Caused by: 
org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "rhn_isss_name_uq"
  Detail: Key (slave)=(elisha.brq.redhat.com) already exists.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2094)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1827)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:508)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:384)
	at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:330)
	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.update(AbstractEntityPersister.java:2421)
	... 32 more

Expected results:
Without traceback (ISE 500) and show error message

Comment 2 Grant Gainey 2017-05-09 18:34:07 UTC
spacewalk.github:
e7d38ae118ec9b350b244e314001df6570a8178f

Comment 5 Pavel Studeník 2017-05-12 14:19:14 UTC
Verified with spacewalk-java-2.5.14-84.el6sat.noarch