{"record":{"id":"799a969f11698632","repo":"tinyhumansai/openhuman","slug":"apify-run-finished-with-status-status","errorCode":null,"errorMessage":"Apify run finished with status: {status}","messagePattern":"Apify run finished with status: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/learning/linkedin_enrichment.rs","lineNumber":659,"sourceCode":"        actor = LINKEDIN_SCRAPER_ACTOR,\n        url_len = profile_url.len(),\n        \"[linkedin_enrichment] invoking Apify actor\"\n    );\n\n    // The backend wraps the Apify response in its standard envelope.\n    // `IntegrationClient::post` already unwraps `{ success, data }`.\n    let resp: serde_json::Value = client\n        .post(\"/agent-integrations/apify/run\", &body)\n        .await\n        .map_err(|e| anyhow::anyhow!(\"Apify run failed: {e:#}\"))?;\n\n    let status = resp\n        .get(\"status\")\n        .and_then(|v| v.as_str())\n        .unwrap_or(\"UNKNOWN\");\n\n    if status != \"SUCCEEDED\" {\n        anyhow::bail!(\"Apify run finished with status: {status}\");\n    }\n\n    // Extract the first item from the inline results array.\n    let items = resp\n        .get(\"items\")\n        .and_then(|v| v.as_array())\n        .ok_or_else(|| anyhow::anyhow!(\"Apify run returned no items array\"))?;\n\n    items\n        .first()\n        .cloned()\n        .ok_or_else(|| anyhow::anyhow!(\"Apify run returned an empty items array\"))\n}\n\n/// Build a local memory client for profile persistence.\nfn build_memory_client() -> anyhow::Result<tinymemory_core::store::MemoryClient> {\n    tinymemory_core::store::MemoryClient::new_local()\n        .map_err(|e| anyhow::anyhow!(\"memory client unavailable: {e}\"))","sourceCodeStart":641,"sourceCodeEnd":677,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/learning/linkedin_enrichment.rs#L641-L677","documentation":"After posting a run to /agent-integrations/apify/run, the response's status field must be \"SUCCEEDED\"; any other value (FAILED, TIMED-OUT, ABORTED, or UNKNOWN when the field is missing) bails with 'Apify run finished with status: {status}'. The HTTP call itself succeeded - it is the actor run's outcome that failed. The code then expects an items array, so a malformed success response surfaces as a different error.","triggerScenarios":"The Apify actor fails on bad input (e.g. an unreachable or protected profile URL), times out, or aborts; missing or expired Apify integration credentials cause a failed run; response shape drift where the status field is absent yields UNKNOWN.","commonSituations":"Scraping targets that block the actor; Apify account quota or rate limits exhausted; the sought data simply unavailable for the target.","solutions":["Read the status value: FAILED or TIMED_OUT usually mean input or target problems - check the actor's run log on Apify.","Validate the input (target URL or profile identifier) before triggering the run.","Verify the Apify integration credentials are current.","Retry with backoff for transient blocks or platform hiccups."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"Retry the Apify run with capped exponential backoff (e.g. 2-3 attempts) when the status is TIMED-OUT or a transient-looking FAILED; give up on ABORTED or repeated FAILED and degrade gracefully - the run's status, not the HTTP call, is what failed.","preventionTips":["Validate the target input before triggering the actor.","Keep Apify integration credentials current and monitor account quota.","Log the returned status string so failures triage to the right actor run on Apify."],"tags":["apify","integration","scraping","enrichment","third-party-api"],"backgroundTag":"external-job-failed","analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}