Skip to content

[DNM] Fix panic when sorting non-SQL lists by a boolean field (rancher/rancher#55593)#1235

Open
rohitsakala wants to merge 1 commit into
rancher:mainfrom
rohitsakala:fix-55593-sort-bool-panic
Open

[DNM] Fix panic when sorting non-SQL lists by a boolean field (rancher/rancher#55593)#1235
rohitsakala wants to merge 1 commit into
rancher:mainfrom
rohitsakala:fix-55593-sort-bool-panic

Conversation

@rohitsakala

@rohitsakala rohitsakala commented Jul 10, 2026

Copy link
Copy Markdown
Member

Problem

Sorting a non-SQL list by a boolean field panics and kills the request handler, so Cluster Explorer renders blank:

http: panic serving ...: interface conversion: interface {} is bool, not string
    listprocessor.SortList(...) processor.go:383

Cause

SortList did an unchecked val.(string) on values from data.GetValueFromAny, but sortable fields aren't always strings — e.g. metadata.state.error (a bool, behind the dashboard's State column). Regressed in #618, which dropped the earlier convert.ToString(...). Non-SQL path only; the SQL cache sorts via ORDER BY.

Fix

Restore convert.ToString(val); add a TestSortList regression case for boolean/missing fields.

Fixes rancher/rancher#55593

@rohitsakala rohitsakala force-pushed the fix-55593-sort-bool-panic branch from b650be7 to 7b71c9a Compare July 10, 2026 19:01
@rohitsakala rohitsakala marked this pull request as ready for review July 13, 2026 20:19
@rohitsakala rohitsakala requested a review from a team as a code owner July 13, 2026 20:19
@rohitsakala rohitsakala marked this pull request as draft July 13, 2026 20:19
@rohitsakala rohitsakala marked this pull request as ready for review July 14, 2026 05:21
@rohitsakala rohitsakala changed the title Fix panic when sorting non-SQL lists by a boolean field (rancher/rancher#55593) [DNM] Fix panic when sorting non-SQL lists by a boolean field (rancher/rancher#55593) Jul 14, 2026

@crobby crobby left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

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.

[BUG] Steve panics with "interface conversion: interface {} is bool, not string" when sorting a list by a boolean field (metadata.state)

3 participants