Create user, add to tenant. Delete user. Recreate user (same data) and the following error occurs:
This occurs both when creating the user in the REST API and through the web interface.
Camunda 7.8.0.
Failed :
Creating tenant memberships failed: ENGINE-03083 Exception while executing Batch Database Operations with message ' ### Error flushing statements. Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #1) failed. Cause: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "ACT_UNIQ_AUTH_USER_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, 'patrick', 11, 'BancoBig', 64)"; SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-190] ### Cause: org.apache.ibatis.executor.BatchExecutorException: org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization (batch index #1) failed. Cause: org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "ACT_UNIQ_AUTH_USER_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, 'patrick', 11, 'BancoBig', 64)"; SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-190] org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "ACT_UNIQ_AUTH_USER_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, 'patrick', 11, 'BancoBig', 64)"; SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-190] org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "ACT_UNIQ_AUTH_USER_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, 'patrick', 11, 'BancoBig', 64)"; SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-190] '. Flush summary: [ INSERT AuthorizationEntity[bba4790e-4c46-11e8-aa54-ea0072df18d8] INSERT TenantMembershipEntity[bba451fd-4c46-11e8-aa54-ea0072df18d8] ]