langchain-ai/langgraph · error · SystemExit

1

1

Error message

Error: {e}

What it means

Top-level error reporter in the langgraph CLI's config command: after parsing langgraph.json successfully, validate_config_file raised a click.UsageError or ValueError describing a schema problem, and this branch prints 'Error: <message>' to stderr (red) alongside any unknown-key warnings before exiting. The underlying cause is whatever the validation error text says — invalid config keys, bad graph references, or malformed structure.

Solutions

  1. Read the text after 'Error:' — it identifies the exact invalid field in langgraph.json
  2. Fix or remove the flagged key and re-run the CLI command
  3. Compare your langgraph.json against the documented config schema for the CLI version in use
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at libs/cli/langgraph_cli/cli.py:893 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/3222cd9ccc13e1a7. Report an issue: GitHub.

Appendix: source

Thrown at libs/cli/langgraph_cli/cli.py:893

    try:
        with open(config) as f:
            raw_config = json.load(f)
    except json.JSONDecodeError as e:
        raise click.UsageError(f"Invalid JSON in {config}: {e.args[0]}") from None

    # Check for unknown keys before validation so they show alongside any error.
    unknown_warnings = langgraph_cli.config.get_unknown_keys(raw_config)

    try:
        config_json = langgraph_cli.config.validate_config_file(config)
    except (click.UsageError, ValueError) as e:
        click.secho(f"Error: {e}", fg="red", err=True)
        if unknown_warnings:
            click.echo(err=True)
            for warning in unknown_warnings:
                click.secho(f"  warning: {warning}", fg="yellow", err=True)
        raise SystemExit(1) from None

    num_graphs = len(config_json.get("graphs", {}))
    click.secho(
        f"Configuration file {config} is valid. "
        f"({num_graphs} graph{'s' if num_graphs != 1 else ''} found)",
        fg="green",
    )
    if unknown_warnings:
        click.echo()
        for warning in unknown_warnings:
            click.secho(f"  warning: {warning}", fg="yellow")


# ---------------------------------------------------------------------------
# new command
# ---------------------------------------------------------------------------

View on GitHub (pinned to 38031739e5)