Skip to content

Commit 70cceb4

Browse files
Marketenclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 289a8cd commit 70cceb4

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎scripts/dappnode_install.sh‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,17 @@ normalize_ipfs_version_ref() {
428428
local cid_path="$ref"
429429
local manifest_url="${IPFS_ENDPOINT%/}${cid_path}/dappnode_package.json"
430430
local manifest
431-
manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)"
431+
# On the first boot after an ISO install this runs from rc.local, which
432+
# does not wait for DHCP (Debian's allow-hotplug interfaces are not part
433+
# of network-online.target), so give the network up to ~2 minutes.
434+
local attempt
435+
for attempt in $(seq 1 24); do
436+
manifest="$(download_stdout "$manifest_url" 2>/dev/null || true)"
437+
[[ -n "$manifest" ]] && break
438+
# stdout is this function's return value, so report on stderr
439+
[[ "$attempt" -eq 1 ]] && warn "Could not fetch IPFS manifest for ${comp} yet, retrying..." >&2
440+
[[ "$attempt" -lt 24 ]] && sleep 5
441+
done
432442
if [[ -z "$manifest" ]]; then
433443
error "Could not fetch IPFS manifest for ${comp} from: $manifest_url"
434444
error "Provide ${comp}_VERSION as /ipfs/<cid>:<version> (example: /ipfs/Qm...:0.2.11)"

0 commit comments

Comments
 (0)