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

NPE calling Rest /deployment with bad parameter name

    Details

    • Title Keywords:
      NPE tenant

      Description

      Expected behavior:

      Current behavior:

      • NullPointerException, because we always treat such a form part as a file form part and add a deployment resource with name null

      Context:

      NOTE: It was thought to be a tenant issue, but it is only the bad speling of parameter tenant-id that cause the crash.

      can be reproduced with latest docker images:
      docker pull camunda/camunda-bpm-platform:latest
      docker run -d --name camunda -p 8080:8080 camunda/camunda-bpm-platform:latest

      assuming some bpmn file available, specifying -F "tenand-id=tenant1"
      make call crash, while not specifying it works.

      curl -w \n -H Accept: application/json -F "deployment-name=reporting" -F "enable-duplicate-filtering=true" -F "deploy-changed-only=true" -F "tenan*d*-id=tenant1" -F "workflow.bpmn=@./reporting/src/main/resources/bpmn/workflow.bpmn" http://localhost:8080/engine-rest/deployment/create

      First org.camunda stack: org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:41)
      org.camunda.bpm.engine.rest.filter.EmptyBodyFilter.doFilter(EmptyBodyFilter.java:97)
      </pre><p><b>Root Cause</b></p><pre>java.lang.NullPointerException
      org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.isResourceHandled(AbstractDefinitionDeployer.java:81)
      org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.parseDefinitionResources(AbstractDefinitionDeployer.java:70)
      org.camunda.bpm.engine.impl.AbstractDefinitionDeployer.deploy(AbstractDefinitionDeployer.java:61)

        Activity

        Hide
        thorben.lindhauer Thorben Lindhauer added a comment -

        I was able to reproduce this. The REST API treats such a parameter as a deployment resource and tries to extract the formpart's file name (which it uses as the deployment resource name). This name is null for non-file form parts, which then causes the exception.

        Show
        thorben.lindhauer Thorben Lindhauer added a comment - I was able to reproduce this. The REST API treats such a parameter as a deployment resource and tries to extract the formpart's file name (which it uses as the deployment resource name). This name is null for non-file form parts, which then causes the exception.
        Hide
        miklas.boskamp Miklas Boskamp added a comment -

        I changed the message. Fixed it on the backport branches as well.

        Show
        miklas.boskamp Miklas Boskamp added a comment - I changed the message. Fixed it on the backport branches as well.

          People

          • Assignee:
            Unassigned
            Reporter:
            yduf dufournaud
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development