From 70cceb43379ac33d65e707957ea0b4e453733a0f Mon Sep 17 00:00:00 2001 From: Marketen Date: Thu, 8 Oct 2026 14:49:52 +0200 Subject: [PATCH] Wait for the network before fetching IPFS manifests on first boot After an ISO install, dappnode_install.sh runs from rc.local, which does not wait for DHCP: Debian configures the NIC as allow-hotplug, and network-online.target does not wait for those. Fetching the NOTIFICATIONS/PREMIUM manifests, the first network access of an ISO install, could therefore run before the machine had an address and abort the installation with "Could not fetch IPFS manifest". Retry the fetch for up to ~2 minutes before giving up. Co-Authored-By: Claude Opus 5.5 --- scripts/dappnode_install.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/dappnode_install.sh b/scripts/dappnode_install.sh index b9519bc..95bc745 100755 --- a/scripts/dappnode_install.sh +++ b/scripts/dappnode_install.sh @@ -428,7 +428,17 @@ normalize_ipfs_version_ref() { local cid_path="$ref" local manifest_url="${IPFS_ENDPOINT%/}${cid_path}/dappnode_package.json" local manifest - manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)" + # On the first boot after an ISO install this runs from rc.local, which + # does not wait for DHCP (Debian's allow-hotplug interfaces are not part + # of network-online.target), so give the network up to ~2 minutes. + local attempt + for attempt in $(seq 1 24); do + manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)" + [[ -n "$manifest" ]] && break + # stdout is this function's return value, so report on stderr + [[ "$attempt" -eq 1 ]] && warn "Could not fetch IPFS manifest for ${comp} yet, retrying..." >&2 + [[ "$attempt" -lt 24 ]] && sleep 5 + done if [[ -z "$manifest" ]]; then error "Could not fetch IPFS manifest for ${comp} from: $manifest_url" error "Provide ${comp}_VERSION as /ipfs/: (example: /ipfs/Qm...:0.2.11)"