HKUDS/nanobot · error · ConfigLoadError

JSON syntax error at line

Error message

JSON syntax error at line {exc.lineno}, column {exc.colno}: {_sentence(exc.msg)}

What it means

In load_config, config.json is not valid JSON: json.load raised JSONDecodeError. The summary embeds the exact line and column plus the parser's message, so the user can fix the specific syntax slip (missing comma, unquoted key, trailing comma). The input at fault is the config.json text.

Solutions

  1. Open config.json at the reported line/column and fix the JSON syntax
  2. Validate the file with a JSON linter or `python -m json.tool`
  3. Restore from a backup if the file was hand-edited badly
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nanobot/config/loader.py:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26). Data as JSON: /api/errors/0db14a117e7a815c. Report an issue: GitHub.

Appendix: source

Thrown at nanobot/config/loader.py:86

                    "Check that complex NANOBOT_* values use valid JSON."
                ),
            ) from exc
        except ValidationError as exc:
            raise ConfigLoadError(
                path,
                kind="invalid_schema",
                summary="Environment-based configuration is invalid.",
                issues=validation_issues(exc),
            ) from exc
        config.bind_source_path(path)
        _apply_ssrf_whitelist(config)
        return config

    try:
        with path.open(encoding="utf-8") as handle:
            data = json.load(handle)
    except json.JSONDecodeError as exc:
        raise ConfigLoadError(
            path,
            kind="invalid_json",
            summary=(
                f"JSON syntax error at line {exc.lineno}, column {exc.colno}: "
                f"{_sentence(exc.msg)}"
            ),
        ) from exc
    except UnicodeDecodeError as exc:
        raise ConfigLoadError(
            path,
            kind="io_error",
            summary="The file is not valid UTF-8.",
        ) from exc
    except OSError as exc:
        detail = exc.strerror or type(exc).__name__
        raise ConfigLoadError(
            path,
            kind="io_error",

View on GitHub (pinned to 42f37dc4c0)