Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-53722

JdbcSQLException Unique index or primary key violation

XMLWordPrintable

      In some edge cases

      ERROR: [withMaven] WARNING Exception executing Maven reporter 'Pipeline Graph Publisher' / org.jenkinsci.plugins.pipeline.maven.publishers.PipelineGraphPublisher. Please report a bug associated for the component 'pipeline-maven-plugin' at https://issues.jenkins-ci.org 
      org.jenkinsci.plugins.pipeline.maven.util.RuntimeSqlException: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "IDX_JENKINS_JOB ON PUBLIC.JENKINS_JOB(JENKINS_MASTER_ID, FULL_NAME) VALUES (1, 'maven-jar-with-flatten-pom/master', 147)"; SQL statement:
      INSERT INTO JENKINS_JOB(FULL_NAME, JENKINS_MASTER_ID) VALUES (?, ?) [23505-196]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
      	at org.h2.message.DbException.get(DbException.java:179)
      	at org.h2.message.DbException.get(DbException.java:155)
      	at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
      	at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231)
      	at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190)
      	at org.h2.mvstore.db.MVTable.addRow(MVTable.java:705)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:156)
      	at org.h2.command.dml.Insert.update(Insert.java:114)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:101)
      	at org.h2.command.Command.executeUpdate(Command.java:260)
      	at org.h2.server.TcpServerThread.process(TcpServerThread.java:354)
      	at org.h2.server.TcpServerThread.run(TcpServerThread.java:158)
      	at java.lang.Thread.run(Thread.java:748)
      
      	at org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginH2Dao.getOrCreateBuildPrimaryKey(PipelineMavenPluginH2Dao.java:424)
      	at org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginH2Dao.recordGeneratedArtifact(PipelineMavenPluginH2Dao.java:198)
      	at org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginMonitoringDao.recordGeneratedArtifact(PipelineMavenPluginMonitoringDao.java:57)
      	at org.jenkinsci.plugins.pipeline.maven.publishers.PipelineGraphPublisher.recordGeneratedArtifacts(PipelineGraphPublisher.java:229)
      	at org.jenkinsci.plugins.pipeline.maven.publishers.PipelineGraphPublisher.process(PipelineGraphPublisher.java:94)
      	at org.jenkinsci.plugins.pipeline.maven.MavenSpyLogProcessor.processMavenSpyLogs(MavenSpyLogProcessor.java:118)
      	at org.jenkinsci.plugins.pipeline.maven.WithMavenStepExecution$WithMavenStepExecutionCallBack.finished(WithMavenStepExecution.java:1050)
      	at org.jenkinsci.plugins.workflow.steps.BodyExecutionCallback$TailCall.onSuccess(BodyExecutionCallback.java:114)
      	at org.jenkinsci.plugins.workflow.cps.CpsBodyExecution$SuccessAdapter.receive(CpsBodyExecution.java:362)
      	at com.cloudbees.groovy.cps.Outcome.resumeFrom(Outcome.java:73)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:166)
      	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:122)
      	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:261)
      	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:35)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:108)
      	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:32)
      	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:174)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:330)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$100(CpsThreadGroup.java:82)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:242)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
      	at java.util.concurrent.FutureTask.run(FutureTask.java)
      	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:112)
      	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
      	at java.util.concurrent.FutureTask.run(FutureTask.java)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "IDX_JENKINS_JOB ON PUBLIC.JENKINS_JOB(JENKINS_MASTER_ID, FULL_NAME) VALUES (1, 'maven-jar-with-flatten-pom/master', 147)"; SQL statement:
      INSERT INTO JENKINS_JOB(FULL_NAME, JENKINS_MASTER_ID) VALUES (?, ?) [23505-196]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
      	at org.h2.message.DbException.get(DbException.java:179)
      	at org.h2.message.DbException.get(DbException.java:155)
      	at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:103)
      	at org.h2.mvstore.db.MVSecondaryIndex.checkUnique(MVSecondaryIndex.java:231)
      	at org.h2.mvstore.db.MVSecondaryIndex.add(MVSecondaryIndex.java:190)
      	at org.h2.mvstore.db.MVTable.addRow(MVTable.java:705)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:156)
      	at org.h2.command.dml.Insert.update(Insert.java:114)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:101)
      	at org.h2.command.Command.executeUpdate(Command.java:260)
      	at org.h2.server.TcpServerThread.process(TcpServerThread.java:354)
      	at org.h2.server.TcpServerThread.run(TcpServerThread.java:158)
      	at java.lang.Thread.run(Thread.java:748)
      
      	at org.h2.engine.SessionRemote.done(SessionRemote.java:629)
      	at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:209)
      	at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement.java:207)
      	at org.jenkinsci.plugins.pipeline.maven.dao.PipelineMavenPluginH2Dao.getOrCreateBuildPrimaryKey(PipelineMavenPluginH2Dao.java:386)
      	... 35 more
      

            Unassigned Unassigned
            cleclerc Cyrille Le Clerc
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: