From a9908597458c8807f976ac21b56b74d81400e9f5 Mon Sep 17 00:00:00 2001 From: archipelago Date: Thu, 23 Apr 2026 09:29:15 -0400 Subject: [PATCH] fix(image-versions): locate image-versions.sh at its actual deployed path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Rust search path listed /opt/archipelago/image-versions.sh and scripts/image-versions.sh (repo-relative for dev), but the image recipe deploys the file to /opt/archipelago/scripts/image-versions.sh. Production nodes therefore silently failed every lookup: find_file returned None, load_image_versions returned an empty HashMap, and both pinned_image_for_app and pinned_images_for_stack returned no matches. Symptom on deployed nodes: every container scan emitted "image-versions.sh not found in any search path" at DEBUG level, and the version-comparison logic in docker_packages.rs plus the update-check logic in api/rpc/package/update.rs silently degraded to no-op — users would not see update-available badges and upgrade RPCs could not resolve pinned targets. Fix: put the canonical deployed path first in PATHS, keep the older /opt/archipelago/image-versions.sh as a fallback for not-yet-updated nodes, and retain scripts/image-versions.sh as the dev-repo-relative fallback. Verified on .228: backend now logs "Parsed 57 image versions from /opt/archipelago/scripts/image-versions.sh" on scan. Pre-existing test_parse_image_versions failure in this module is unrelated (the NOT_AN_IMAGE assertion was broken before this change because the parser's _IMAGE-suffix retain keeps it). Leaving that for the general cargo-test cleanup pass. --- core/archipelago/src/container/image_versions.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/archipelago/src/container/image_versions.rs b/core/archipelago/src/container/image_versions.rs index 03b22866..23f4dc6a 100644 --- a/core/archipelago/src/container/image_versions.rs +++ b/core/archipelago/src/container/image_versions.rs @@ -1,8 +1,8 @@ //! Parser for image-versions.sh — single source of truth for pinned container images. //! -//! Reads the deployed file at /opt/archipelago/image-versions.sh (or the repo-local -//! scripts/image-versions.sh as fallback) and exposes lookup functions so the container -//! scanner can compare running images against pinned targets. +//! Reads the deployed file at /opt/archipelago/scripts/image-versions.sh (the canonical +//! location installed by the image-recipe) with fallbacks for older layouts and the +//! repo-local scripts/image-versions.sh for development runs from the repo root. use std::collections::HashMap; use std::path::Path; @@ -18,8 +18,13 @@ struct CacheEntry { images: HashMap, } -/// File search order — production path first, then repo-local for dev. +/// File search order — canonical production path first, older layout second, +/// repo-local for dev last. The canonical deployed path is +/// /opt/archipelago/scripts/image-versions.sh; earlier builds put it directly +/// in /opt/archipelago/, so that path is kept as a fallback for not-yet-updated +/// nodes. The repo-relative entry matches `cargo run` from the repo root. const PATHS: &[&str] = &[ + "/opt/archipelago/scripts/image-versions.sh", "/opt/archipelago/image-versions.sh", "scripts/image-versions.sh", ];