Skip to content

Commit c0677ca

Browse files
committed
Merge branch 'marc/fix-firstboot-ipfs-manifest-race' into tmp/e2e-fix-check
2 parents 20d47f4 + 70cceb4 commit c0677ca

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)