Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-11225

FetchAndLock failing with execution is null

    XMLWordPrintable

Details

    Description

      We are having Camunda spring boot standalone application running on multiple nodes through a load balancer having a postgres database.

      Multi-Node External task client is fetching the external task in bulk and marking it complete within the lock duration. But I can see some failure in camunda engine

      2019-12-24 11:06:50.098 ERROR 1 — [nio-8080-exec-3] org.camunda.bpm.engine.context : ENGINE-16004 Exception while closing command context: Cannot find execution with id 504b3d6b-263d-11ea-b009-aedc91f750c8 for external task 504b3d6d-263d-11ea-b009-aedc91f750c8: execution is null

      org.camunda.bpm.engine.exception.NullValueException: Cannot find execution with id 504b3d6b-263d-11ea-b009-aedc91f750c8 for external task 504b3d6d-263d-11ea-b009-aedc91f750c8: execution is null

       

      That's why external task client is also failing for fetch And Lock Task

      2019-12-24 11:06:50.194 ERROR create-task-plumbing-deployment-f57fdf5b4-9sz82 – [TopicSubscriptionManager] ERROR o.c.b.client                             - TASK/CLIENT-03001 Exception while fetch and lock task.2019-12-24 11:06:50.194 ERROR create-task-plumbing-deployment-f57fdf5b4-9sz82 – [TopicSubscriptionManager] ERROR o.c.b.client                             - TASK/CLIENT-03001 Exception while fetch and lock task.org.camunda.bpm.client.impl.EngineClientException: TASK/CLIENT-02001 Request 'POST http://camunda.camunda-staging.svc:8080/rest/external-task/fetchAndLock HTTP/1.1' returned error: status code '500' - message: status code: 500, reason phrase: {"type":"NullValueException","message":"Cannot find execution with id 504b3d6b-263d-11ea-b009-aedc91f750c8 for external task 504b3d6d-263d-11ea-b009-aedc91f750c8: execution is null"} at org.camunda.bpm.client.impl.EngineClientLogger.exceptionWhileReceivingResponse(EngineClientLogger.java:30) ~[camunda-external-task-client-1.3.0.jar!/:1.3.0] at org.camunda.bpm.client.impl.RequestExecutor.executeRequest(RequestExecutor.java:97) ~[camunda-external-task-client-1.3.0.jar!/:1.3.0] at org.camunda.bpm.client.impl.RequestExecutor.postRequest(RequestExecutor.java:74) ~[camunda-external-task-client-1.3.0.jar!/:1.3.0] at org.camunda.bpm.client.impl.EngineClient.fetchAndLock(EngineClient.java:78) 

       

      I dig down the issue and checked it is firing 2 queries on the db.

      1st query returns the result and 2nd query fail at the same time with the above exception.

       

      select distinct RES.select distinct RES.    from (    select RES.*, PI.BUSINESS_KEY_, PD.VERSION_TAG_    from ACT_RU_EXT_TASK RES    left join ACT_RU_EXECUTION PI on RES.PROC_INST_ID_ = PI.ID_    inner join ACT_RE_PROCDEF PD on RES.PROC_DEF_ID_ = PD.ID_     WHERE (RES.LOCK_EXP_TIME_ is null or RES.LOCK_EXP_TIME_ <= '2019-12-24 12:50:27.194+05:30')      and (RES.SUSPENSION_STATE_ is null or RES.SUSPENSION_STATE_ = 1)      and (RES.RETRIES_ is null or RES.RETRIES_ > 0)        and        (          RES.TOPIC_NAME_ like 'createRelatedLead'        )     ) RES    LIMIT 5 OFFSET 0

       

      select * from ACT_RU_EXECUTION where ID_ = ?

       

      I have attached all the logs related to the issue.

      mgm-controller-panel

        This is the controller panel for Smart Panels app

        Attachments

          Issue Links

            Activity

              People

                nikola.koevski Nikola Koevski
                akkujain93 Akanksha Jain
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Salesforce