Supersedes the original self-match-only fix in this branch.
variables.nix's deployedTargets was a manually-maintained list with no enforcement keeping it in sync with reality. It caused two consecutive false refusals in this session: naming proxmox-nix-cache as deployed well after that VM had been destroyed (#5 fixed by repointing it at lxc-nix-cache), then refusing lxc-nix-cache creation by matching it against itself once the list said that was the real deployment.
create-proxmox-resource.sh's duplicate-host guard now queries the Proxmox node directly (qm/pct's own name/hostname config, matched against --host) instead of any file in this repo. Also fixes a gap in that live check found during review: it originally swallowed ssh failures and would have silently treated "cannot reach the node" the same as "checked, nothing there" -- it now refuses instead of guessing when the node is unreachable.
deployedTargets is removed entirely from variables.nix since nothing else in the repo consumed it once this script no longer does. README's Hosts table remains the sole source of truth for "(real, deployed)" annotations. CLAUDE.md and the script's own --help/comments updated to match.
Validated with the full codex-maintenance.sh sweep (all 18 hosts eval, nixpkgs-fmt/statix clean) plus the script's own --dry-run.
Supersedes the original self-match-only fix in this branch.
variables.nix's deployedTargets was a manually-maintained list with no enforcement keeping it in sync with reality. It caused two consecutive false refusals in this session: naming proxmox-nix-cache as deployed well after that VM had been destroyed (#5 fixed by repointing it at lxc-nix-cache), then refusing lxc-nix-cache creation by matching it against itself once the list said *that* was the real deployment.
create-proxmox-resource.sh's duplicate-host guard now queries the Proxmox node directly (qm/pct's own name/hostname config, matched against --host) instead of any file in this repo. Also fixes a gap in that live check found during review: it originally swallowed ssh failures and would have silently treated "cannot reach the node" the same as "checked, nothing there" -- it now refuses instead of guessing when the node is unreachable.
deployedTargets is removed entirely from variables.nix since nothing else in the repo consumed it once this script no longer does. README's Hosts table remains the sole source of truth for "(real, deployed)" annotations. CLAUDE.md and the script's own --help/comments updated to match.
Validated with the full codex-maintenance.sh sweep (all 18 hosts eval, nixpkgs-fmt/statix clean) plus the script's own --dry-run.
The duplicate-host check in create-proxmox-resource.sh compared by
hostName only, so it fired even when the target being created was
exactly the one variables.nix's deployedTargets already names (e.g.
rebuilding lxc-nix-cache after destroying its old container to pick up
new sops secrets) -- there's no other machine at risk of an identity
collision in that case, just the normal redeploy workflow. Skip the
check when dt == flake_target; the later VMID-existence check still
guards against clobbering a resource that's actually live on the node.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
variables.nix's deployedTargets was a manually-maintained list with no
enforcement keeping it in sync with reality -- it caused two separate
false refusals in a row (naming a VM as deployed well after it had been
destroyed, then matching a target against itself once the list was
"corrected"). Static files can't track whether a resource still actually
exists.
create-proxmox-resource.sh's duplicate-host guard now queries the
Proxmox node directly (qm/pct's own name/hostname config, matched
against --host) instead. Also fixes a gap in that live check: it
originally swallowed ssh failures and would have silently treated "can't
reach the node" the same as "checked, nothing there" -- it now refuses
instead of guessing when the node can't be reached.
deployedTargets is removed entirely from variables.nix since nothing
else in the repo consumed it once this script no longer does; README.md's
Hosts table remains the sole source of truth for "(real, deployed)"
status. CLAUDE.md and the script's own --help/comments updated to match.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
beatzaplenty
changed title from Fix duplicate-host check refusing to recreate the canonical deployed target itself to Replace duplicate-host check with live Proxmox query; drop deployedTargets2026-07-20 10:03:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Supersedes the original self-match-only fix in this branch.
variables.nix's deployedTargets was a manually-maintained list with no enforcement keeping it in sync with reality. It caused two consecutive false refusals in this session: naming proxmox-nix-cache as deployed well after that VM had been destroyed (#5 fixed by repointing it at lxc-nix-cache), then refusing lxc-nix-cache creation by matching it against itself once the list said that was the real deployment.
create-proxmox-resource.sh's duplicate-host guard now queries the Proxmox node directly (qm/pct's own name/hostname config, matched against --host) instead of any file in this repo. Also fixes a gap in that live check found during review: it originally swallowed ssh failures and would have silently treated "cannot reach the node" the same as "checked, nothing there" -- it now refuses instead of guessing when the node is unreachable.
deployedTargets is removed entirely from variables.nix since nothing else in the repo consumed it once this script no longer does. README's Hosts table remains the sole source of truth for "(real, deployed)" annotations. CLAUDE.md and the script's own --help/comments updated to match.
Validated with the full codex-maintenance.sh sweep (all 18 hosts eval, nixpkgs-fmt/statix clean) plus the script's own --dry-run.
Fix duplicate-host check refusing to recreate the canonical deployed target itselfto Replace duplicate-host check with live Proxmox query; drop deployedTargets