{"record":{"id":"dfc5e769fc491531","repo":"HKUDS/nanobot","slug":"environment-based-configuration-could-not-be-parse","errorCode":null,"errorMessage":"Environment-based configuration could not be parsed. Check that complex NANOBOT_* values use valid JSON.","messagePattern":"Environment-based configuration could not be parsed\\. Check that complex NANOBOT_\\* values use valid JSON\\.","errorType":"exception","errorClass":"ConfigLoadError","httpStatus":null,"severity":"error","filePath":"nanobot/config/loader.py","lineNumber":63,"sourceCode":"\n    Args:\n        config_path: Optional path to config file. Uses default if not provided.\n\n    Returns:\n        Loaded configuration object.\n    \"\"\"\n    global _schema_refs_ready\n    if not _schema_refs_ready:\n        _resolve_tool_config_refs()\n        _schema_refs_ready = True\n\n    path = config_path or get_config_path()\n\n    if not path.exists():\n        try:\n            config = Config()\n        except SettingsError as exc:\n            raise ConfigLoadError(\n                path,\n                kind=\"invalid_schema\",\n                summary=(\n                    \"Environment-based configuration could not be parsed. \"\n                    \"Check that complex NANOBOT_* values use valid JSON.\"\n                ),\n            ) from exc\n        except ValidationError as exc:\n            raise ConfigLoadError(\n                path,\n                kind=\"invalid_schema\",\n                summary=\"Environment-based configuration is invalid.\",\n                issues=validation_issues(exc),\n            ) from exc\n        config.bind_source_path(path)\n        _apply_ssrf_whitelist(config)\n        return config\n","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/config/loader.py#L45-L81","documentation":"In load_config, no config file exists so a default Config() is built from environment variables, but pydantic-settings raised SettingsError — complex NANOBOT_* environment values are not parseable JSON. This is a generic guard on env-based startup only; the input at fault is an unparseable NANOBOT_* env var value.","triggerScenarios":"Thrown at nanobot/config/loader.py:63 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure complex NANOBOT_* env values (lists/objects) are valid JSON, e.g. NANOBOT_TOOLS='[\"web\"]'","Unset the offending env var to use built-in defaults","Create a config file instead of env-based configuration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","contentChangedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}