Skip to content

Frontend crash when clicking log row in dashboard list panel #10815

@tbachlechner

Description

@tbachlechner

title: "Frontend crash when clicking log row in dashboard list panel"
labels: bug

Description

Clicking on a log row in a dashboard list panel crashes the SigNoz frontend with "Something went wrong :/". This happens on both main (v0.117.1-dev) and v0.116.1 (latest stable release).

Error Details

Console error:

TypeError: undefined is not an object (evaluating 'Object.keys(e)')

Stack trace:

keys — utils.ts:37
Vt — useInitialQuery.ts:12
Yt — index.tsx:72
Blackboxed — 9 call frames
(anonymous function) — useActiveLog.ts:89
(anonymous function) — useLogDetailHandlers.ts:44
onClick — LogsPanelComponent.tsx:106
C — useRowInfo.js:38

Console warnings (repeated 3x before crash):

aggregateData is null in baseAggregateOptionsConfig

Steps to Reproduce

  1. Create a dashboard via API (POST /api/v1/dashboards) with a list panel for logs
  2. Use Query Builder V5 format:
    {
      "panelTypes": "list",
      "query": {
        "queryType": "builder",
        "builder": {
          "queryData": [{
            "queryName": "A",
            "dataSource": "logs",
            "expression": "A",
            "aggregations": [{"expression": "count()"}],
            "orderBy": [
              {"columnName": "timestamp", "order": "desc"},
              {"columnName": "id", "order": "desc"}
            ],
            "pageSize": 10,
            "selectColumns": [
              {"name": "timestamp", "fieldContext": "log", "signal": "logs"},
              {"name": "body", "fieldContext": "log", "signal": "logs"}
            ]
          }],
          "queryFormulas": []
        }
      }
    }
  3. View the dashboard — logs render correctly in the list
  4. Click on any log row
  5. Frontend crashes with "Something went wrong :/"

Expected Behavior

Clicking a log row should open the log detail view, same as clicking a log in the Logs explorer page.

Actual Behavior

Frontend crashes. The useLogDetailHandlers hook (line 44) calls a function that invokes Object.keys() on undefined data. The root cause appears to be that aggregateData is null in baseAggregateOptionsConfig — the list panel's query configuration doesn't populate the aggregate data structure that the log detail click handler expects.

Environment

  • SigNoz version: Tested on both v0.116.1 (stable) and main branch (~v0.117.1)
  • Deployment: Self-hosted, docker compose
  • Browser: Safari 18.x (macOS)
  • Dashboard creation method: API (POST /api/v1/dashboards)

Additional Context

  • PR fix: query failing in case of aggregateAttribute is not present #9000 fixed a related issue where missing aggregateAttribute caused query failures in convertAggregationToExpression, but the click-through handler in useLogDetailHandlers.ts still doesn't guard against null/undefined aggregate data.
  • The Logs explorer page (/logs) works perfectly for viewing log details — only the dashboard list panel click handler crashes.
  • Tested with both V5 aggregations format and legacy aggregateOperator format — both trigger the same crash.
  • The aggregateData is null in baseAggregateOptionsConfig warning appears as soon as the dashboard loads (before any click), suggesting the list panel's query response doesn't include the aggregate metadata that baseAggregateOptionsConfig expects.

Suggested Fix

In useLogDetailHandlers.ts around line 44, add a null guard before accessing aggregate data:

// Before (crashes):
Object.keys(aggregateData)

// After (safe):
Object.keys(aggregateData ?? {})

Or more robustly, check if aggregateData exists before attempting to build the log detail query parameters.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions