diff --git a/dstack/dstack-util/src/system_setup.rs b/dstack/dstack-util/src/system_setup.rs index 6f258d34b..f55a3bcc5 100644 --- a/dstack/dstack-util/src/system_setup.rs +++ b/dstack/dstack-util/src/system_setup.rs @@ -2775,9 +2775,14 @@ impl Stage1<'_> { self.vmm .notify_q("boot.progress", "setting up dstack-gateway") .await; - GatewayContext::new(&self.shared, &self.keys) + if let Err(error) = GatewayContext::new(&self.shared, &self.keys) .setup(true) - .await?; + .await + { + warn!( + "dstack-gateway registration is unavailable during boot; continuing without a route: {error:#}" + ); + } self.vmm .notify_q("boot.progress", "setting up docker") .await; diff --git a/os/common/rootfs/wg-checker.sh b/os/common/rootfs/wg-checker.sh index ba4149472..b81428187 100755 --- a/os/common/rootfs/wg-checker.sh +++ b/os/common/rootfs/wg-checker.sh @@ -6,6 +6,7 @@ HANDSHAKE_TIMEOUT=180 REFRESH_INTERVAL=180 +MISSING_CONFIG_RETRY_INTERVAL=30 LAST_REFRESH=0 STALE_SINCE=0 DSTACK_WORK_DIR=${DSTACK_WORK_DIR:-/dstack} @@ -80,6 +81,10 @@ while true; do check_and_refresh else STALE_SINCE=0 + now=$(date +%s) + if [ "$LAST_REFRESH" -eq 0 ] || [ $((now - LAST_REFRESH)) -ge $MISSING_CONFIG_RETRY_INTERVAL ]; then + do_refresh "$now" "WireGuard configuration missing" 1 + fi fi sleep 10 done