Uploaded image for project: 'Airavata'
  1. Airavata
  2. AIRAVATA-2245

Error saving compute resource preference: Duplicate entry for primary key

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Registry API
    • None
    • dev.seagrid.org

    Description

      I'm getting an error when I try to add or save changes to a compute resource preference in dev.seagrid.org.

      Here's the stack trace in the registry server:

      2016-11-30 15:16:26 [pool-1-thread-1881] ERROR o.a.a.r.a.s.h.RegistryServerHandler - marcus
      org.apache.airavata.registry.cpi.AppCatalogException: org.apache.airavata.registry.cpi.AppCatalogExce
      ption: <openjpa-2.2.0-r422266:1244990 fatal store error> org.apache.openjpa.persistence.RollbackExcep
      tion: The transaction has been rolled back.  See the nested exceptions for details on the errors that
       occurred.
      FailedObject: org.apache.airavata.registry.core.app.catalog.model.UserResourceProfile@5352abad
              at org.apache.airavata.registry.core.app.catalog.impl.UsrResourceProfileImpl.updateUserResour
      ceProfile(UsrResourceProfileImpl.java:166)
              at org.apache.airavata.registry.api.service.handler.RegistryServerHandler.updateUserComputeRe
      sourcePreference(RegistryServerHandler.java:4024)
              at org.apache.airavata.registry.api.RegistryService$Processor$updateUserComputeResourcePrefer
      ence.getResult(RegistryService.java:14933)
              at org.apache.airavata.registry.api.RegistryService$Processor$updateUserComputeResourcePrefer
      ence.getResult(RegistryService.java:14917)
              at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
              at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
              at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: org.apache.airavata.registry.cpi.AppCatalogException: <openjpa-2.2.0-r422266:1244990 fatal
       store error> org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.
        See the nested exceptions for details on the errors that occurred.
      FailedObject: org.apache.airavata.registry.core.app.catalog.model.UserResourceProfile@5352abad
              at org.apache.airavata.registry.core.app.catalog.resources.UserResourceProfileResource.save(U
      serResourceProfileResource.java:406)
              at org.apache.airavata.registry.core.app.catalog.impl.UsrResourceProfileImpl.updateUserResour
      ceProfile(UsrResourceProfileImpl.java:121)
              ... 9 common frames omitted
      Caused by: org.apache.openjpa.persistence.RollbackException: The transaction has been rolled back.  S
      ee the nested exceptions for details on the errors that occurred.
              at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:594)
              at org.apache.airavata.registry.core.app.catalog.resources.UserResourceProfileResource.save(U
      serResourceProfileResource.java:397)
              ... 10 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: The transaction has been rolled back
      .  See the nested exceptions for details on the errors that occurred.
              at org.apache.openjpa.kernel.BrokerImpl.newFlushException(BrokerImpl.java:2337)
              at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2174)
              at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2072)
              at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1990)
              at org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:81)
              at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1514)
              at org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:933)
              at org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:570)
              ... 11 common frames omitted
      Caused by: org.apache.openjpa.persistence.EntityExistsException: Duplicate entry 'marcus' for key 'PRIMARY' {prepstmnt 49686280 
      INSERT INTO USER_RESOURCE_PROFILE (USER_ID, CREATION_TIME, CS_TOKEN, 
              GATEWAY_ID, IDENTITY_SERVER_PWD_CRED_TOKEN, 
              IDENTITY_SERVER_TENANT, UPDATE_TIME) 
          VALUES (?, ?, ?, ?, ?, ?, ?) 
      [params=(String) marcus, (Timestamp) 2016-11-30 15:16:26.721, (String) 691eac15-cd91-4c50-9599-cf6e194a06b1, (String) seagrid, (null) null, (null) null, (null) null]} [code=1062, state=23000]
              at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4903)
              at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4878)
              at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:136)
              at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:78)
              at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:143)
              at org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl.flushAndUpdate(BatchingPreparedStatementManagerImpl.java:79)
              at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:99)
              at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:87)
              at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:550)
              at org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager.flush(ConstraintUpdateManager.java:106)
              at org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager.flush(BatchingConstraintUpdateManager.java:59)
              at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:103)
              at org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:76)
              at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:713)
              at org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:131)
              ... 18 common frames omitted
      Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: Duplicate entry 'marcus' for key 'PRIMARY' {prepstmnt 49686280 
      INSERT INTO USER_RESOURCE_PROFILE (USER_ID, CREATION_TIME, CS_TOKEN, 
              GATEWAY_ID, IDENTITY_SERVER_PWD_CRED_TOKEN, 
              IDENTITY_SERVER_TENANT, UPDATE_TIME) 
          VALUES (?, ?, ?, ?, ?, ?, ?) 
      [params=(String) marcus, (Timestamp) 2016-11-30 15:16:26.721, (String) 691eac15-cd91-4c50-9599-cf6e194a06b1, (String) seagrid, (null) null, (null) null, (null) null]} [code=1062, state=23000]
              at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247)
              at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:223)
              at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.access$1000(LoggingConnectionDecorator.java:72)
              at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeUpdate(LoggingConnectionDecorator.java:1162)
              at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:272)
              at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeUpdate(JDBCStoreManager.java:1741)
              at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.executeUpdate(PreparedStatementManagerImpl.java:267)
              at org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushAndUpdate(PreparedStatementManagerImpl.java:118)
              ... 28 common frames omitted
      

      Attachments

        Issue Links

          Activity

            People

              anujbhan Anuj Bhandar
              marcuschristie Marcus Christie
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: