crewAIInc/crewAI · error · SystemExit

Error fetching triggers: {e}

Error message

Error fetching triggers: {e}

What it means

Printed with SystemExit(1) by TriggerCommand.list_triggers() in crewai_cli/triggers/main.py when any exception occurs while fetching triggers from CrewAI Plus (self.plus_api_client.get_triggers()), including response validation failures from _validate_response (auth errors, non-200 status).

Source

Thrown at lib/cli/src/crewai_cli/triggers/main.py:35

    """

    def __init__(self) -> None:
        BaseCommand.__init__(self)
        PlusAPIMixin.__init__(self, telemetry=self._telemetry)

    def list_triggers(self) -> None:
        """List all available triggers from integrations."""
        try:
            console.print("[bold blue]Fetching available triggers...[/bold blue]")
            response = self.plus_api_client.get_triggers()
            self._validate_response(response)

            triggers_data = response.json()
            self._display_triggers(triggers_data)

        except Exception as e:
            console.print(f"[bold red]Error fetching triggers: {e}[/bold red]")
            raise SystemExit(1) from e

    def execute_with_trigger(self, trigger_path: str) -> None:
        """Execute crew with trigger payload."""
        try:
            if "/" not in trigger_path:
                console.print(
                    "[bold red]Error: Trigger must be in format 'app_slug/trigger_slug'[/bold red]"
                )
                raise SystemExit(1)

            app_slug, trigger_slug = trigger_path.split("/", 1)

            console.print(
                f"[bold blue]Fetching trigger payload for {app_slug}/{trigger_slug}...[/bold blue]"
            )
            response = self.plus_api_client.get_trigger_payload(app_slug, trigger_slug)

            if response.status_code == 404:

View on GitHub (pinned to 754d7323be)

Solutions

  1. Authenticate first: `crewai login` (or set the API key) and retry `crewai trigger list`.
  2. Check network/proxy access to the CrewAI Plus API from your environment.
  3. Run with any verbose/debug flag or re-run `crewai login` if the token expired.
  4. If _validate_response failed with a status message, address that status (e.g. workspace has no integrations installed — add one in the Plus dashboard).
Defensive patterns

Strategy: retry

Validate before calling

from crewai_cli.authentication.platform import PlatformAuthentication
auth = PlatformAuthentication()
if not auth.get_api_key():
    raise SystemExit("Not authenticated — run `crewai login` first")

Try / catch

import time
for attempt in range(3):
    try:
        response = plus_api_client.get_triggers()
        break
    except Exception:
        if attempt == 2:
            raise
        time.sleep(2 ** attempt)

Prevention

When it happens

Trigger: Running `crewai trigger list` without being authenticated to CrewAI Plus (missing/expired API key), with a 401/403 from the Plus API, a network failure, or a malformed JSON response failing _validate_response.

Common situations: Not logged in via `crewai login`; CREWAI_API_KEY expired or from a different workspace with no trigger integrations; corporate proxy blocking api.crewai.com; Plus API outage.

Related errors


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