apache / incubator-kie-kogito-examples

Kogito examples - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
254 stars 381 forks source link

Jobs Service Error #1473

Open hyp222 opened 1 year ago

hyp222 commented 1 year ago

Describe the bug

I'm following through this example (with Infinispan)

https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console

However, when I POST to http://localhost:8080/hiring I notice it's getting error while calling Jobs Service, and no jobs created while looking through the Management Console image

Any way I can further debug this or to test if my Jobs Service is up and running? Is this happening for everyone or just me?

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

tiagodolphine commented 1 year ago

@hyp222 do you have these properties set in the application.properties? kogito.service.url=http://localhost:8080 kogito.jobs-service.url=http://localhost:8580

hyp222 commented 1 year ago

@tiagodolphine , yes, that's included in the following properties file, and I haven't change anything

https://github.com/kiegroup/kogito-examples/blob/stable/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console/src/main/resources/application.properties

adailsonm commented 1 year ago

I have the same problem

in mine I'm using it inside docker as an alternative I made the network mode as host because my java app can see my docker and it worked without problems.

tiagodolphine commented 1 year ago

Hi @adailsonm @hyp222 I opened this https://issues.redhat.com/browse/KOGITO-8542 to track the issue, it seems some configuration in the app or in the environment, are you using docker-compose to run job-service? any error at this point?

adailsonm commented 1 year ago

To use docker compose yes, I even pointed out a possible solution for the operation using docker to externalize the network-mode to host so that java could see it locally.

tiagodolphine commented 1 year ago

For the error message the runtime app is not able to reach job-service, if the proper URI is configured in the app, probably it is related to some issue running job-service on docker... but it needs some investigation... Just to clarify are you running the example as it is, not changing any config, right? because we need to reproduce the same issue.

adailsonm commented 1 year ago

in my case, I'm running it using docker, but the same problem occurs if I use it as a network bridge, I changed it to host and it started working without problems, I only reported it because I thought it was a more generalized problem.

tiagodolphine commented 1 year ago

https://github.com/kiegroup/kogito-examples/pull/1553 @adailsonm @hyp222 fyi

scalasm commented 1 year ago

I still have the same error in running this very same example in kogito 1.33.0.Final .

I follow the instructions in https://github.com/kiegroup/kogito-examples/tree/stable/kogito-quarkus-examples/process-usertasks-timer-quarkus-with-console using docker compose inside my Ubuntu 22.04 and latest Docker Desktop running on Windows (WSL2).

Docker compose services Start without any problem, as well as the quarkus app (either in dev more or JAR mode). If I post anything to /hiring to URL (following the README.md) I get the error on the console.

BTW the management console just loads until I get this error after about 20s (related to the graphql endpoint being invoked in the screen to fetch the data): https://ibb.co/W254BXt .

Is there anything that I can try? I am new to Kogito and Quarkus and I hoped that the examples where at least my safe bet for getting started :D

adailsonm commented 1 year ago

I'm having trouble on our end here with regards to this.

pvsfair commented 1 year ago

BTW the management console just loads until I get this error after about 20s (related to the graphql endpoint being invoked in the screen to fetch the data): https://ibb.co/W254BXt .

I'm running the stack with docker compose, and I was having the same issue with versions later than 1.33 of management console, data index, etc...

What fixed for me was setting the CORS variable. I added

      QUARKUS_HTTP_CORS: true
      QUARKUS_HTTP_CORS_ORIGINS: "*"

to the environment of data-index, and it solved for me.

You can also add it to your application.properties as this:

quarkus.http.cors=true
quarkus.http.cors.origins=*

Reference for more CORS env vars: https://quarkus.io/guides/http-reference#cors-filter