Skip to content

CKS: removeNodesFromKubernetesCluster throws NPE when the node VM has no display name #14789

Open

Description

@bhouse-nexthop

Problem

removeNodesFromKubernetesCluster fails with a NullPointerException when the node VM has no display name.

Where KubernetesClusterRemoveWorker.removeNodesFromCluster
Code vm.getDisplayName().toLowerCase(Locale.ROOT)
Trigger VM deployed without displayname (NULL in the DB), then added with addNodesToKubernetesCluster
Why it's confusing the API shows the host name as a fallback display name, so the user sees a name
Result node is not drained or deleted, the call fails, the log shows only the NPE

Steps to reproduce

  1. Deploy a VM without displayname.
  2. Add it to a CKS cluster with addNodesToKubernetesCluster.
  3. Remove it with removeNodesFromKubernetesCluster.

Expected

The node is drained and removed.

Also

  • The display name isn't the Kubernetes node name anyway. The kubelet registers under the guest host name, which is what the scale and upgrade workers use. A user-changed display name points the script at a node that doesn't exist.
  • taintControlNodes has the same getDisplayName().toLowerCase() lookup.

Versions

4.22 and main.

Activity

  1. github-actions commented on Nov 30, 2026

    @github-actions

    Warning

    threat detection engine error
    The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

    What happened

    The threat detection engine failed to produce results.

    Review the workflow run logs for details.

    🎯 Triage report

    removeNodesFromKubernetesCluster throws a NullPointerException when the node VM has no display name. KubernetesClusterRemoveWorker.removeNodesFromCluster calls getDisplayName().toLowerCase(...), so the node is not drained or deleted and the log shows only the NPE. The reporter also says the Kubernetes node name is the guest host name, not the display name, so the lookup is wrong even when it does not throw. taintControlNodes has the same pattern.

    📊 Assessment

    Dimension Value Reasoning
    Type type:bug NPE in the remove path, with reproduction steps
    Component component:cks KubernetesClusterRemoveWorker
    Severity Severity:Major A node added without a display name cannot be removed
    Labels type:bug, component:cks, Severity:Major Based on the issue text
    Coding agent Suitable Fix direction given: look up the node by guest host name, as scale and upgrade already do

    🔗 Similar issues

    💡 Notes and suggestions
    • Reproduction: deploy a VM without displayname, add it with addNodesToKubernetesCluster, then remove it.
    • Check taintControlNodes as well as the remove path.

    Generated by Daily Issue Triage · copilot · haiku55 · ~8 AIC · ⊞ 3.8K · ◷

    Add this agentic workflow to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/daily-issue-triage.md@139fa09ef17cde4135e696ff8e7af09bc5ddfa6e
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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