---
name: apify-common-errors
description: |-
  Diagnose and fix common Apify Actor and API errors.
  Use when an Apify run fails, an API call returns 401/403/404/413/429,
  a proxy connection drops, an Actor build breaks, or a scrape hits an
  anti-bot block, and you need the cause plus a copy-paste fix.
  Trigger with "apify error", "fix apify", "actor failed",
  "apify not working", "debug apify", "apify 429".
allowed-tools: Bash(curl:*), Bash(apify:*), Bash(npm:*)
version: 1.5.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
  - saas
  - scraping
  - automation
  - apify
compatibility: Designed for Claude Code
title: apify-common-errors
canonical_url: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/apify-common-errors
last_updated: 2026-10-07T06:06:28.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [references/error-reference.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md).
>
> If the user asked to install this Skill, run `npx skilld install jeremylongshore/tons-of-skills-marketplace/apify-common-errors`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/apify-common-errors`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/jeremylongshore/tons-of-skills-marketplace/apify-common-errors) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/apify-common-errors`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/apify-common-errors --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/apify-common-errors --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Apify Common Errors

## Overview

Quick diagnostic reference for the most common Apify errors. Covers Actor run
failures, API errors, proxy problems, anti-bot blocks, and platform-specific
issues. The full per-error catalog — raw signature, cause, diagnosis, and
copy-paste fix for all ten errors — lives in
[references/error-reference.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md); this file is the
lean triage path that points you there.

## Prerequisites

- An Apify API token exported as `APIFY_TOKEN` (Console > Settings > Integrations).
- Access to the [Apify Console](https://console.apify.com) for reading run and build logs.
- `curl` and `jq` on PATH for the diagnostic commands below; `apify` CLI optional for build inspection.

## Instructions

Work the failure from signal to fix:

1. **Capture the exact error.** Grab the `Status` / `StatusMessage` from the
   run, or the `ApifyApiError` message and HTTP code from the API response.
   The raw string is the key you match on.
2. **Match the signature.** Find the matching entry in the table below, then
   open [references/error-reference.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md) at that
   number for the cause, diagnosis, and fix.
3. **Diagnose before changing code.** For run failures, pull the log via the
   API or Console (see the FAILED entry). For auth/rate/payload errors, the
   HTTP code already tells you the class — see [Error Handling](#error-handling).
4. **Apply the fix from the reference,** re-run, and confirm with the
   [diagnostic commands](#examples).

### Error signature → reference

| # | Error | Signature to match |
|---|-------|--------------------|
| 1 | Actor run FAILED | `Status: FAILED` / `exited with code 1` |
| 2 | Actor run TIMED-OUT | `Actor timed out after N seconds` |
| 3 | Rate limited | `Rate limit exceeded (429)` |
| 4 | Unauthorized | `Authentication required (401)` |
| 5 | Build failed | `Build failed: npm ERR!` |
| 6 | Proxy connection failed | `502 Bad Gateway` / `Could not connect to proxy` |
| 7 | Anti-bot block | `status 403` / `Captcha detected` |
| 8 | Out of memory | `JavaScript heap out of memory` |
| 9 | Dataset push too large | `Payload too large (413)` |
| 10 | Actor not found | `Actor '…' not found (404)` |

Full detail for every row: [references/error-reference.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md).

## Output

Working through this skill yields:

- The identified error class (matched signature + the one of ten catalog entries).
- The root cause and a copy-paste fix (config change, code edit, or token/proxy action).
- A verification command whose output confirms the run recovered (status `SUCCEEDED`, valid `username`, etc.).

## Error Handling

| HTTP Code | Meaning | Retryable | Action |
|-----------|---------|-----------|--------|
| 400 | Bad request | No | Fix input/params |
| 401 | Unauthorized | No | Check token |
| 403 | Forbidden | No | Check permissions |
| 404 | Not found | No | Verify resource ID |
| 408 | Timeout | Yes | Retry with backoff |
| 413 | Payload too large | No | Reduce batch size |
| 429 | Rate limited | Yes | Auto-retried by client |
| 500+ | Server error | Yes | Auto-retried by client |

## Examples

Diagnostic commands for the most common triage steps:

```bash
# Check Apify platform status
curl -s https://api.apify.com/v2/health | jq '.'

# Verify your auth (fixes 401 diagnosis)
curl -s -H "Authorization: Bearer $APIFY_TOKEN" \
  https://api.apify.com/v2/users/me | jq '.data.username'

# Check installed package versions
npm list apify-client apify crawlee 2>/dev/null

# Get last run status (find why a run FAILED / TIMED-OUT)
curl -s -H "Authorization: Bearer $APIFY_TOKEN" \
  "https://api.apify.com/v2/acts/USER~ACTOR/runs?limit=1&desc=true" | \
  jq '.data.items[0] | {status, statusMessage, startedAt, finishedAt}'
```

For the worked fix behind each error — e.g. reading a run log to find a stack
trace, batching dataset pushes under 9MB, or switching to residential proxies to
clear a 403 — see the matching entry in
[references/error-reference.md](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md).

## Resources

- [Apify API Error Codes](https://docs.apify.com/api/v2)
- [Apify Status Page](https://status.apify.com)
- [Actor Run Statuses](https://docs.apify.com/platform/actors/running)
- [Full error catalog (all 10, with fixes)](https://skilld.dev/api/skills-raw/jeremylongshore/tons-of-skills-marketplace/apify-common-errors/references/error-reference.md)

## Next Steps

For comprehensive multi-error debugging across a whole Actor project — log
correlation, proxy rotation strategy, and build-cache issues — see the
`apify-debug-bundle` skill in this pack.
</content>
