HKUDS/nanobot · error · ConfigLoadError
Unable to read the file
Error message
Unable to read the file: {_sentence(detail)} What it means
In load_config, opening or reading config.json raised OSError — an OS-level I/O failure (permission denied, is-a-directory, too many symlinks, etc.). The strerror (or exception class name) is embedded in the summary; the input at fault is the config path's filesystem state, not its content.
Solutions
- Fix file permissions so the current user can read config.json
- Ensure the path is a regular file, not a directory or broken symlink
- Check disk/mount health if the read failed at the OS level
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at nanobot/config/loader.py:102 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/43a68ab706ebf224.
Report an issue: GitHub.
Appendix: source
Thrown at nanobot/config/loader.py:102
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",
summary=f"Unable to read the file: {_sentence(detail)}",
) from exc
if not isinstance(data, dict):
root_type = type(data).__name__
raise ConfigLoadError(
path,
kind="invalid_root",
summary="The top level of config.json must be a JSON object.",
issues=(
ConfigIssue(
path=(),
message=f"Expected an object, but found {root_type}.",
),
),
)View on GitHub (pinned to 42f37dc4c0)