oven-sh/bun · error · Error

[azure] Operation ${data.status}: ${data.error?.message ?? "

Error message

[azure] Operation ${data.status}: ${data.error?.message ?? "unknown"}

What it means

The polled long-running operation reported a terminal status of 'Failed' or 'Canceled'; Azure's own data.error.message (or 'unknown') is included. The HTTP layer was fine — the underlying Azure operation itself (e.g. an image build or VM deallocation) failed or was canceled on Azure's side.

Source

Thrown at scripts/azure.mjs:178

      if (fetchErrors > 10) {
        throw new Error(`[azure] Operation poll failed after ${fetchErrors} fetch errors`, { cause: err });
      }
      console.warn(`[azure] Operation poll fetch error (${fetchErrors}), retrying...`);
      await new Promise(r => setTimeout(r, 10_000));
      continue;
    }

    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}`;
}

// ============================================================================

View on GitHub (pinned to 8c5296ac45)

Solutions

  1. Read data.error.message in the error text — it names the Azure sub-failure
  2. Check the operation/resource in the Azure portal (Activity Log) for the same correlation
  3. Fix the root cause (quotas, source blob, region) and re-submit the operation
  4. If 'Canceled', find what canceled it before resubmitting

Example fix

// before
if (data.status === 'Failed' || data.status === 'Canceled') {
  throw new Error(`[azure] Operation ${data.status}: ${data.error?.message ?? 'unknown'}`);
}

// after
if (data.status === 'Failed' || data.status === 'Canceled') {
  throw new Error(`[azure] Operation ${data.status}: ${data.error?.message ?? 'unknown'} (code=${data.error?.code ?? 'n/a'})`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

null

Try / catch

try {
  await waitForOperation(operationUrl);
} catch (err) {
  if (/Operation (Failed|Canceled)/.test(err.message)) {
    core.error(`Azure operation ended badly: ${err.message}`);
    await collectDiagnostics(); // activity log, gallery replication status
    throw err;
  }
  throw err;
}

Prevention

When it happens

Trigger: Image build/replication failing inside Azure (source blob missing, region capacity, gallery quota); someone canceled the operation in the portal or via another client; validation failing server-side after acceptance.

Common situations: Shared Image Gallery quota or replication issues; stale source resource referenced by the operation; concurrent pipelines canceling each other's operations.

Related errors


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