0 Replies Latest reply on Jan 16, 2014 3:41 AM by dsmrt

    Error on Discussion Save: duplicate key value violates unique constraint

    dsmrt

      We are upgrading from jive 5 to jive 6 and we are now getting the error below when publishing a new discussion.

       

      Screen Shot 2014-01-16 at 4.32.01 AM.png

       

      The postgres db shows the following error:

      ERROR:  duplicate key value violates unique constraint "jvbrwscnt_pk"
      STATEMENT:  INSERT INTO jiveBrowseCnt (browseID, objectType, objectID, authorID, subject, status, containerType, containerID, creationDate, modificationDate, lastActivityDate) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)
      

       

      The jive instance .out log shows the following error on save attempt:

       

      06:23:53,979 [http-127.0.0.1-9001-7] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/discussions].[CXFServlet] - Servlet.service() for servlet CXFServlet threw exception
      java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: PreparedStatementCallback; SQL [INSERT INTO jiveBrowseCnt (browseID, objectType, objectID, authorID, subject, status, containerType, containerID, creationDate, modificationDate, lastActivityDate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"
        at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:102)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:294)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:111)
        at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:428)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:144)
        at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:148)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.struts.JiveFilterDispatcher.doFilter(JiveFilterDispatcher.java:87)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
        at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.ActivityRequestFilter.doFilter(ActivityRequestFilter.java:100)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.directwebremoting.servlet.DwrWebContextFilter.doFilter(DwrWebContextFilter.java:91)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.base.plugin.PluginFilter.doFilter(PluginFilter.java:73)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.robots.RobotDetectorFilter.doFilterInternal(RobotDetectorFilter.java:62)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.aaa.UserResponseHeaderFilter.doFilter(UserResponseHeaderFilter.java:45)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at com.jivesoftware.community.webservices.RestExceptionTranslatorFilter.doFilter(RestExceptionTranslatorFilter.java:40)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at com.jivesoftware.community.aaa.JiveRememberMeAuthenticationFilter.doFilter(JiveRememberMeAuthenticationFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:163)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at com.jivesoftware.community.aaa.stateless.filter.NodeFailoverTestModeFilter.doFilter(NodeFailoverTestModeFilter.java:36)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.base.profiling.http.RequestProfilingFilter.doFilter(RequestProfilingFilter.java:47)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.P3PCompactPolicyFilter.doFilter(P3PCompactPolicyFilter.java:48)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.RemoveJsessionIdFilter.doFilter(RemoveJsessionIdFilter.java:40)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.ApplicationStateFilter.doFilter(ApplicationStateFilter.java:157)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.XFrameOptionsFilter.doFilter(XFrameOptionsFilter.java:50)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.ResourceRoutingFilter.doFilter(ResourceRoutingFilter.java:44)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.base.profiling.http.ServerLatencyFilter.doFilter(ServerLatencyFilter.java:62)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.SetRequestCharacterEncodingFilter.doFilter(SetRequestCharacterEncodingFilter.java:76)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.jivesoftware.community.web.filter.DispatchContextResetFilter.doFilter(DispatchContextResetFilter.java:39)
        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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
        at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:647)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:879)
        at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:600)
        at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1703)
        at java.lang.Thread.run(Thread.java:662)
      Caused by: org.apache.cxf.interceptor.Fault: PreparedStatementCallback; SQL [INSERT INTO jiveBrowseCnt (browseID, objectType, objectID, authorID, subject, status, containerType, containerID, creationDate, modificationDate, lastActivityDate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"
        at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
        ... 118 more
      Caused by: org.springframework.dao.DuplicateKeyException: PreparedStatementCallback; SQL [INSERT INTO jiveBrowseCnt (browseID, objectType, objectID, authorID, subject, status, containerType, containerID, creationDate, modificationDate, lastActivityDate) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"; nested exception is org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"
        at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:241)
        at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:811)
        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:833)
        at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.update(NamedParameterJdbcTemplate.java:259)
        at org.springframework.jdbc.core.simple.SimpleJdbcTemplate.update(SimpleJdbcTemplate.java:243)
        at com.jivesoftware.base.database.dao.JiveJdbcOperationsTemplate.update(JiveJdbcOperationsTemplate.java:192)
        at com.jivesoftware.community.browse.impl.BrowseContentDAOImpl.create(BrowseContentDAOImpl.java:147)
        at com.jivesoftware.community.browse.impl.BrowseManagerImpl.saveDeduped(BrowseManagerImpl.java:329)
        at com.jivesoftware.community.browse.impl.BrowseManagerImpl.save(BrowseManagerImpl.java:312)
        at com.jivesoftware.community.browse.provider.BaseBrowseDataProvider.handle(BaseBrowseDataProvider.java:161)
        at com.jivesoftware.community.browse.provider.BlogPostBrowseDataProvider.handle(BlogPostBrowseDataProvider.java:41)
        at com.jivesoftware.community.browse.provider.BlogPostBrowseDataProvider.handle(BlogPostBrowseDataProvider.java:1)
        at com.jivesoftware.base.event.v2.EventDispatchHelper.dispatchEventToInlineListeners(EventDispatchHelper.java:188)
        at com.jivesoftware.base.event.v2.NonBlockingEventDispatcherImpl.fireToInlineListeners(NonBlockingEventDispatcherImpl.java:117)
        at com.jivesoftware.base.event.v2.NonBlockingEventDispatcherImpl.fire(NonBlockingEventDispatcherImpl.java:109)
        at com.jivesoftware.community.impl.DbBlog.addBlogPost(DbBlog.java:762)
        at com.jivesoftware.community.proxy.BlogProxy.addBlogPost(BlogProxy.java:334)
        at com.jivesoftware.community.content.blogs.rest.impl.CreateBlogPostStrategy.create(CreateBlogPostStrategy.java:58)
        at com.jivesoftware.community.content.blogs.rest.impl.CreateBlogPostStrategy.create(CreateBlogPostStrategy.java:1)
        at com.jivesoftware.community.content.publish.impl.ContentPublisherImpl.handleCreateExceptions(ContentPublisherImpl.java:270)
        at com.jivesoftware.community.content.publish.impl.ContentPublisherImpl.publishInternal(ContentPublisherImpl.java:110)
        at com.jivesoftware.community.content.publish.impl.ContentPublisherImpl.publish(ContentPublisherImpl.java:92)
        at com.jivesoftware.community.content.rest.ContentServiceHelper.publishAndRedirect(ContentServiceHelper.java:98)
        at com.jivesoftware.community.content.blogs.rest.impl.BlogPostServiceImpl.create(BlogPostServiceImpl.java:68)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
        ... 127 more
      Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "jvbrwscnt_pk"
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2157)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1886)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:555)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363)
        at sun.reflect.GeneratedMethodAccessor822.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
        at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
        at org.postgresql.PGStatement$$EnhancerByProxool$$aaa7ad63.executeUpdate(<generated>)
        at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:817)
        at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:1)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:586)
        ... 156 more
      

       

       

      Any ideas?