Management console not working while using kogito-data-index-postgresql

1,261 views
Skip to first unread message

Diogo

unread,
Sep 15, 2021, 6:55:41 AM9/15/21
to Kogito development mailing list
Hi, 

I have a project working with data-index using postgresql but I'm having trouble getting the management console running, every time I try to see which processes are running, in the management console, I get this errror:

Screenshot_1.jpg
In data-index it returns something when I try to do a query, I already initialized the tables present here: https://github.com/kiegroup/kogito-apps/blob/main/data-index/data-index-storage/data-index-storage-postgresql/src/main/resources/data_index_create.sql in the postgres database running on docker
Screenshot_2.jpg
Here is a copy of my docker-compose:

version: '2.1'

services:
  
  postgres:
    image: "postgres"
    ports:
      - "5432:5432"
    volumes:
      - ./postgres/initialize-databases.sql:/docker-entrypoint-initdb.d/initialize-databases.sql
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres

  zookeeper:
    container_name: zookeeper
    image: strimzi/kafka:0.20.1-kafka-2.6.0
    command: [
      "sh", "-c",
      "bin/zookeeper-server-start.sh config/zookeeper.properties"
    ]
    ports:
      - "2181:2181"
    environment:
      LOG_DIR: "/tmp/logs"

  kafka:
    image: strimzi/kafka:0.20.1-kafka-2.6.0
    container_name: kafka
    command: [
      "sh", "-c",
      "bin/kafka-server-start.sh config/server.properties --override inter.broker.listener.name=$${KAFKA_INTER_BROKER_LISTENER_NAME} --override listener.security.protocol.map=$${KAFKA_LISTENER_SECURITY_PROTOCOL_MAP} --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}"
    ]
    depends_on:
      - zookeeper
    ports:
      - "9092:9092"
    environment:
      KAFKA_BROKER_ID: 0
      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
      KAFKA_LISTENERS: INTERNAL://kafka:29092,EXTERNAL://kafka:9092
      KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:29092,EXTERNAL://localhost:9092
      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
      KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
      KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      LOG_DIR: "/tmp/logs"

  prometheus:
    image: prom/prometheus:v2.8.0
    container_name: prometheus
    volumes:
      - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:z
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
    ports:
      - 9090:9090

  grafana:
    image: grafana/grafana:6.6.1
    container_name: grafana
    depends_on:
      - prometheus
    ports:
      - 3000:3000
    volumes:
      - ./grafana/provisioning/:/etc/grafana/provisioning/:z
    environment:
      - PROMETHEUS_URL=http://prometheus:9090
  
  keycloak:
    container_name: keycloak
    ports:
      - "8480:8080"
    volumes:
      - ./keycloak/kogito-realm.json:/tmp/kogito-realm.json
    environment:
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_DATABASE: postgres
      DB_USER: postgres
      DB_SCHEMA: public
      DB_PASSWORD: postgres
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: admin
      KEYCLOAK_IMPORT: /tmp/kogito-realm.json

  data-index:
    container_name: data-index
    ports:
      - "8180:8080"
    depends_on:
      kafka:
        condition: service_started
    volumes:
      - ./target/protobuf:/home/kogito/data/protobufs/
    environment:
      QUARKUS_DATASOURCE_JDBC_URL: "jdbc:postgresql://postgres:5432/postgres"
      QUARKUS_DATASOURCE_USERNAME: postgres
      QUARKUS_DATASOURCE_PASSWORD: postgres
      KAFKA_BOOTSTRAP_SERVERS: kafka:29092

  management-console:
    container_name: management-console
    ports:
      - 8280:8080
    depends_on:
      - data-index
    volumes:
      - ./svg/:/home/kogito/data/svg/
    environment:
      KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8180
      KOGITO_MANAGEMENT_CONSOLE_PROPS: -Dkogito.consoles.keycloak.config.url=http://${DOCKER_GATEWAY_HOST}:8480/auth -Dkogito.consoles.keycloak.config.health-check-url=http://localhost:8480/auth/realms/kogito/.well-known/openid-configuration -Dkogito.svg.folder.path=/home/kogito/data/svg
      SCRIPT_DEBUG: "true" 

Not sure what is leading the management-console to fail or what should I do to fix it, If you could help it would be very good.

Thanks in advance,
Best Regards 
Diogo

Pere Fernandez

unread,
Sep 15, 2021, 8:55:38 AM9/15/21
to Kogito development mailing list
Hey Diogo, thank you for rising this!

Setting up the environment here the issue... is there any error in the terminal or the browsser console?

El dia dimecres, 15 de setembre de 2021 a les 12:55:41 UTC+2, Diogo va escriure:

Diogo

unread,
Sep 15, 2021, 9:13:29 AM9/15/21
to Kogito development mailing list
Hi,

Thanks for the quick response, the only error that I'm picking up is in the browser console, and it doesn't give much away unfortunately:
Screenshot_1.jpg
About the terminal, there isn't any error there and all the services that I have in docker are running fine.

Best regards,
Diogo 

Pere Fernandez

unread,
Sep 15, 2021, 9:31:21 AM9/15/21
to Kogito development mailing list
Ok... could you please share a link to your repo so I can test your full example?

El dia dimecres, 15 de setembre de 2021 a les 15:13:29 UTC+2, Diogo va escriure:

Diogo

unread,
Sep 15, 2021, 10:30:43 AM9/15/21
to Kogito development mailing list
Sure, here it is a link to the repo containing the docker-compose file that I'm trying to run and a simple kogito project:
Thank you very much for your help.

Best regards,
Diogo

Pere Fernandez

unread,
Sep 21, 2021, 11:52:42 AM9/21/21
to kogito-de...@googlegroups.com
Hey Diogo,

the problem is on your docker-compose, you are missing a /graphql at the end of your KOGITO_DATAINDEX_HTTP_URL environment. It should be like:

      KOGITO_DATAINDEX_HTTP_URL: http://${DOCKER_GATEWAY_HOST}:8180/graphql

I think you may copy this yml from an old version where we had that issue too :D

Cheers!


--
You received this message because you are subscribed to the Google Groups "Kogito development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kogito-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kogito-development/bf0131c1-e08d-4122-9f69-109eca63f18dn%40googlegroups.com.

nmir...@redhat.com

unread,
Sep 21, 2021, 6:03:55 PM9/21/21
to Kogito development mailing list
Hi Diogo,

I have been trying your example and I some configuration fixes that  make your example run. Here the changes:

  • DOCKER_GATEWAY_HOST=172.17.0.1 (in case you are using linux) This is needed as space to communication between containers, regarding using localhost could be search inside the container (I changed the .env and added .startServices.sh to set that in other cases)
  • Added the '/graphql' as Pere suggested to let the management console find the dataindex endpoint.
  • Added some dependences to use events
  • Added some properties to application.properties like the 'kogito.persistence.type' and event related configuration
  • Finally I've replaced the test.SVG by an export of the process to svg

Here the PR with this changes: https://github.com/diogomvasconcelos/management-console-debug/pull/1

This fixes work for me, I hope this helps! Let me know how  it goes

Neus.

Diogo

unread,
Sep 22, 2021, 6:52:18 AM9/22/21
to Kogito development mailing list
Hi Neus and Pere,

Thanks a lot for all your help! I can now run everything as excepted, the managament-console already works and is showing up every process running in the moment.

Best Regards,
Diogo

Pere Fernandez

unread,
Sep 22, 2021, 6:58:54 AM9/22/21
to kogito-de...@googlegroups.com
yay!

Thank you Neus to fix the data-index configuration, will be taking a look carefully to use it on a example :D


Diogo

unread,
Sep 22, 2021, 7:09:10 AM9/22/21
to Kogito development mailing list
Just a opinion ;), but I think you could have an example using kogito-data-index-postgresql, because I right now every example is using the infinispan instead. :)

Thanks again for the help 
Reply all
Reply to author
Forward
0 new messages