Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploying Workflow definition throws error #3278

Closed
jwulf opened this issue Oct 30, 2019 · 5 comments
Closed

Deploying Workflow definition throws error #3278

jwulf opened this issue Oct 30, 2019 · 5 comments
Labels
kind/bug Categorizes an issue or PR as a bug

Comments

@jwulf
Copy link
Member

jwulf commented Oct 30, 2019

Describe the bug
Deploying the attached BPMN diagram on SNAPSHOT and 0.21.1 throws an error.

Expected behavior
Workflow definition deploys.

Log/Stacktrace

3 INVALID_ARGUMENT: Command rejected with code 'CREATE': Expected to deploy new resources,
but encountered the following errors:

   'await-outcome.bpmn': class
 org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl 
cannot be cast to class io.zeebe.model.bpmn.instance.BpmnModelElementInstance 
(org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl and 
io.zeebe.model.bpmn.instance.BpmnModelElementInstance are in unnamed module 
of loader 'app')

Full Stacktrace

2019-10-30 09:09:22.315 [partition-1-processor] [0.0.0.0:26501-zb-actors-1] ERROR io.zeebe.broker.workflow - Unexpected error while processing resource 'await-outcome.bpmn'
java.lang.ClassCastException: class org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl cannot be cast to class io.zeebe.model.bpmn.instance.BpmnModelElementInstance (org.camunda.bpm.model.xml.impl.instance.ModelElementInstanceImpl and io.zeebe.model.bpmn.instance.BpmnModelElementInstance are in unnamed module of loader 'app')
	at java.util.ArrayList.forEach(ArrayList.java:1540) ~[?:?]
	at io.zeebe.model.bpmn.traversal.ModelWalker.walk(ModelWalker.java:62) ~[zeebe-bpmn-model-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.workflow.deployment.transform.BpmnValidator.validate(BpmnValidator.java:35) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.workflow.deployment.transform.DeploymentTransformer.transformResource(DeploymentTransformer.java:100) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.workflow.deployment.transform.DeploymentTransformer.transform(DeploymentTransformer.java:77) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.workflow.deployment.TransformingDeploymentCreateProcessor.processRecord(TransformingDeploymentCreateProcessor.java:60) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.TypedRecordProcessor.processRecord(TypedRecordProcessor.java:46) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.ProcessingStateMachine.lambda$processInTransaction$1(ProcessingStateMachine.java:245) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.db.impl.rocksdb.transaction.ZeebeTransaction.run(ZeebeTransaction.java:69) ~[zeebe-db-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.ProcessingStateMachine.processInTransaction(ProcessingStateMachine.java:236) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.ProcessingStateMachine.processEvent(ProcessingStateMachine.java:205) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.engine.processor.ProcessingStateMachine.readNextEvent(ProcessingStateMachine.java:181) ~[zeebe-workflow-engine-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorJob.invoke(ActorJob.java:76) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorJob.execute(ActorJob.java:39) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorTask.execute(ActorTask.java:127) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorThread.executeCurrentTask(ActorThread.java:107) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorThread.doWork(ActorThread.java:91) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]
	at io.zeebe.util.sched.ActorThread.run(ActorThread.java:195) [zeebe-util-0.22.0-SNAPSHOT.jar:0.22.0-SNAPSHOT]

await-outcome.bpmn.zip

Environment:

  • OS: Mac OS
  • Zeebe Version: Docker SNAPSHOT and Docker :0.21.1
@jwulf jwulf added the kind/bug Categorizes an issue or PR as a bug label Oct 30, 2019
@saig0
Copy link
Member

saig0 commented Oct 30, 2019

The error is caused by an unknown extension zeebe:payloadMapping at the end event.

    <bpmn:endEvent id="EndEvent_0th2j52">
      <bpmn:extensionElements>
        <zeebe:payloadMappings>
          <zeebe:mapping source="sourceValue" target="targetValue" type="PUT" />
        </zeebe:payloadMappings>
      </bpmn:extensionElements>
      <bpmn:incoming>SequenceFlow_139z5p7</bpmn:incoming>
    </bpmn:endEvent>

It seems that the modeler creates an outdated extension element for the variable mappings.

However, we should improve the error message 😅

@saig0
Copy link
Member

saig0 commented Oct 30, 2019

I opened an issue for the modeler: zeebe-io/zeebe-modeler#138

@tvvignesh
Copy link

tvvignesh commented Jan 20, 2020

@saig0 @jwulf Hi. I got a similar error when trying to deploy a very simple bpmn. Did not have payloadMapping in my case.

Screenshot from 2020-01-20 09-09-15

BPMN:

<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:zeebe="http://camunda.org/schema/zeebe/1.0" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_11ugaob" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Zeebe Modeler" exporterVersion="0.8.0">
  <bpmn:process id="accounts-tc-feedback" name="Timecampus Feedback" isExecutable="true">
    <bpmn:startEvent id="StartEvent_1">
      <bpmn:messageEventDefinition />
    </bpmn:startEvent>
    <bpmn:startEvent id="accounts-tc-feedback-provided" name="Feedback Provided">
      <bpmn:outgoing>SequenceFlow_0jeqpiv</bpmn:outgoing>
      <bpmn:messageEventDefinition messageRef="Message_01tij8f" />
    </bpmn:startEvent>
    <bpmn:sequenceFlow id="SequenceFlow_0jeqpiv" sourceRef="accounts-tc-feedback-provided" targetRef="accounts-tc-feedback-sendemail" />
    <bpmn:serviceTask id="accounts-tc-feedback-sendemail" name="Send Feedback Tracking Email">
      <bpmn:extensionElements>
        <zeebe:taskDefinition type="accounts-tc-feedback-sendemail" retries="3" />
      </bpmn:extensionElements>
      <bpmn:incoming>SequenceFlow_0jeqpiv</bpmn:incoming>
      <bpmn:outgoing>SequenceFlow_01at7vs</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="accounts-tc-feedback-end" name="Feedback End">
      <bpmn:incoming>SequenceFlow_01at7vs</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="SequenceFlow_01at7vs" sourceRef="accounts-tc-feedback-sendemail" targetRef="accounts-tc-feedback-end" />
  </bpmn:process>
  <bpmn:message id="Message_01tij8f" name="accounts-tc-feedback-provided" />
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="accounts-tc-feedback">
      <bpmndi:BPMNShape id="StartEvent_1juexnu_di" bpmnElement="StartEvent_1">
        <dc:Bounds x="179" y="79" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="StartEvent_0fqn4t2_di" bpmnElement="accounts-tc-feedback-provided">
        <dc:Bounds x="952" y="312" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="946" y="355" width="49" height="27" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_0jeqpiv_di" bpmnElement="SequenceFlow_0jeqpiv">
        <di:waypoint x="988" y="330" />
        <di:waypoint x="1040" y="330" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="ServiceTask_0ibqwww_di" bpmnElement="accounts-tc-feedback-sendemail">
        <dc:Bounds x="1040" y="290" width="100" height="80" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="EndEvent_1sdui7x_di" bpmnElement="accounts-tc-feedback-end">
        <dc:Bounds x="1192" y="312" width="36" height="36" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1175" y="355" width="71" height="14" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="SequenceFlow_01at7vs_di" bpmnElement="SequenceFlow_01at7vs">
        <di:waypoint x="1140" y="330" />
        <di:waypoint x="1192" y="330" />
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

Running zeebe-modeller 8.0 with 0.22 version of zeebe, 0.22.0-alpha.5 version of node client

@saig0
Copy link
Member

saig0 commented Jan 20, 2020

@tvvignesh, this is not the same issue. In your example, the deployment is rejected because your BPMN is not valid. In the original case, an exception was thrown in the model API because of a bug.

As mentioned in the rejection failure message: the start event (id: "StartEvent_1") have a message event definition (i.e. it's a message start event) but it does not refer a message. In the Zeebe modeler, you need to select the message start event and select (or create) a message in the properties panel.

@tvvignesh
Copy link

@saig0 Oops. You are right. Found the error and fixed it. Sorry for the confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes an issue or PR as a bug
Projects
None yet
Development

No branches or pull requests

5 participants