FoundationAgents/OpenManus · critical · FileNotFoundError
No configuration file found in config directory
Error message
No configuration file found in config directory
What it means
Raised by ConfigManager._get_config_path() when neither config/config.toml nor config/config.example.toml exists under PROJECT_ROOT. The config system requires at least one of these to bootstrap; the example file is an accepted fallback. It is a FileNotFoundError, so it typically aborts startup at import/first-access time.
Source
Thrown at app/config.py:226
def __init__(self):
if not self._initialized:
with self._lock:
if not self._initialized:
self._config = None
self._load_initial_config()
self._initialized = True
@staticmethod
def _get_config_path() -> Path:
root = PROJECT_ROOT
config_path = root / "config" / "config.toml"
if config_path.exists():
return config_path
example_path = root / "config" / "config.example.toml"
if example_path.exists():
return example_path
raise FileNotFoundError("No configuration file found in config directory")
def _load_config(self) -> dict:
config_path = self._get_config_path()
with config_path.open("rb") as f:
return tomllib.load(f)
def _load_initial_config(self):
raw_config = self._load_config()
base_llm = raw_config.get("llm", {})
llm_overrides = {
k: v for k, v in raw_config.get("llm", {}).items() if isinstance(v, dict)
}
default_settings = {
"model": base_llm.get("model"),
"base_url": base_llm.get("base_url"),
"api_key": base_llm.get("api_key"),
"max_tokens": base_llm.get("max_tokens", 4096),View on GitHub (pinned to 52a13f2a57)
Solutions
- Create config/config.toml (or restore config/config.example.toml) under the project root
- If deploying, copy config.example.toml to config.toml as part of the build/release step and fill in real values
- Check PROJECT_ROOT resolution (how the package computes it) when running from an unusual cwd
Example fix
# before ls config/ # empty -> FileNotFoundError # after cp config/config.example.toml config/config.toml # edit config/config.toml with real keys
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
def config_present(project_root: Path) -> bool:
return (project_root / "config" / "config.toml").exists() or \
(project_root / "config" / "config.example.toml").exists() Try / catch
try:
from app.config import config # triggers load
except FileNotFoundError as e:
print("Missing config/config.toml — copy config.example.toml and fill it in")
raise Prevention
- Add a startup check that config/config.toml exists with a helpful message
- Include the config directory in Docker builds and release artifacts
- Copy the example to config.toml as a documented first setup step
When it happens
Trigger: Running from a directory where PROJECT_ROOT resolution lands somewhere without a config/ folder; deleting config.toml and renaming the example to something else; packaging/deploying the app without including the config directory.
Common situations: Fresh clone where the repo's example file was gitignored or removed; Docker image built with .dockerignore excluding config/; running tests from a different working directory so PROJECT_ROOT points elsewhere.
Related errors
- Server URL is required for SSE connection
- Command is required for stdio connection
- Unsupported connection type: {self.connection_type}
- password must be provided
- Failed to load MCP server config: {e}
AI-assisted analysis of FoundationAgents/OpenManus@52a13f2a57 (2026-08-15).
Data as JSON: /api/errors/4adef4dd20ea9a84.
Report an issue: GitHub.