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

  1. Check the operation status in the Azure portal — it may still succeed; re-run only the wait, not the operation
  2. Pass a larger maxWaitMs to waitForOperation for replication-heavy operations
  3. Reduce the operation's scope (fewer target regions) to fit the window
  4. 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

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

Related errors


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/3603b1b85be03a45. Report an issue: GitHub.