-
Type:
Bug Report
-
Resolution: Fixed
-
Priority:
L3 - Default
-
Affects Version/s: 7.8.0, 7.9.0
-
Component/s: engine
-
None
Steps to reproduce:
- Create two new tenants - "tenant1" & "tenant2"
- Create a new user - "wert"
- Add user to a tenant "tenant1"
- Select the created user
- Select the account
- Delete the user
- Add a new user (with the same data) - "wert"
- Add this user to the same tenant "tenant1"
Current behavior:
An exceptions is thrown:
10:24:19,585 ERROR [org.camunda.bpm.engine.context] (default task-2) ENGINE-16004 Exception while closing command context: 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, 'wert', 11, 'tenant2', 67)"; 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, 'wert', 11, 'tenant2', 67)"; SQL statement:
insert into ACT_RU_AUTHORIZATION (
ID_,
TYPE_,
GROUP_ID_,
USER_ID_,
RESOURCE_TYPE_,
RESOURCE_ID_,
PERMS_,
REV_
)
values (
?,
?,
?,
?,
?,
?,
?,
1
) [23505-190]
Go to Admin -> Authorizations -> Tenant:
the tenant authorization for "wert" with resource ID "tenant1" is still there.
Expected behavior:
When deleting a user the tenant authorization is deleted.
(And after re-creation of the user, it is possible to add the same tenant.)
Hint:
Please check DbIdentityServiceProvider#deleteUser().