HKUDS/nanobot · error · ConfigLoadError
Environment-based configuration is invalid.
Error message
Environment-based configuration is invalid.
What it means
In load_config's env-only path, Config() parsed the NANOBOT_* environment but pydantic raised ValidationError — a value's type or constraints failed the schema. This is a generic guard wrapping validation_issues() for detail; the input at fault is the out-of-range or wrong-typed environment setting.
Solutions
- Read the issues list in ConfigLoadError for the exact offending field
- Correct the env value's type/range (e.g. numeric fields must be numbers)
- Move the setting into config.json where it can be validated and edited more easily
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/config/loader.py:72 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/aff7baab446c5f04.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/config/loader.py:72
_resolve_tool_config_refs()
_schema_refs_ready = True
path = config_path or get_config_path()
if not path.exists():
try:
config = Config()
except SettingsError as exc:
raise ConfigLoadError(
path,
kind="invalid_schema",
summary=(
"Environment-based configuration could not be parsed. "
"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}: "View on GitHub (pinned to 42f37dc4c0)