Skip to content

Can't type in web UI Vector Search or Assistant - Error: TypeError: Cannot read properties of undefined (reading 'map')Β #495

@hdotking-materra

Description

@hdotking-materra

UI search fails (TypeError: Cannot read properties of undefined (reading 'map')) and tg-show-graph returns no output

Image

Summary

  • Submitting text in Vector Search or Assistant in Workbench UI errors with:

    TypeError: Cannot read properties of undefined (reading 'map')

  • CLI graph inspection returns no output:

    tg-show-graph
    # (nothing prints)
  • Processors are healthy, flows look correct, and sample documents download + submit successfully.

Environment

  • macOS Sequoia 15.5 (24F74) (Apple Silicon)
  • Docker Desktop (Linux VM kernel in logs: 6.10.14-linuxkit)
  • Compose images (from docker-compose.yaml):
    • trustgraph-flow:1.2.20
    • trustgraph-mcp:1.2.20
    • workbench-ui:1.0.6
    • apachepulsar/pulsar:4.0.5
    • cassandra:4.1.9
    • qdrant:v1.14.1
    • minio:RELEASE.2025-06-13T11-33-47Z
    • prom/prometheus:v2.53.5
    • grafana:12.0.2
  • CLI
    • uv installed
    • trustgraph-cli==1.3.9 (installed via uv tool install and also tested with uvx --from trustgraph-cli …)
    • trustgraph-base==1.3.9
  • TrustGraph version: 0.18.14

What works

Processors are healthy:

tg-show-processor-state
chunker                        πŸ’š
metering                       πŸ’š
text-completion-rag            πŸ’š
text-completion                πŸ’š
kg-store                       πŸ’š
kg-extract-relationships       πŸ’š
store-triples                  πŸ’š
kg-extract-definitions         πŸ’š
kg-manager                     πŸ’š
query-triples                  πŸ’š
config-svc                     πŸ’š
pdf-decoder                    πŸ’š
metering-rag                   πŸ’š
graph-rag                      πŸ’š
embeddings                     πŸ’š
store-graph-embeddings         πŸ’š

Flows present:

tg-show-flows
+-------+------------------------------------------------------------+
| id    | default                                                    |
| class | document-rag+graph-rag                                     |
| desc  | Default processing flow                                    |
| queue | document-load: persistent://tg/flow/document-load:default  |
|       | text-load: persistent://tg/flow/text-document-load:default |
+-------+------------------------------------------------------------+

Sample documents load & submit successfully:

tg-load-sample-documents (excerpt)
Report of the Presidential Commission on the Space Shuttle Challenger Accident, Volume 1 :
  downloading... done. adding... successful.
A Concise Dictionary of Old Icelandic :
  downloading... done. adding... successful.
Annual threat assessment of the U.S. intelligence community - March 2025 :
  downloading... done. adding... successful.
The Role of Intelligence and State Policies in International Security :
  downloading... done. adding... successful.
Beyond the vigilant state: globalisation and intelligence :
  downloading... done. adding... successful.

What doesn’t work

  • CLI: tg-show-graph prints no output.

  • UI: Typing in Vector Search or Assistant throws a frontend runtime error:

    Error: TypeError: Cannot read properties of undefined (reading 'map')
    
Screenshot Image

Steps to reproduce

  1. Start the stack with the compose file pinning the images listed above (Pulsar, Cassandra, Qdrant, MinIO, Prometheus, Grafana, Workbench UI, TrustGraph services).
  2. Install CLI (either of the below reproduces):
    • uv tool install trustgraph-cli then tg-show-processor-state
    • or uvx --from trustgraph-cli tg-show-processor-state
  3. Load sample docs: tg-load-sample-documents.
  4. Open Workbench UI at http://localhost:8888.
  5. Go to Vector Search or Assistant, type any query β†’ observe error.
  6. In a terminal, run tg-show-graph β†’ observe no output.

Expected behaviour

  • tg-show-graph prints triples / graph contents.
  • UI search panes return results (or at minimum, no crash if results are empty), i.e., graceful handling with an empty list.

