oven-sh/bun · error · Error
[azure] Operation timed out after ${maxWaitMs}ms
Error message
[azure] Operation timed out after ${maxWaitMs}ms What it means
waitForOperation() polled the Azure async operation every 5 seconds but it never reached Succeeded/Failed/Canceled within maxWaitMs (default 3_600_000 ms = 1 hour). The operation is still officially in progress; the script simply stopped waiting.
Source
Thrown at scripts/azure.mjs:184
}
if (!response.ok) {
throw new Error(`[azure] Operation poll failed: ${response.status} ${await response.text()}`);
}
const data = await response.json();
if (data.status === "Succeeded") {
return data.properties?.output ?? data;
}
if (data.status === "Failed" || data.status === "Canceled") {
throw new Error(`[azure] Operation ${data.status}: ${data.error?.message ?? "unknown"}`);
}
await new Promise(r => setTimeout(r, 5000));
}
throw new Error(`[azure] Operation timed out after ${maxWaitMs}ms`);
}
// ============================================================================
// Resource helpers
// ============================================================================
function rgPath() {
const { subscriptionId, resourceGroup } = config();
return `/subscriptions/${subscriptionId}/resourceGroups/${resourceGroup}`;
}
// ============================================================================
// Public IP
// ============================================================================
async function createPublicIp(name) {
const { location } = config();
console.log(`[azure] Creating public IP: ${name}`);View on GitHub (pinned to 8c5296ac45)
Solutions
- Check the operation status in the Azure portal — it may still succeed; re-run only the wait, not the operation
- Pass a larger maxWaitMs to waitForOperation for replication-heavy operations
- Reduce the operation's scope (fewer target regions) to fit the window
- If status is stuck, cancel and resubmit the operation
Example fix
// before await waitForOperation(operationUrl); // default 1h cap // after await waitForOperation(operationUrl, 7_200_000); // 2h for multi-region replication
Defensive patterns
Strategy: retry
Validate before calling
null
Prevention
- Size maxWaitMs to the operation: multi-region image replication needs well over the 1h default
- Check the operation in the portal before resubmitting — it often still succeeds
- Alert on near-timeout polls so slow operations are caught before the cap
When it happens
Trigger: Very slow operations: image version replication across many regions, large disk/VM operations; Azure throttling the poll loop; an operation genuinely stuck in a non-terminal state.
Common situations: SIG/VM image replication target lists grew past an hour; Azure degradation slowing provisioning; default maxWaitMs no longer matching the workload.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- [azure] Operation poll failed after ${fetchErrors} fetch err
- [azure] Operation poll failed: ${response.status} ${await re
- [azure] Operation ${data.status}: ${data.error?.message ?? "
- Azure secret not found: ${name}
- [azure] Auth failed: ${response.status} ${await response.tex
AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16).
Data as JSON: /api/errors/3603b1b85be03a45.
Report an issue: GitHub.