The technical user is not a usable user

Hi,

I am running a workflow but it fails at the first system tak with the error "The technical user is not a usable user".

We are running Version  7.9.0

I do not see how to set up the user (install user, I guess) in the component using groovy script?

Error:

2021-11-24 05:25:57.262 -0500 FINEST: org.bonitasoft.engine.transaction.JTATransactionServiceImpl THREAD_ID=88 | HOSTNAME=MYHOST | Beginning transaction in thread 88 null
2021-11-24 05:25:57.264 -0500 FINE: org.bonitasoft.engine.core.process.instance.impl.ActivityInstanceServiceImpl THREAD_ID=88 | HOSTNAME=MYHOST | TENANT_ID=1 | [SAutomaticTaskInstance with id 20,004] changed state 37->3(new=FailedActivityStateImpl)
2021-11-24 05:25:57.264 -0500 FINEST: org.bonitasoft.engine.transaction.JTATransactionServiceImpl THREAD_ID=88 | HOSTNAME=MYHOST | Completing transaction in thread 88 TransactionImple < ac, BasicAction: 0:ffff0a8ad765:f427:619e0ab5:c77 status: ActionStatus.RUNNING >
2021-11-24 05:25:57.267 -0500 SEVERE: org.bonitasoft.engine.execution.work.InSessionBonitaWork THREAD_ID=88 | HOSTNAME=MYHOST | TENANT_ID=1 | org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException : "PROCESS_DEFINITION_ID=8993798513026978672 | PROCESS_NAME=MYPROCESS | PROCESS_VERSION=2.4 | PROCESS_INSTANCE_ID=1002 | ROOT_PROCESS_INSTANCE_ID=1002 | FLOW_NODE_DEFINITION_ID=7297855687272929214 | FLOW_NODE_INSTANCE_ID=20004 | FLOW_NODE_NAME=Check instanceid | org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.bonitasoft.engine.identity.UserNotFoundException with message = The technical user is not a usable user
Expression : SExpressionImpl [name=updateUsername_be5078ee-b47e-414c-a122-17640521bef9, content=import org.bonitasoft.engine.identity.User;User user = BonitaUsers.getUser(apiAccessor,taskAssigneeId);return user.getUserName();, returnType=java.lang.String, dependencies=[SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=[], expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=[], expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]"
org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: PROCESS_DEFINITION_ID=8993798513026978672 | PROCESS_NAME=MYPROCESS | PROCESS_VERSION=2.4 | PROCESS_INSTANCE_ID=1002 | ROOT_PROCESS_INSTANCE_ID=1002 | FLOW_NODE_DEFINITION_ID=7297855687272929214 | FLOW_NODE_INSTANCE_ID=20004 | FLOW_NODE_NAME=Check instanceid | org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: Groovy script throws an exception of type class org.bonitasoft.engine.identity.UserNotFoundException with message = The technical user is not a usable user
Expression : SExpressionImpl [name=updateUsername_be5078ee-b47e-414c-a122-17640521bef9, content=import org.bonitasoft.engine.identity.User;User user = BonitaUsers.getUser(apiAccessor,taskAssigneeId);return user.getUserName();, returnType=java.lang.String, dependencies=[SExpressionImpl [name=apiAccessor, content=apiAccessor, returnType=org.bonitasoft.engine.api.APIAccessor, dependencies=[], expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]], SExpressionImpl [name=taskAssigneeId, content=taskAssigneeId, returnType=java.lang.Long, dependencies=[], expressionKind=ExpressionKind [interpreter=NONE, type=TYPE_ENGINE_CONSTANT]]], expressionKind=ExpressionKind [interpreter=GROOVY, type=TYPE_READ_ONLY_SCRIPT]]
    at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:583)

 

Thank you

Hi,

What user are you trying to retrieve in your System task ? System task are not assigned to any users and there is a fair chance that taskAssigneeId has a default value of -1 and thus the error message.

In the latest versions of Bonita, the taskAssigneeId isn’t available at all in system task.

HTH
Romain

Hi Romain,
we are in a Service task. 
We are trying to update a variable by taking value of a xml file.

In previous version (7.2) we were using :
mdm_context.setBypassSecurity(true);

Seems with 7.9, it does not work.

Regards

Hi Romain,
So I cannot assign task to an user due to the system task.
Please, it is there a way to get ride of the error?

Regards

The stack in your question is caused by BonitaUsers.getUser(apiAccessor,taskAssigneeId);