Actual behaviour

  • tg-show-graph prints nothing.
  • UI shows TypeError: Cannot read properties of undefined (reading 'map') on query submission.

Additional diagnostics

  • Gateway /metrics responds (Prometheus scraping OK).
  • Broker and services report healthy in CLI.
  • Available to provide on request:
    • API Gateway logs around the failing UI requests
    • Browser DevTools β†’ Network response payload for the failing search call
    • Frontend console stack trace
    • tg-show-library-processing output
    • Cassandra counts (e.g., triples_by_subject)

Apple Silicon (arm64) note

On macOS (M-series), I hit architecture mismatches when pulling/running some images
(e.g. errors like no matching manifest for linux/arm64/v8 or exec format error).

Workaround I used: force linux/amd64 for the images that don’t publish arm64 builds by adding
a docker-compose.override.yaml:

# docker-compose.override.yaml
# Define an anchor for the amd64 platform once, then merge it into each TG service.
x-amd64: &amd64 { platform: linux/amd64 }

services:
  agent-manager:
    <<: *amd64
  api-gateway:
    <<: *amd64
  chunker:
    <<: *amd64
  config-svc:
    <<: *amd64
  document-embeddings:
    <<: *amd64
  document-rag:
    <<: *amd64
  embeddings:
    <<: *amd64
  graph-embeddings:
    <<: *amd64
  graph-rag:
    <<: *amd64
  init-trustgraph:
    <<: *amd64
  kg-extract-agent:
    <<: *amd64
  kg-extract-definitions:
    <<: *amd64
  kg-extract-objects:
    <<: *amd64
  kg-extract-relationships:
    <<: *amd64
  kg-manager:
    <<: *amd64
  kg-store:
    <<: *amd64
  librarian:
    <<: *amd64
  mcp-tool:
    <<: *amd64
  metering:
    <<: *amd64
  metering-rag:
    <<: *amd64
  pdf-decoder:
    <<: *amd64
  prompt:
    <<: *amd64
  prompt-rag:
    <<: *amd64
  query-doc-embeddings:
    <<: *amd64
  query-graph-embeddings:
    <<: *amd64
  query-triples:
    <<: *amd64
  store-doc-embeddings:
    <<: *amd64
  store-graph-embeddings:
    <<: *amd64
  store-objects:
    <<: *amd64
  store-triples:
    <<: *amd64
  text-completion:
    <<: *amd64
  text-completion-rag:
    <<: *amd64
  workbench-ui:
    <<: *amd64
  mcp-server:
    <<: *amd64

Notes:

  • In Docker Desktop, I also enabled Settings β†’ Features in development β†’ β€œUse Rosetta for x86/amd64 emulation on Apple Silicon” (when available).
  • You can verify image architecture with:
    • docker buildx imagetools inspect <image:tag>
    • docker image inspect --format '{{.Architecture}}' <image:tag>
  • For services that do have arm64 images, don’t force amd64β€”running natively is faster.

Hypotheses (to help triage)

  • UI expects a field that’s undefined when the API returns an empty or error payload (e.g., results.map(...) on undefined). A null/empty-state guard may be missing.
  • Version mismatch: UI workbench-ui:1.0.6, services trustgraph-flow:1.2.20, CLI 1.3.9. If the API response schema changed between these, the UI could be mapping a field that the gateway/service no longer returns (or returns under a different key).
  • Graph not populated: if KG extraction completed but storage/query path isn’t wiring correctly, tg-show-graph would be empty and UI vector search could receive an unexpected/empty shape from the gateway.

What would help me move forward

  • Confirm the expected API response shape for Vector Search / Assistant endpoints that the UI is mapping over (field names/types).
  • Confirm compatible versions matrix between workbench-ui, trustgraph-flow, and trustgraph-cli.
  • Guidance on verifying KG population (which tables/collections to inspect for triples/embeddings, and which service logs to tail during a search).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions