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
255 stars 381 forks source link

Error in process-usertasks-timer-quarkus-with-console-runner for management/task console #1773

Open a-kshesh opened 1 year ago

a-kshesh commented 1 year ago

Describe the bug

I am running the latest process-usertasks-timer-quarkus-with-console-runner as is and everything works fine expect the management and task console as it errors out trying to reach http://172.17.0.1:8180/graphql net::ERR_ADDRESS_UNREACHABLE. Although I am able to use the http://localhost:8180/graphiql/ perfectly fine.

Expected behavior

It should show up the process instances without any errors.

Actual behavior

Management and task console are not able to reach the data-index.

How to Reproduce?

Reproduce it by running the project using infinispan profile.

Output of uname -a or ver

Darwin Kernel Version 22.6.0

Output of java -version

openjdk version "17.0.7"

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)

1.42.0.Final

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

No response

Additional information

No response

radtriste commented 1 year ago

Hi @a-kshesh Thank you for reporting. Which OS are you using ? 127.17.0.1 is usually the docker ip, that is why it is there ...

a-kshesh commented 1 year ago

I am on macOS Ventura 13.5 intel one.

a-kshesh commented 1 year ago

@radtriste I have tried the same example in another mac and it's having the same issue. I didn't see any logs in the containers as well. I am not sure why both the management and task console are not able to reach the data-index whereas the data-index works fine from localhost:8180

radtriste commented 1 year ago

@spolti would you be able to help ? I cannot test this on macOS

spolti commented 1 year ago

I'll take a look later.

a-kshesh commented 1 year ago

Just an update. As I was trying to debug, I changed the KOGITO_DATAINDEX_HTTP_URL in docker-compose for to http://localhost:8180/graphql and the net::ERR_ADDRESS_UNREACHABLE for graphQL in consoles is gone. the other issue that are coming up is

  1. Task console isn't showing the forms, stating that there is no form to display.
  2. Management Console is throwing CORS policy error as while trying to communicate with the localhost:8080. I was able to solve these issues by adding quarkus.http.cors.origins=http://localhost:8280,http://localhost:8380 quarkus.http.cors.headers=accept, origin, authorization, content-type, x-requested-with quarkus.http.cors.methods=GET,POST,PUT,DELETE,PATCH in the application.properties.

Now it works in terms of functionalities but I have one other problem which is a distorted management console as below from the replica of this example with some java class changes. Untitled Untitled

There are some other CORS error popping up with regards to the SVG as it is not showing up in the management console as below

GET http://localhost:8280/svg/processes/que_assignment/instances/dce0cd86-e0c2-4c2e-9e86-ddc95ce061d8 500 (Internal Server Error)
 Access to XMLHttpRequest at 'http://localhost:8080/svg/processes/que_assignment/instances/dce0cd86-e0c2-4c2e-9e86-ddc95ce061d8' from origin 'http://localhost:8280' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
GET http://localhost:8080/svg/processes/que_assignment/instances/dce0cd86-e0c2-4c2e-9e86-ddc95ce061d8 net::ERR_FAILED 500 (Internal Server Error)
Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received.

This might be causing the UI distortion because of the SVG not popping up or I am missing something! I hope this helps in your debugging @spolti .