santifer/career-ops · error · Error
Apify actor finished with status
Error message
Apify actor ${actorId} finished with status ${run.status}${reason} What it means
After waiting for an Apify actor run, runActor requires the run's final status to be exactly 'SUCCEEDED'. Any other terminal status (FAILED, ABORTED, TIMED-OUT, etc.) throws this error, appending the run's statusMessage when present.
Solutions
- Read the appended statusMessage and the run details in the Apify console to see the failure reason.
- Fix the actor input (validate required fields the actor expects).
- Increase timeoutMs / actor run timeout if the run is being killed early.
- Retry the run — transient platform or memory issues often resolve.
- Check Apify account usage/billing if runs are aborted for credit exhaustion.
Example fix
// before
const items = await runActor('user/actor', { bad: true }, { timeoutMs: 60000 });
// after
try {
const items = await runActor('user/actor', validatedInput, { timeoutMs: 120000 });
} catch (e) {
if (e.message.includes('finished with status')) console.error('Actor failed:', e.message);
throw e;
} Defensive patterns
Strategy: try-catch
Try / catch
try {
const items = await runActor(actorId, input, { timeoutMs: 120000 });
} catch (e) {
const m = String(e.message);
if (m.includes('finished with status')) {
const status = m.match(/status (\S+)/)?.[1];
if (status === 'TIMED-OUT') return retryWithLongerTimeout();
if (status === 'ABORTED' || status === 'FAILED') console.error('Actor failed:', m);
}
throw e;
} Prevention
- Validate actor input against the actor's input schema before running.
- Set timeoutMs generously relative to expected actor runtime.
- Monitor Apify account usage to avoid credit-exhaustion aborts.
- Retry transient statuses (ABORTED/TIMED-OUT) with backoff.
When it happens
Trigger: The actor run ends with status FAILED (actor crashed), ABORTED (manually or by timeout), TIMED-OUT, or any non-SUCCEEDED status returned by waitForRun.
Common situations: Actor input is invalid so the actor fails at startup; actor hits a memory limit and crashes; Apify platform aborts the run because it exceeded the run timeout; actor code itself throws; account out of Apify credit so run is aborted.
Related errors
- Apify did not return a run id
- Apify run returned non-array dataset payload
- 4dayweek: unexpected API response on page
- a16z-speedrun-talent: unexpected API response on page
- agentic-jobs: parsed 0 jobs from the API — the response…
AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16).
Data as JSON: /api/errors/a434332173cc5c16.
Report an issue: GitHub.
Appendix: source
Thrown at plugins/apify/_apify.mjs:199
if (!Array.isArray(items)) {
throw new Error(`Apify run ${runId} returned non-array dataset payload`);
}
return items;
}
export async function runActor(actorId, input, { timeoutMs = DEFAULT_RUN_TIMEOUT_MS, token = process.env.APIFY_TOKEN } = {}) {
if (!token) throw new Error('APIFY_TOKEN not set');
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
throw new Error(`apify: invalid timeoutMs ${JSON.stringify(timeoutMs)} (must be a positive finite number of milliseconds)`);
}
// Single deadline shared across startRun → waitForRun → fetchDatasetItems so
// the caller's timeoutMs is the end-to-end ceiling, not just the wait loop.
const deadline = Date.now() + timeoutMs;
const runId = await startRun(actorId, input, token, deadline);
const run = await waitForRun(runId, token, deadline, timeoutMs);
if (run.status !== 'SUCCEEDED') {
const reason = run.statusMessage ? `: ${run.statusMessage}` : '';
throw new Error(`Apify actor ${actorId} finished with status ${run.status}${reason}`);
}
return await fetchDatasetItems(runId, token, deadline);
}
View on GitHub (pinned to aac998c7ed)