Skip to content

ui: fix crash on debug hot ranges page#162613

Open
dhartunian wants to merge 1 commit intocockroachdb:masterfrom
dhartunian:davidh/push-vnwsszouoqss
Open

ui: fix crash on debug hot ranges page#162613
dhartunian wants to merge 1 commit intocockroachdb:masterfrom
dhartunian:davidh/push-vnwsszouoqss

Conversation

@dhartunian
Copy link
Collaborator

The debug hot ranges page at /#/debug/hotranges crashed on load with TypeError: Cannot read properties of undefined (reading 'length'). When no node_id URL parameter was present, nodeId was undefined, causing nodes: [undefined] to be passed to the HotRangesRequest protobuf constructor. The protobuf encoder then tried to compute the UTF-8 length of undefined, which has no .length property.

The fix filters out the undefined value by using an empty array when nodeId is not set, which correctly requests hot ranges for all nodes.

The top ranges page at /#/topranges does not have this bug because it guards with if (filters.nodeIds.length > 0) before constructing the request.

Fixes: #160556

Release note: None
Epic: None

The debug hot ranges page at /#/debug/hotranges crashed on load with
`TypeError: Cannot read properties of undefined (reading 'length')`.
When no `node_id` URL parameter was present, `nodeId` was `undefined`,
causing `nodes: [undefined]` to be passed to the HotRangesRequest
protobuf constructor. The protobuf encoder then tried to compute the
UTF-8 length of `undefined`, which has no `.length` property.

The fix filters out the undefined value by using an empty array when
`nodeId` is not set, which correctly requests hot ranges for all nodes.

The top ranges page at /#/topranges does not have this bug because it
guards with `if (filters.nodeIds.length > 0)` before constructing the
request.

Fixes: cockroachdb#160556

Release note: None
Epic: None
@dhartunian dhartunian requested a review from a team as a code owner February 6, 2026 21:54
@trunk-io
Copy link
Contributor

trunk-io bot commented Feb 6, 2026

Merging to master in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db-console: page crash on hot ranges page during scale test

2 participants