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

Server error on filtering by user groups

    • Icon: Bug Report Bug Report
    • Resolution: Unresolved
    • Icon: L3 - Default L3 - Default
    • None
    • 7.16.0, 7.17.0, 7.15.0
    • engine
    • None

      Environment (Required on creation):

      • Camunda Platform CE 7.15.0 ( spring boot )
      • linux / windows / docker, does not matter

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

      When creating a global filter which filter for by criteria ( canditate groups / ${currentUserGroups()} )
      and the filter is permitted for everyone, a user who has logged in just having permission to tasklist but not assigned to any group, get a 500 error on accessing this filter

      Steps to reproduce (Required on creation):

      • Create a user with tasklist permission
      • Create a filter with criteria ( Candidate Groups / ${currentUserGroups()} )
      • Assign the filter to all users
      • Login with new user and open the filter

      Observed Behavior (Required on creation):

      ERROR: response code 500 responded and shown in Tasklist.

      The following error is shown in the logs:

      org.camunda.bpm.engine.ProcessEngineException: Unable to invoke method 'taskCandidateGroupIn' on class 'org.camunda.bpm.engine.impl.TaskQueryImpl'
          at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressions(AbstractQuery.java:292) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressionsAndExecuteList(AbstractQuery.java:218) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.AbstractQuery.executeResult(AbstractQuery.java:168) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.AbstractQuery.listPage(AbstractQuery.java:150) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.cmd.ExecuteFilterListPageCmd.execute(ExecuteFilterListPageCmd.java:51) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.cmd.ExecuteFilterListPageCmd.execute(ExecuteFilterListPageCmd.java:29) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:28) ~[camunda-engine-7.15.0.jar:7.15.0]
      ...
      
      Caused by: java.lang.reflect.InvocationTargetException: null
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
          at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
          at org.camunda.bpm.engine.impl.AbstractQuery.evaluateExpressions(AbstractQuery.java:290) ~[camunda-engine-7.15.0.jar:7.15.0]
          ... 151 common frames omitted
      Caused by: org.camunda.bpm.engine.ProcessEngineException: Candidate group list is empty
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
          at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
          at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
          at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[na:na]
          at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:394) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty(EnsureUtil.java:126) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty(EnsureUtil.java:119) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty(EnsureUtil.java:109) ~[camunda-engine-7.15.0.jar:7.15.0]
          at org.camunda.bpm.engine.impl.TaskQueryImpl.taskCandidateGroupIn(TaskQueryImpl.java:465) ~[camunda-engine-7.15.0.jar:7.15.0]
          ... 156 common frames omitted
      

      Expected behavior (Required on creation):

      No error, just no entries like for other filters.

      Root Cause (Required on prioritization):

      There is a ensureNotEmpty validation in the org.camunda.bpm.engine.impl.TaskQueryImpl#taskCandidateGroupIn method (ref). When there are no candidate groups, the ensureNotEmpty validation asserts to false and throws an exception.

      Solution Ideas (Optional):

      • Remove the ensureNotEmpty validation since it is only present for the TaskQueryImpl#taskCandidateGroupIn method.
        • Adjust the task mapping to ensure we are not joining the identity table when the list is empty
      • Add a new API for tasklist filters regarding TaskQueryImpl#taskCandidateGroupIn that would allow for empty lists.

        This is the controller panel for Smart Panels app

            [CAM-14388] Server error on filtering by user groups

            Hi schaefer,

            Thank you for reporting this. I successfully reproduced the bug and I will forward it for scheduling.

            Best,
            Nikola

            Nikola Koevski added a comment - Hi schaefer , Thank you for reporting this. I successfully reproduced the bug and I will forward it for scheduling. Best, Nikola

            Tobias Metzke-Bernstein added a comment - - edited

            Hi schaefer,

            thanks for bringing this up.

            While we agree that this behavior is not ideal and consider this a bug, we also consider this a rather low priority use case.
            Thus, we will not fix this in the near future due to other priorities.

            That being said, we believe fixing this is also not too complex when looking at the solution ideas.
            If this is important to you, we are happy to provide pointers on how to fix this so you can contribute via a pull request.

            Best,
            Tobias

            Tobias Metzke-Bernstein added a comment - - edited Hi schaefer , thanks for bringing this up. While we agree that this behavior is not ideal and consider this a bug, we also consider this a rather low priority use case. Thus, we will not fix this in the near future due to other priorities. That being said, we believe fixing this is also not too complex when looking at the solution ideas. If this is important to you, we are happy to provide pointers on how to fix this so you can contribute via a pull request. Best, Tobias

            This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2702. Please use this link for any future references and continue any discussion there.

            Thorben Lindhauer added a comment - This ticket was migrated to github: https://github.com/camunda/camunda-bpm-platform/issues/2702 . Please use this link for any future references and continue any discussion there.

              Unassigned Unassigned
              schaefer Andreas Schäfer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: