apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

Error in workflow not correctly propagated #987

Closed gabriel-farache closed 6 months ago

gabriel-farache commented 6 months ago

When an error occurs when, for instance, sending REST request using extension, the error is not propagated and the workflow hangs in active state.

extensions:
  - extensionid: workflow-uri-definitions
    definitions:
      notifications: "https://raw.githubusercontent.com/janus-idp/backstage-plugins/%40janus-idp/plugin-notifications-backend%401.0.3/plugins/notifications-backend/src/openapi.yaml"
functions:
  - name: createNotification
    operation: notifications#createNotification

Log:

2024-03-04 14:05:24,282 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (executor-thread-4) Unexpected error while executing node createNotification in process instance f53b870e-9d38-4ad4-b499-2d066b84e9b6: org.jbpm.workflow.instance.WorkflowRuntimeException: [MTAAnalysis:f53b870e-9d38-4ad4-b499-2d066b84e9b6 - createNotification:46] -- RESTEASY004655: Unable to invoke request: java.net.UnknownHostException: bckstage-backstage.backstage-system: Name or service not known

Here the error was caused because the host was unknown.

WHen accessing management/processes/ {workflow def id}/instances/{instance id}/error, we have

{"failedNodeId":"_jbpm-unique-38","id":"f53b870e-9d38-4ad4-b499-2d066b84e9b6","message":"java.net.UnknownHostException - bckstage-backstage.backstage-system: Name or service not known"}

And the workflow's state remains active

When sending REST request with specs file located in the workflow, the error seems to be correctly propagated as the workflow's state is set to error

gabriel-farache commented 6 months ago

The workflows are: