tchiotludo / akhq

Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more...
https://akhq.io/
Apache License 2.0
3.28k stars 637 forks source link

Error retrieving Avro value schema #1573

Open carlosfwrk opened 9 months ago

carlosfwrk commented 9 months ago

Hi, I've noticed that, starting from version 0.23.0, the UI is unable to deserialize the key, while it does so correctly with the value (even though both are serialized in the same way in AVRO). Is it possible that something has broken in the updates? Or is it that I have always been missing something to add to the configuration, and it has been working 'by chance' until now?

This is the error in version 0.23.0, version 0.24.0, and the current dev branch: image

This is how the messages from the same topic look with version 0.22.0 and earlier (and what I expected to come out in later versions): image

These are the logs that appear while loading the messages:

2023-09-15 13:33:24,342 DEBUG -thread-22 org.akhq.utils.Logger      7 ms -> Describe Topics [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:24,342 DEBUG -thread-17 org.akhq.utils.Logger      6 ms -> Describe Topics [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:24,342 DEBUG -thread-21 org.akhq.utils.Logger      8 ms -> Describe Topic Config [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:24,344 INFO  -thread-20 org.akhq.log.access        [Date: 2023-09-15T13:33:24.331208Z] [Duration: 13 ms] [Url: GET /api/kafka-dev/topic/apps.kafkatest.pruebas.event.private.v0.application.cpd/configs] [Status: 200] [Ip: /172.17.0.1] [User: -]
2023-09-15 13:33:24,537 DEBUG -thread-22 org.akhq.utils.Logger      195 ms -> Describe Topics Offsets [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:24,542 DEBUG -thread-17 org.akhq.utils.Logger      200 ms -> Describe Topics Offsets [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:24,543 DEBUG -thread-22 org.akhq.utils.Logger      6 ms -> Get cluster
2023-09-15 13:33:24,543 DEBUG -thread-22 org.akhq.utils.Logger      0 ms -> Get nodes
2023-09-15 13:33:24,543 DEBUG -thread-22 org.akhq.utils.Logger      0 ms -> Get contoller
2023-09-15 13:33:24,547 DEBUG -thread-17 org.akhq.utils.Logger      4 ms -> Get cluster
2023-09-15 13:33:24,548 DEBUG -thread-17 org.akhq.utils.Logger      0 ms -> Get nodes
2023-09-15 13:33:24,548 DEBUG -thread-17 org.akhq.utils.Logger      0 ms -> Get contoller
2023-09-15 13:33:24,552 DEBUG -thread-22 org.akhq.utils.Logger      15 ms -> List Log dir
2023-09-15 13:33:24,559 TRACE -thread-22 o.a.r.RecordRepository     Consume Newest [topic: apps.kafkatest.pruebas.event.private.v0.application.cpd] [partition: 1] [start: 366363]
2023-09-15 13:33:24,559 TRACE -worker-11 o.a.r.RecordRepository     Consume Newest [topic: apps.kafkatest.pruebas.event.private.v0.application.cpd] [partition: 0] [start: 85]
2023-09-15 13:33:24,560 DEBUG -thread-17 org.akhq.utils.Logger      17 ms -> List Log dir
2023-09-15 13:33:24,561 INFO  -thread-20 org.akhq.log.access        [Date: 2023-09-15T13:33:24.335412Z] [Duration: 225 ms] [Url: GET /api/kafka-dev/topic/apps.kafkatest.pruebas.event.private.v0.application.cpd/partitions] [Status: 200] [Ip: /172.17.0.1] [User: -]
2023-09-15 13:33:24,734 TRACE -worker-11 o.a.r.RecordRepository     Empty pool [topic: apps.kafkatest.pruebas.event.private.v0.application.cpd] [partition: 0]
2023-09-15 13:33:24,734 TRACE -worker-11 o.akhq.utils.MaskingUtils  masking record
2023-09-15 13:33:24,803 TRACE -worker-11 o.akhq.utils.MaskingUtils  masking record
2023-09-15 13:33:25,742 DEBUG -thread-22 o.a.r.RecordRepository     1189 ms -> Consume with options [RecordRepository.Options(topic=apps.kafkatest.pruebas.event.private.v0.application.cpd, size=50, after={}, sort=NEWEST, partition=null, timestamp=null)]
2023-09-15 13:33:25,749 DEBUG -thread-22 org.akhq.utils.Logger      7 ms -> Describe Topic Config [apps.kafkatest.pruebas.event.private.v0.application.cpd]
2023-09-15 13:33:25,751 INFO  -thread-20 org.akhq.log.access        [Date: 2023-09-15T13:33:24.33174Z] [Duration: 1419 ms] [Url: GET /api/kafka-dev/topic/apps.kafkatest.pruebas.event.private.v0.application.cpd/data] [Status: 200] [Ip: /172.17.0.1] [User: -]

This is the configuration.yml content:

akhq:
  server:
    access-log:
      enabled: true
      name: org.akhq.log.access
      format: "[Date: {}] [Duration: {} ms] [Url: {} {}] [Status: {}] [Ip: {}] [User: {}]"
  connections:
    kafka-dev:
      properties:
        bootstrap.servers: "bootstrap.kafka.dev.com:443"
        security.protocol: SASL_SSL
        sasl.mechanism: PLAIN
        sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="${USERNAME}" password="${PASSWORD}";
        ssl.truststore.location: /app/ca/cacerts.jks
        ssl.truststore.password: ${TRUSTSTORE_PASSWORD}
      schema-registry:
        url: "https://schemaregistry.dev.com"
        type: "confluent"
        basic-auth-username: ${USERNAME}
        basic-auth-password: ${PASSWORD}
        properties:
          schema.registry.ssl.truststore.location: /app/ca/cacerts.jks
          schema.registry.ssl.truststore.password: ${TRUSTSTORE_PASSWORD}

Thanks.

tchiotludo commented 9 months ago

Can you try with type: "CONFLUENT" please?

carlosfwrk commented 9 months ago

Hi @tchiotludo, I already had the 'type: "confluent"' variable in the schema-registry section, and I have also added it in the properties section, but it still doesn't deserialize the key:

connections:
    kafka-dev:
      properties:
        bootstrap.servers: "bootstrap.kafka.dev.com:443"
        security.protocol: SASL_SSL
        sasl.mechanism: PLAIN
        sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="${USERNAME}" password="${PASSWORD}";
        ssl.truststore.location: /app/ca/cacerts.jks
        ssl.truststore.password: ${TRUSTSTORE_PASSWORD}
        type: "confluent"
      schema-registry:
        url: "https://schemaregistry.dev.com"
        type: "confluent"
        basic-auth-username: ${USERNAME}
        basic-auth-password: ${PASSWORD}
        properties:
          schema.registry.ssl.truststore.location: /app/ca/cacerts.jks
          schema.registry.ssl.truststore.password: ${TRUSTSTORE_PASSWORD}

Thanks.

tchiotludo commented 9 months ago

put confluent upper case please

carlosfwrk commented 9 months ago

Sorry, I didn't understand it the first time. I have now capitalized it, but it still doesn't work: image

carlosfwrk commented 9 months ago

There is no problem in deserializing and visualizing the value schema; however, it throws an error with the key, even though both use the same type of schemas and serialization.