User task is not executable

Hello,

We use our own application rather than the Bonita portal, and we got this error below generated in the log files when a Human task was submitted for the first time:

org.bonitasoft.engine.bpm.flownode.UserTaskNotFoundException: USERNAME=uqkande2 | User task is not executable (currently in state 'executing initializing'), this might be because someone else already executed it. at org.bonitasoft.engine.api.impl.ProcessAPIImpl.verifyIfTheActivityWasInTheCorrectStateAndThrowException(ProcessAPIImpl.java:5666) at org.bonitasoft.engine.api.impl.ProcessAPIImpl.executeUserTask(ProcessAPIImpl.java:5650) at org.bonitasoft.engine.api.impl.ProcessAPIImpl.executeUserTask(ProcessAPIImpl.java:5633) at sun.reflect.GeneratedMethodAccessor20915.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:462) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPIOutsideTransaction(ServerAPIImpl.java:279) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeAPI(ServerAPIImpl.java:270) at org.bonitasoft.engine.api.impl.ServerAPIImpl.invokeMethod(ServerAPIImpl.java:124) at org.bonitasoft.engine.api.impl.ClientInterceptor.invoke(ClientInterceptor.java:86) at com.sun.proxy.$Proxy104.executeUserTask(Unknown Source) at org.bonitasoft.web.rest.server.api.bpm.flownode.UserTaskExecutionResource.executeTask(UserTaskExecutionResource.java:63) at sun.reflect.GeneratedMethodAccessor1893.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:508) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:561) at org.restlet.resource.ServerResource.post(ServerResource.java:1314) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:441) at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:666) at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:348) at org.restlet.resource.ServerResource.handle(ServerResource.java:1020) at org.restlet.resource.Finder.handle(Finder.java:236) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:641) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:140) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:77) at org.restlet.Application.handle(Application.java:385) at org.bonitasoft.web.rest.server.BonitaRestletApplication.handle(BonitaRestletApplication.java:185) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:641) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.routing.Router.doHandle(Router.java:422) at org.restlet.routing.Router.handle(Router.java:641) at org.restlet.routing.Filter.doHandle(Filter.java:150) at org.restlet.routing.Filter.handle(Filter.java:197) at org.restlet.engine.CompositeHelper.handle(CompositeHelper.java:202) at org.restlet.Component.handle(Component.java:408) at org.restlet.Server.handle(Server.java:507) at org.restlet.engine.connector.ServerHelper.handle(ServerHelper.java:63) at org.restlet.engine.adapter.HttpServerHelper.handle(HttpServerHelper.java:143) at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1117) at 
...
org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at 
...

What does it mean?

Regards,

Jerome

Hello,

I am answering to my own question.

The error message got generated because the Human task was submitted when its state was not yet equal to 'ready': the state was still 'initializing'.

After a restart, everything get back to normal.

So I guess that the questions are:

  1. Why was it listed in the custom application?
  2. Why does it took so long to reach the 'ready' state?

 

Answer 1

The Human tasks can be submitted when their state is 'ready' and state_executing is false. Only such Human tasks should be displayed to the final users.

Answer 2

The Bonita engine is splitting the execution of a case (process instance) in works, stored in the memory. At startup, the entire flownode_instance table gets read and all the works get generated: I.E. the execution of the process instances is resumed.

When a work got lost, then the execution of the involved process instance is paused. A work can be lost when the Bonita engine encounters an unrecoverable error. Note that the very last version of the product contains many enhancement regarding this situtation (version 2021.1 at time of writing).

The connectors 'IN' (ON_ENTER) associated to a task are executed when the task's state is 'initializing': should such a connector takes time to execute, then the task stays longer with this 'initializing' state.

Another situation would be a system with too much load: everything is slowed down. How was the CPU consumption? I/O? etc.

Note that with this this later situation, with java, a shortage of memory could make the Garbage Collector thread(s) consumes all the CPU, leaving nothing to the application threads.

 

Regards,

Jerome