I need to start using user tasks in Camunda and encountered some issue with reassigning/reclaiming tasks. The process is simple as this:
I have two users who are administrators so they should have all the rights. When I create a process instance, each of the users is able to claim the task. But when the task is claimed and unclaimed by one user, the other user cannot claim it because of this exception:
ENGINE-03004 Exception while executing Database Operation 'INSERT AuthorizationEntity[769d38b0-980e-11e9-a093-144f8adf0ac5]' with message ' ### Error updating database. Cause: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "ACT_UNIQ_AUTH_GROUP_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, GROUP_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, NULL, 7, 'a8daf824-980d-11e9-a093-144f8adf0ac5', 51)"; SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-197] ### The error may involve org.camunda.bpm.engine.impl.persistence.entity.AuthorizationEntity.insertAuthorization-Inline ### The error occurred while setting parameters ###
SQL: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) ### Cause: org.h2.jdbc.JdbcSQLException:
Unique index or primary key violation: "ACT_UNIQ_AUTH_GROUP_INDEX_6 ON PUBLIC.ACT_RU_AUTHORIZATION(TYPE_, GROUP_ID_, RESOURCE_TYPE_, RESOURCE_ID_) VALUES (1, NULL, 7, 'a8daf824-980d-11e9-a093-144f8adf0ac5', 51)";
SQL statement: insert into ACT_RU_AUTHORIZATION ( ID_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_, REV_ ) values ( ?, ?, ?, ?, ?, ?, ?, 1 ) [23505-197]'.
Flush summary: [ INSERT AuthorizationEntity[769d38b0-980e-11e9-a093-144f8adf0ac5] INSERT HistoricIdentityLinkLogEventEntity[769d38b1-980e-11e9-a093-144f8adf0ac5] UPDATE TaskEntity[a8daf824-980d-11e9-a093-144f8adf0ac5] UPDATE HistoricActivityInstanceEventEntity[Task_07vabcb:a8daf823-980d-11e9-a093-144f8adf0ac5] UPDATE HistoricTaskInstanceEventEntity[a8daf824-980d-11e9-a093-144f8adf0ac5] ]
I’ve also tried assign/unassign, but with the same result.
I don’t think this is the same issue as problem reported here: https://app.camunda.com/jira/browse/CAM-9118 because I’m using proper unclaim/unassign calls instead of claiming/assigning to empty user.
This doesn’t look like a permission issue, but as a bug somewhere in the persistence(maybe just in the history part?)
I’m using LDAP authorization plugin, but I guess that shouldn’t be relevant as the task assignments doesn’t perform any checks according to the documentation.
I’m using camunda-bpm-spring-boot-starter-webapp version 3.2.0(based on camunda 7.10)
Update: Tried with latest camunda 7.11 and the issue persists
Update2: It also happens when I set history level to none.
Update3: After checking what’s happening in the database, it seems the issue is that the entry in ACT_RU_AUTHORIZATION is not cleared when doing unclaim/unassign.