Uploaded image for project: 'OpenOLAT'
  1. OpenOLAT
  2. OO-2721

REST API Error if client try to create an authentication token which violate the provider / username constraints

    XMLWordPrintable

    Details

      Description

      2017-04-26 00:11:31,798 [ajp-nio2-8034-exec-11] ERROR RestApiLoginFilter  - OLAT::ERROR ^%^ N34-E8530 ^%^ org.olat.restapi.security
      Apache-HttpClient/4.1.1 (java 1.5)
      >>>stack of 1.cause::org.olat.core.logging.DBRuntimeException: commit failed, rollback transaction
      -> at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:755)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthenticationIntern(BaseSecurityManager.java:1357)
         at org.olat.basesecurity.BaseSecurityManager.access$000(BaseSecurityManager.java:88)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1330)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1325)
         at org.olat.commons.coordinate.cluster.ClusterSyncer.doInSync(ClusterSyncer.java:95)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthentication(BaseSecurityManager.java:1325)
         at org.olat.user.restapi.UserAuthenticationWebService.create(UserAuthenticationWebService.java:151)
         at sun.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:498)
      >>>stack of 2.cause::javax.persistence.RollbackException: Error while committing the transaction
      -> at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:75)
         at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)
         at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:712)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthenticationIntern(BaseSecurityManager.java:1357)
         at org.olat.basesecurity.BaseSecurityManager.access$000(BaseSecurityManager.java:88)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1330)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1325)
         at org.olat.commons.coordinate.cluster.ClusterSyncer.doInSync(ClusterSyncer.java:95)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthentication(BaseSecurityManager.java:1325)
         at org.olat.user.restapi.UserAuthenticationWebService.create(UserAuthenticationWebService.java:151)
         at sun.reflect.GeneratedMethodAccessor421.invoke(Unknown Source)
      >>>stack of 3.cause::javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
      -> at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:147)
         at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
         at org.hibernate.internal.ExceptionConverterImpl.convertCommitException(ExceptionConverterImpl.java:56)
         at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:71)
         at org.olat.core.commons.persistence.DBImpl.commit(DBImpl.java:712)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthenticationIntern(BaseSecurityManager.java:1357)
         at org.olat.basesecurity.BaseSecurityManager.access$000(BaseSecurityManager.java:88)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1330)
         at org.olat.basesecurity.BaseSecurityManager$1.execute(BaseSecurityManager.java:1325)
         at org.olat.commons.coordinate.cluster.ClusterSyncer.doInSync(ClusterSyncer.java:95)
         at org.olat.basesecurity.BaseSecurityManager.createAndPersistAuthentication(BaseSecurityManager.java:1325)
      >>>stack of 4.cause::org.hibernate.exception.ConstraintViolationException: could not execute statement
      -> at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
         at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
         at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
         at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
         at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207)
         at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
         at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3001)
         at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3501)
         at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)
         at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:586)
         at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:460)
      >>>stack of 5.cause::org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "o_bs_authentication_provider_authusername_key" Detail: Key (provider, authusername)=(ADFS, 2160) already exists.
      -> at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2182)
         at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1911)
         at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:173)
         at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:622)
         at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:472)
         at org.postgresql.jdbc.PgStatement.executeUpdate(PgStatement.java:429)
         at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
         at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:97)
         at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)
         at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
         at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3001)
      

        Attachments

          Activity

            People

            Assignee:
            srosse Stéphane Rossé
            Reporter:
            srosse Stéphane Rossé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 5 minutes
                1h 5m