apache / incubator-kie-kogito-docs

Kogito Documentation Repository
https://kiegroup.github.io/kogito-docs/
Apache License 2.0
12 stars 59 forks source link

issue running kogito examples in kubernetes/minikube - connection refused internal #356

Closed sstimmel closed 9 months ago

sstimmel commented 1 year ago

when running kogito examples such as serverless-workflow-custom-function-knative or serverless-workflow-loanbroker-showcase with minikube/kubernetes, I can call the service from my local host to kickoff the workflow, but the internal service to service calls fail with connection refused.

I assume since kourier load balancer external-ip is 127.0.0.1, thats where its picking that ip. Not sure what I need to do to fix this issue. The workflow json function is referencing "operation": "knative:custom-function-knative-service",

Example,

Caused by: java.util.concurrent.CompletionException: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: custom-function-knative-service.default.127.0.0.1.sslip.io/127.0.0.1:80 at io.smallrye.mutiny.operators.uni.UniBlockingAwait.await(UniBlockingAwait.java:79) at io.smallrye.mutiny.groups.UniAwait.atMost(UniAwait.java:65) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.PlainJsonKnativeServiceRequestClient.sendRequest(PlainJsonKnativeServiceRequestClient.java:86) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.KnativeServiceRequestClient.execute(KnativeServiceRequestClient.java:56) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.PlainJsonKnativeServiceRequestClient_ClientProxy.execute(Unknown Source) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.KnativeServerlessWorkflowCustomFunction.execute(KnativeServerlessWorkflowCustomFunction.java:58) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.KnativeServerlessWorkflowCustomFunction_ClientProxy.execute(Unknown Source) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.KnativeWorkItemHandler.internalExecute(KnativeWorkItemHandler.java:42) at org.kie.kogito.serverless.workflow.WorkflowWorkItemHandler.executeWorkItem(WorkflowWorkItemHandler.java:40) at org.kie.kogito.addons.quarkus.knative.serving.customfunctions.KnativeWorkItemHandler_ClientProxy.executeWorkItem(Unknown Source) at org.jbpm.process.instance.LightWorkItemManager.internalExecuteWorkItem(LightWorkItemManager.java:79) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.lambda$internalTrigger$0(WorkItemNodeInstance.java:161) at org.jbpm.workflow.instance.node.WorkItemNodeInstance.processWorkItemHandler(WorkItemNodeInstance.java:174) ... 90 more

sstimmel commented 1 year ago

switching minikube driver to hyperkit instead of docker put the service on a different port than 127.0.0.1 which fixed this issue.

radtriste commented 1 year ago

@spolti @desmax74 @davidesalerno @ricardozanini any idea ?

ricardozanini commented 1 year ago

Hey @sstimmel this is an internal service discovery that we have in place. So if you faced problems there it might be related to it. Essentially we fetch the Knative API to get this Address. We might have to report to them. 🤔

Can you revert back your config and display the description of the Knative service custom-function-knative-service? I'm curious to see the Address. We might need to assume other network in situations like this.

ricardozanini commented 1 year ago

cc @hbelmiro @lionelvillard

spolti commented 1 year ago

the url being translated to localhost sounds weird, that would explain the connection refused (http://custom-function-knative-service.default.127.0.0.1.sslip.io/127.0.0.1:80)

What is the output of kn service list custom-function-knative-service?

Em seg., 5 de jun. de 2023 às 11:38, Ricardo Zanini < @.***> escreveu:

cc @hbelmiro https://github.com/hbelmiro @lionelvillard https://github.com/lionelvillard

— Reply to this email directly, view it on GitHub https://github.com/kiegroup/kogito-docs/issues/356#issuecomment-1576928748, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOHCM3UEZI4KAVGFLB7W5TXJXVM3ANCNFSM6AAAAAAYW2C5LI . You are receiving this because you were mentioned.Message ID: @.***>

-- Regards, --Filippe

sstimmel commented 1 year ago
sstimmel@C02FL576MD6R custom-function-knative-service % kn service list
NAME                              URL                                                                 LATEST                                  AGE    CONDITIONS   READY   REASON
custom-function-knative-service   http://custom-function-knative-service.default.127.0.0.1.sslip.io   custom-function-knative-service-00001   14m    3 OK / 3     True    
workflow                          http://workflow.default.127.0.0.1.sslip.io                          workflow-00001                          18m    3 OK / 3     True    
ricardozanini commented 1 year ago

@spolti that seems an error in the internal discovery mechanism applying the default host to the discovered URL. cc @hbelmiro for when you get back.

spolti commented 1 year ago

kn list reports localhost, according with his first comment:

switching minikube driver to hyperkit instead of docker put the service on a different port than 127.0.0.1 which fixed this issue.

seems to be something related with his env, as he changed the driver.

@sstimmel I am a little bit curios, can you please share information about your environment and the command to start minikube?

domhanak commented 11 months ago

Hello, it has been couple of months since there has been any traffic here. Could you please share some update on this issue? I ll close it as stale if we do not get update.