console icon indicating copy to clipboard operation
console copied to clipboard

Error in RenderPreview: Cannot read properties of undefined (reading 'length')

Open hadronzoo opened this issue 1 year ago • 5 comments

Redpanda console is failing to render binary keys: image

Here is the relevant docker compose configuration:

services:
  redpanda:
    command:
      - redpanda
      - start
      - --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
      - --advertise-kafka-addr internal://redpanda:9092,external://localhost:19092
      - --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
      - --advertise-pandaproxy-addr internal://redpanda:8082,external://localhost:18082
      - --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
      - --rpc-addr redpanda:33145
      - --advertise-rpc-addr redpanda:33145
      - --mode dev-container
      - --smp 1
    image: docker.redpanda.com/redpandadata/redpanda
    container_name: redpanda
    volumes:
      - redpanda_data:/var/lib/redpanda/data
    ulimits:
      nofile:
        soft: 262144
        hard: 262144
    ports:
      - "18081:18081"
      - "18082:18082"
      - "19092:19092"
      - "19644:9644"
    healthcheck:
      test: redpanda rpk cluster health

  console:
    container_name: redpanda-console
    image: docker.redpanda.com/redpandadata/console
    entrypoint: /bin/sh
    command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'
    environment:
      CONFIG_FILEPATH: /tmp/config.yml
      CONSOLE_CONFIG_FILE: |
        kafka:
          brokers: ["redpanda:9092"]
          schemaRegistry:
            enabled: true
            urls: ["http://redpanda:8081"]
        redpanda:
          adminApi:
            enabled: true
            urls: ["http://redpanda:9644"]
    ports:
      - "8080:8080"
    depends_on:
      - redpanda

volumes:
  redpanda_data:

There is a network error, I suspect because it's running in dev mode and there's no authentication: image

However, I'm not seeing any debug logs on the server when this error occurs. Image versions:

CONTAINER             REPOSITORY                                  TAG                 IMAGE ID            SIZE
redpanda              docker.redpanda.com/redpandadata/redpanda   latest              19c744205ba2        454MB
redpanda-console      docker.redpanda.com/redpandadata/console    latest              d4df82208b7e        280MB

hadronzoo avatar Dec 08 '24 20:12 hadronzoo

Hey, are you able to share the record (key) specifically with us? You can download records via Console, then we can have a look. Feel free to redact other fields.

weeco avatar Dec 09 '24 14:12 weeco

Sure, the key is in the screenshot. It's just a UUID in binary form: cc 2a 79 b8 d2 22 5c 52 b2 8c 9e e0 04 86 16 5e. I've been using Console for years on different projects and I've always seen this error on binary keys and values. Separately, it would be nice to have a UUID deserializer.

hadronzoo avatar Dec 09 '24 17:12 hadronzoo

@hadronzoo Can you use Console's "Download record" feature (click on the dots in the same row of the record to find that option)? This would make it easier to test for us and ensures that the backend actually sends the expected data to the frontend.

Thanks for the report and help

weeco avatar Dec 09 '24 17:12 weeco

I tried that originally but download doesn't do anything.

hadronzoo avatar Dec 09 '24 19:12 hadronzoo

I think this error will occur for all binary keys and payloads.

hadronzoo avatar Dec 14 '24 18:12 hadronzoo