{"record":{"id":"4adef4dd20ea9a84","repo":"FoundationAgents/OpenManus","slug":"no-configuration-file-found-in-config-directory","errorCode":null,"errorMessage":"No configuration file found in config directory","messagePattern":"No configuration file found in config directory","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"critical","filePath":"app/config.py","lineNumber":226,"sourceCode":"\n    def __init__(self):\n        if not self._initialized:\n            with self._lock:\n                if not self._initialized:\n                    self._config = None\n                    self._load_initial_config()\n                    self._initialized = True\n\n    @staticmethod\n    def _get_config_path() -> Path:\n        root = PROJECT_ROOT\n        config_path = root / \"config\" / \"config.toml\"\n        if config_path.exists():\n            return config_path\n        example_path = root / \"config\" / \"config.example.toml\"\n        if example_path.exists():\n            return example_path\n        raise FileNotFoundError(\"No configuration file found in config directory\")\n\n    def _load_config(self) -> dict:\n        config_path = self._get_config_path()\n        with config_path.open(\"rb\") as f:\n            return tomllib.load(f)\n\n    def _load_initial_config(self):\n        raw_config = self._load_config()\n        base_llm = raw_config.get(\"llm\", {})\n        llm_overrides = {\n            k: v for k, v in raw_config.get(\"llm\", {}).items() if isinstance(v, dict)\n        }\n\n        default_settings = {\n            \"model\": base_llm.get(\"model\"),\n            \"base_url\": base_llm.get(\"base_url\"),\n            \"api_key\": base_llm.get(\"api_key\"),\n            \"max_tokens\": base_llm.get(\"max_tokens\", 4096),","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/config.py#L208-L244","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nls config/  # empty -> FileNotFoundError\n\n# after\ncp config/config.example.toml config/config.toml\n# edit config/config.toml with real keys","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef config_present(project_root: Path) -> bool:\n    return (project_root / \"config\" / \"config.toml\").exists() or \\\n           (project_root / \"config\" / \"config.example.toml\").exists()","typeGuard":null,"tryCatchPattern":"try:\n    from app.config import config  # triggers load\nexcept FileNotFoundError as e:\n    print(\"Missing config/config.toml — copy config.example.toml and fill it in\")\n    raise","preventionTips":["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"],"tags":["configuration","startup","file-not-found"],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}