crewAIInc/crewAI · error · RuntimeError

Failed to run ApifyActorsTool {self.name}. Please check your

Error message

Failed to run ApifyActorsTool {self.name}. Please check your Apify account Actor run logs for more details.Error: {e}

What it means

The crewai-tools ApifyActorsTool wrapper delegates _run() to langchain-apify's actor tool; any exception it raises is caught and re-raised as a RuntimeError naming the tool and pointing to the Apify console's Actor run logs. The original exception is chained (__cause__), so the true cause (bad run input, actor crash, quota) is preserved.

Source

Thrown at lib/crewai-tools/src/crewai_tools/tools/apify_actors_tool/apify_actors_tool.py:102

    def _run(self, run_input: dict[str, Any]) -> list[dict[str, Any]]:
        """Run the Actor tool with the given input.

        Returns:
            List[Dict[str, Any]]: Results from the Actor execution.

        Raises:
            ValueError: If 'actor_tool' is not initialized.
        """
        try:
            return self.actor_tool._run(run_input)
        except Exception as e:
            msg = (
                f"Failed to run ApifyActorsTool {self.name}. "
                "Please check your Apify account Actor run logs for more details."
                f"Error: {e}"
            )
            raise RuntimeError(msg) from e

View on GitHub (pinned to 754d7323be)

Solutions

  1. Open the Apify Console > Actor > Runs and read the failing run's log — the message explicitly directs you there and the root cause is almost always in that log.
  2. Validate run_input against the actor's input schema (visible on the actor's page in Apify Console) and fix mismatches.
  3. Re-run with a minimal known-good input to isolate whether the input or the actor is at fault.
  4. Inspect `e.__cause__` in your except block for the original exception details.

Example fix

# before
result = tool._run({"query": "test"})

# after
try:
    result = tool._run({"query": "test", "maxResults": 10})  # match actor input schema
except RuntimeError as e:
    logger.error("Apify run failed: %s | cause: %s", e, e.__cause__)
    raise
Defensive patterns

Strategy: try-catch

Validate before calling

def validate_actor_input(run_input: dict, required: set[str]) -> bool:
    return all(run_input.get(k) is not None for k in required)

Try / catch

try:
    return self.actor_tool._run(run_input)
except RuntimeError as e:
    logger.error("Apify failure: %s | cause=%r", e, e.__cause__)
    if isinstance(e.__cause__, (KeyError, TypeError)):
        return f"Invalid run_input: {e.__cause__}. Check the actor's input schema."
    raise

Prevention

When it happens

Trigger: Calling the tool with a run_input the actor rejects (wrong schema, missing required fields); the actor itself crashing or timing out on the Apify platform; account quota/network issues at run time.

Common situations: Incorrect run_input JSON for the specific actor; actor version breaking its input contract; free-tier run limits exceeded; passing plain text when the actor expects a structured dict.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/d963b5c81aa1ec8c. Report an issue: GitHub.