Skip to content

Bug: nodes.hostname stores display names, not actual hostnames #1814

@mrveiss

Description

@mrveiss

Problem

The nodes.hostname column in the PostgreSQL nodes table stores human-readable display names (e.g., 00-SLM-Manager, 01-Backend) rather than actual OS hostnames (autobot-slm, MV-Stealth) or Ansible inventory hostnames (autobot-slm, autobot-host).

This caused the entire System Updates feature to silently fail (#1789) because code assumed hostname was an actual hostname usable for Ansible --limit and host resolution.

Current state

node_id DB hostname (display) OS hostname Ansible inventory name
00-SLM-Manager 00-SLM-Manager autobot-slm autobot-slm
01-Backend 01-Backend MV-Stealth autobot-host
02-Frontend 02-Frontend 01-Backend autobot-frontend
npu-worker npu-worker npu-worker autobot-npu
04-Databases 03-Databases 03-Databases autobot-database
03-AI-Stack 04-AI-Stack 04-AI-Stack autobot-aiml
browser-automation 05-browser-automation 05-browser-automation autobot-browser

Impact

Any code that uses Node.hostname expecting an actual hostname will break. The workaround in #1789 (inventory parsing + IP fallback) is fragile. Other subsystems (deployments, health checks, etc.) that build Ansible commands from Node.hostname may have the same latent bug.

Proposed fix

Add ansible_name column to nodes table, populated from the inventory during enrollment. Keep hostname as a display name but rename to display_name for clarity. Audit all callers of Node.hostname.

Discovered During

Working on #1789

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions