Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-1143

[Orchestrator M2K] Insufficient error message given when supplying incorrect parameters

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Description of the problem:
      When M2K workflow is given non-existent project ID parameters, the workflow fails with an error, but the exact cause of failure is not reported correctly. 

      How reproducible: 100%

      Steps to reproduce:

      1. Deploy M2K using workflow Helm chart 0.2.12, orchestrator chart 0.2.2

      2. Give garbage or incorrect project ID in the M2K parameters

      Actual results:
      Workflow run fails with 500 error:

      {
        "error": {
          "name": "Error",
          "message": "Request failed with status 500 Internal Server Error, {\"message\":\"Exceeded maximum number of retries for async function\"}"
        },
        "response": {
          "statusCode": 500
        }
      } 

      but the workflow instance is still created in Error state and returns error 404 - unknown error.

      In the M2K pod logs, it is unclear that the error is because of invalid input:

      2024-03-19 18:18:51,809 ERROR [org.jbp.wor.ins.imp.WorkflowProcessInstanceImpl] (executor-thread-13) Unexpected error while executing node startPlanning in process instance fe9301a0-16e5-4c5f-9d5b-47b84caa7e1d: org.jbpm.workflow.instance.WorkflowRuntimeException: [m2k:fe9301a0-16e5-4c5f-9d5b-47b84caa7e1d - startPlanning:7] -- Unknown error, status code 404	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.getExceptionScopeInstance(WorkItemNodeInstance.java:211)	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.handleException(WorkItemNodeInstance.java:205)	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:195)	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:169)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:245)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:444)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:429)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:399)	at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:76)	at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:55)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:245)	at org.jbpm.workflow.instance.node.CompositeNodeInstance.internalTrigger(CompositeNodeInstance.java:145)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:245)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:444)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:429)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:399)	at org.jbpm.workflow.instance.node.StartNodeInstance.triggerCompleted(StartNodeInstance.java:76)	at org.jbpm.workflow.instance.node.StartNodeInstance.internalTrigger(StartNodeInstance.java:55)	at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:245)	at org.jbpm.ruleflow.instance.RuleFlowProcessInstance.internalStart(RuleFlowProcessInstance.java:39)	at org.jbpm.process.instance.impl.ProcessInstanceImpl.start(ProcessInstanceImpl.java:268)	at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.start(WorkflowProcessInstanceImpl.java:517)	at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:167)	at org.jbpm.process.instance.KogitoProcessRuntimeImpl.startProcessInstance(KogitoProcessRuntimeImpl.java:76)	at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:290)	at org.kie.kogito.process.impl.AbstractProcessInstance.start(AbstractProcessInstance.java:262)	at org.kie.kogito.process.impl.ProcessServiceImpl.lambda$createProcessInstance$0(ProcessServiceImpl.java:75)	at org.kie.kogito.services.uow.UnitOfWorkExecutor.executeInUnitOfWork(UnitOfWorkExecutor.java:40)	at org.kie.kogito.process.impl.ProcessServiceImpl.createProcessInstance(ProcessServiceImpl.java:70)	at org.kie.kogito.serverless.M2kResource.createResource_m2k(M2kResource.java:82)	at org.kie.kogito.serverless.M2kResource_ClientProxy.createResource_m2k(Unknown Source)	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)	at java.base/java.lang.reflect.Method.invoke(Method.java:568)	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:154)	at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:118)	at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:560)	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:452)	at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:413)	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:321)	at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:415)	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:378)	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:356)	at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:70)	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:429)	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:240)	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:154)	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:321)	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:157)	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:229)	at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:82)	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:147)	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:93)	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)	at java.base/java.lang.Thread.run(Thread.java:840)Caused by: WorkItemExecutionError [errorCode=404]	at org.kie.kogito.serverless.workflow.openapi.OpenApiWorkItemHandler.internalExecute(OpenApiWorkItemHandler.java:51)	at org.kie.kogito.serverless.workflow.WorkflowWorkItemHandler.executeWorkItem(WorkflowWorkItemHandler.java:42)	at org.kie.kogito.app.Move2kube_startPlanning_ClientProxy.executeWorkItem(Unknown Source)	at org.jbpm.process.instance.LightWorkItemManager.internalExecuteWorkItem(LightWorkItemManager.java:80)	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.lambda$internalTrigger$0(WorkItemNodeInstance.java:170)	at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:183)	... 58 more
      2024-03-19 18:18:51,815 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-13) HTTP Request to /m2k failed, error id: c923347d-3aaa-4e10-a7bd-7269f30ef64d-2: java.lang.ClassCastException: class org.kie.kogito.process.ProcessInstanceExecutionException cannot be cast to class org.kie.kogito.process.workitem.WorkItemExecutionException (org.kie.kogito.process.ProcessInstanceExecutionException and org.kie.kogito.process.workitem.WorkItemExecutionException are in unnamed module of loader io.quarkus.bootstrap.runner.RunnerClassLoader @12bb4df8)	at org.kie.kogito.resource.exceptions.BaseExceptionsHandler.lambda$new$23(BaseExceptionsHandler.java:146)	at org.kie.kogito.resource.exceptions.BaseExceptionsHandler.mapException(BaseExceptionsHandler.java:190)	at org.kie.kogito.resource.exceptions.ProcessInstanceExecutionExceptionMapper.toResponse(ProcessInstanceExecutionExceptionMapper.java:31)	at org.kie.kogito.resource.exceptions.ProcessInstanceExecutionExceptionMapper.toResponse(ProcessInstanceExecutionExceptionMapper.java:26)	at org.jboss.resteasy.core.ExceptionHandler.executeExceptionMapper(ExceptionHandler.java:139)	at org.jboss.resteasy.core.ExceptionHandler.unwrapException(ExceptionHandler.java:183)	at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:100)	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:344)	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:205)	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:452)	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:240)	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:154)	at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:321)	at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:157)	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:229)	at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:82)	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:147)	at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler$1.run(VertxRequestHandler.java:93)	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)	at java.base/java.lang.Thread.run(Thread.java:840)
       

      In the move2kube pod logs, the correct error does appear:

      time="2024-03-19T18:18:51Z" level=info msg="POST /api/v1/workspaces/68443621-04c2-4910-a42d-a94e0b7ed259/projects/11111111-1111-1111-1111-111111111111/plan?remote-source=git%2Bssh%3A%2F%2Fgithub.com%2Ftest-workflows%2Fapplication-onboarding%40main" request-id=7f416979-13e9-4e2d-82d7-abbc99d33c95
      time="2024-03-19T18:18:51Z" level=error msg="failed to start plan generation. Error: \"the id: 11111111-1111-1111-1111-111111111111 was not found\"" request-id=7f416979-13e9-4e2d-82d7-abbc99d33c95
       

      Expected results: 
      If the workflow fails because of invalid input, this should be clearly indicated to the user in both the UI and in both sets of logs. In addition, it is unclear what the source of the 500 error is.

              rgolan1@redhat.com Roy Golan
              yfirst Yona First
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: