From 4788c1edf3c6495df4590a69538bcfbafed9573a Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Tue, 26 Sep 2023 17:25:17 -0300 Subject: [PATCH 1/3] [KOGITO-9838] Add a troubleshooting guide for remove service invocations Signed-off-by: Ricardo Zanini --- serverlessworkflow/modules/ROOT/nav.adoc | 1 + ...onfiguring-openapi-services-endpoints.adoc | 7 +- ...chestration-of-openapi-based-services.adoc | 2 +- .../troubleshooting.adoc | 70 +++++++++++++++++++ 4 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc diff --git a/serverlessworkflow/modules/ROOT/nav.adoc b/serverlessworkflow/modules/ROOT/nav.adoc index 33e233210..8eeca65eb 100644 --- a/serverlessworkflow/modules/ROOT/nav.adoc +++ b/serverlessworkflow/modules/ROOT/nav.adoc @@ -31,6 +31,7 @@ *** xref:service-orchestration/configuring-openapi-services-endpoints.adoc[Advanced Configuration] *** xref:service-orchestration/working-with-openapi-callbacks.adoc[Callbacks] ** xref:service-orchestration/orchestration-of-grpc-services.adoc[gRPC] +** xref:service-orchestration/troubleshooting.adoc[Troubleshooting] * Event Orchestration ** xref:eventing/orchestration-of-asyncapi-based-services.adoc[AsyncAPI] ** xref:eventing/event-correlation-with-workflows.adoc[Event Correlation] diff --git a/serverlessworkflow/modules/ROOT/pages/service-orchestration/configuring-openapi-services-endpoints.adoc b/serverlessworkflow/modules/ROOT/pages/service-orchestration/configuring-openapi-services-endpoints.adoc index 51332f5f4..0c4911526 100644 --- a/serverlessworkflow/modules/ROOT/pages/service-orchestration/configuring-openapi-services-endpoints.adoc +++ b/serverlessworkflow/modules/ROOT/pages/service-orchestration/configuring-openapi-services-endpoints.adoc @@ -368,7 +368,7 @@ curl -X 'POST' \ ---- .Example response -[source,shell] +[source,json] ---- {"id":"5ab5dcb8-5952-4730-b526-cace363774bb","workflowdata":{"symbol":"KGTO","currentPrice":75,"profit":"50%"}} ---- @@ -422,7 +422,7 @@ curl -X 'POST' \ ---- .Example response -[source,shell] +[source,json] ---- {"id":"a80c95d6-51fd-4ca9-b689-f779929c9937","workflowdata":{"symbol":"KGTO","currentPrice":59.36,"profit":"19%"}} ---- @@ -469,7 +469,7 @@ curl -X 'POST' \ ---- .Example response -[source,shell] +[source,json] ---- {"id":"5ab5dcb8-5952-4730-b526-cace363774bb","workflowdata":{"symbol":"KGTO","currentPrice":56.35,"profit":"13%"}} ---- @@ -481,5 +481,6 @@ Note that, in the previous example, you overwrote the property defined in the `a * xref:service-orchestration/orchestration-of-openapi-based-services.adoc[Orchestrating the OpenAPI services] * link:{quarkus-profiles-url}[Quarkus configuration guide] +* xref:service-orchestration/troubleshooting.adoc[] include::../../pages/_common-content/report-issue.adoc[] \ No newline at end of file diff --git a/serverlessworkflow/modules/ROOT/pages/service-orchestration/orchestration-of-openapi-based-services.adoc b/serverlessworkflow/modules/ROOT/pages/service-orchestration/orchestration-of-openapi-based-services.adoc index 8d10ea4ed..d89b7a860 100644 --- a/serverlessworkflow/modules/ROOT/pages/service-orchestration/orchestration-of-openapi-based-services.adoc +++ b/serverlessworkflow/modules/ROOT/pages/service-orchestration/orchestration-of-openapi-based-services.adoc @@ -402,7 +402,7 @@ In a future release, {product_name} will provide support for Kubernetes Service == Additional resources * {configuring-openapi-services-endpoints}[Configuring OpenAPI services endpoints] -//* {camel-k-integration}[Integrating Camel K] Guide not available in DP1 * {authention-support-for-openapi-services}[Authentication for OpenAPI services in {product_name}] +* xref:service-orchestration/troubleshooting.adoc[] include::../../pages/_common-content/report-issue.adoc[] diff --git a/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc new file mode 100644 index 000000000..92c47f497 --- /dev/null +++ b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc @@ -0,0 +1,70 @@ += Troubleshooting Remote Service Invocations +:compat-mode!: +// Metadata: +:description: Troubleshooting remote service invocations +:keywords: workflow, serverless, openapi, services, json, http, tls, https +// Links: +:apache_http_client_url: https://hc.apache.org/httpcomponents-client-5.2.x/ + +This document describes an ongoing list of known issues while invoking remote services from workflows such as OpenAPI functions. + +== Turning HTTP tracing on + +Under the hood, {product_name} uses link:{apache_http_client_url}[Apache HTTP Client]. You can turn HTTP requests and responses tracing by setting the following property: + +.Turning HTTP tracing on +[source,properties] +---- +quarkus.log.category."org.apache.http".level=DEBUG +---- + +Reset the application so the log configuration is propagated. After that, you can find HTTP tracing in your logs. + +.HTTP Request trace +[source,log,subs="attributes+"] +---- +... +2023-09-25 19:00:55,242 DEBUG Executing request POST /v2/models/yolo-model/infer HTTP/1.1 +... +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> POST /v2/models/yolo-model/infer HTTP/1.1 <1> +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> Accept: application/json +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> Content-Type: application/json +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> kogitoprocid: inferencepipeline <2> +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> kogitoprocinstanceid: 85114b2d-9f64-496a-bf1d-d3a0760cde8e <3> +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> kogitoprocist: Active +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> kogitoproctype: SW +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> kogitoprocversion: 1.0 +2023-09-25 19:00:55,243 DEBUG http-outgoing-0 >> Content-Length: 23177723 +2023-09-25 19:00:55,244 DEBUG http-outgoing-0 >> Host: yolo-model-opendatahub-model.apps.trustyai.dzzt.p1.openshiftapps.com +... +---- + +1. The path where the client will make the HTTP invocation +2. The workflow definition id +3. The workflow instance (execution) id + +In the example above, you have access to every portion of the HTTP request and can verify if something is wrong during the message creation. +For example, you can use the `kogitoprocinstanceid` header to trace this HTTP message in the logs. + +For responses, you should be able to see the details below the request body: + +.HTTP Response trace +[source,log,subs="attributes+"] +---- +... +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "HTTP/1.1 500 Internal Server Error[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "content-type: application/json[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "date: Mon, 25 Sep 2023 19:01:00 GMT[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "content-length: 186[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "set-cookie: 276e4597d7fcb3b2cba7b5f037eeacf5=5427fafade21f8e7a4ee1fa6c221cf40; path=/; HttpOnly; Secure; SameSite=None[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "{"code":13, "message":"Failed to load Model due to adapter error: Error calling stat on model file: stat /models/yolo-model__isvc-1295fd6ba9/yolov5s-seg.onnx: no such file or directory"}" <1> +... +---- + +1. Response code returned by the server. In this example, a general server error +2. Response body containing the message body returned by the server + +Having the details about the HTTP invocation enables users to do a better assessment about the behavior of a given workflow. + +include::../../pages/_common-content/report-issue.adoc[] \ No newline at end of file From 7f46bb3514643940da65010d250e3c1090c4ca32 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:31:36 -0300 Subject: [PATCH 2/3] Incorporating Marian's review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marián Macik --- .../ROOT/pages/service-orchestration/troubleshooting.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc index 92c47f497..af00f1914 100644 --- a/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc +++ b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc @@ -52,13 +52,13 @@ For responses, you should be able to see the details below the request body: [source,log,subs="attributes+"] ---- ... -2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "HTTP/1.1 500 Internal Server Error[\r][\n]" +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "HTTP/1.1 500 Internal Server Error[\r][\n]" <1> 2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "content-type: application/json[\r][\n]" 2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "date: Mon, 25 Sep 2023 19:01:00 GMT[\r][\n]" 2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "content-length: 186[\r][\n]" 2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "set-cookie: 276e4597d7fcb3b2cba7b5f037eeacf5=5427fafade21f8e7a4ee1fa6c221cf40; path=/; HttpOnly; Secure; SameSite=None[\r][\n]" 2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "[\r][\n]" -2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "{"code":13, "message":"Failed to load Model due to adapter error: Error calling stat on model file: stat /models/yolo-model__isvc-1295fd6ba9/yolov5s-seg.onnx: no such file or directory"}" <1> +2023-09-25 19:01:00,738 DEBUG http-outgoing-0 << "{"code":13, "message":"Failed to load Model due to adapter error: Error calling stat on model file: stat /models/yolo-model__isvc-1295fd6ba9/yolov5s-seg.onnx: no such file or directory"}" <2> ... ---- From efe696c999fdecbb60efd5be0b5ace875d3653bb Mon Sep 17 00:00:00 2001 From: Ricardo Zanini Date: Wed, 27 Sep 2023 15:40:23 -0300 Subject: [PATCH 3/3] Turning the troubleshooting guide more generic for services orchestrations Signed-off-by: Ricardo Zanini --- .../pages/service-orchestration/troubleshooting.adoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc index af00f1914..81ece03d1 100644 --- a/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc +++ b/serverlessworkflow/modules/ROOT/pages/service-orchestration/troubleshooting.adoc @@ -1,14 +1,18 @@ -= Troubleshooting Remote Service Invocations += Troubleshooting Services Orchestrations :compat-mode!: // Metadata: -:description: Troubleshooting remote service invocations +:description: Troubleshooting Services Orchestrations :keywords: workflow, serverless, openapi, services, json, http, tls, https // Links: :apache_http_client_url: https://hc.apache.org/httpcomponents-client-5.2.x/ -This document describes an ongoing list of known issues while invoking remote services from workflows such as OpenAPI functions. +This document describes an ongoing list of known issues while orchestrating services with workflows. -== Turning HTTP tracing on +== Troubleshooting HTTP Services Invocations + +The backbone of workflow orchestrations are remote HTTP services invocations, for example when using xref:service-orchestration/orchestration-of-openapi-based-services.adoc[OpenAPI functions]. Following a few steps that can be useful when troubleshooting HTTP-based functions. + +=== Tracing HTTP Requests and Responses Under the hood, {product_name} uses link:{apache_http_client_url}[Apache HTTP Client]. You can turn HTTP requests and responses tracing by setting the following property: