{"record":{"id":"2288645d9e2ac8a9","repo":"oraios/serena","slug":"project-configuration-file-not-found-yaml-path","errorCode":null,"errorMessage":"Project configuration file not found: {yaml_path}","messagePattern":"Project configuration file not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/serena/config/serena_config.py","lineNumber":706,"sourceCode":"    ) -> Self:\n        \"\"\"\n        Load a ProjectConfig instance from the path to the project root.\n\n        :param project_root: the path to the project root\n        :param serena_config: the global Serena configuration\n        :param autogen: the auto-generation mode to apply if the project configuration does not yet exist\n        \"\"\"\n        project_root = Path(project_root)\n        project_folder_name = project_root.name\n        yaml_path = serena_config.get_project_yml_location(project_root)\n        log.debug(\"Loading project configuration from %s\", yaml_path)\n\n        # auto-generate if necessary\n        if not os.path.exists(yaml_path):\n            if autogen.is_autogen_enabled():\n                return cls.autogenerate(project_root, serena_config, asynchronous=autogen == ProjectConfigAutoGenerationMode.ASYNCHRONOUS)\n            else:\n                raise FileNotFoundError(f\"Project configuration file not found: {yaml_path}\")\n\n        # load the configuration dictionary\n        yaml_data, was_complete = cls._load_yaml_dict(str(yaml_path))\n        if \"project_name\" not in yaml_data:\n            yaml_data[\"project_name\"] = project_folder_name\n\n        # apply overrides from project.local.yml, if present\n        local_yaml_path = cls._project_local_yml_path(str(yaml_path))\n        local_override_keys = []\n        if os.path.exists(local_yaml_path):\n            local_yaml_data, _ = cls._load_yaml_dict(local_yaml_path, apply_defaults=False)\n            if local_yaml_data:\n                local_override_keys = list(local_yaml_data.keys())\n                log.debug(\n                    \"Applying project configuration overrides from %s with keys %s\",\n                    local_yaml_path,\n                    local_override_keys,\n                )","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/config/serena_config.py#L688-L724","documentation":"ProjectConfig.load() requires a serena_project.yml (project configuration file) inside the project root. If the file does not exist and auto-generation is disabled, the loader refuses to invent a config and raises FileNotFoundError. It only autogenerates when is_autogen_enabled().","triggerScenarios":"Calling ProjectConfig.load(project_root) or SerenaConfig.add_project_from_path(...) on a directory lacking serena_project.yml when ProjectConfigAutoGenerationMode is disabled (or the config file path points elsewhere).","commonSituations":"Activating a brand-new project that was never onboarded; pointing from_project_root at the wrong directory; running in CI/container where the project yml was not copied; autogen disabled in serena_config.yml.","solutions":["Create serena_project.yml in the project root (run `serena project create` or copy the template) and fill in project_name.","Enable project-config autogeneration so load() can create the file automatically.","Verify the path passed actually is the intended project root containing the config."],"exampleFix":"// before\nconfig = ProjectConfig.load(Path('/repos/myproj'))  # no serena_project.yml, autogen off\n// after\n(Path('/repos/myproj/serena_project.yml')).write_text('project_name: myproj\\nlanguage: python\\n')\nconfig = ProjectConfig.load(Path('/repos/myproj'))","handlingStrategy":"fallback","validationCode":"from pathlib import Path\nroot = Path(project_root)\nif not (root / 'serena_project.yml').exists():\n    print('missing project config at', root)  # then enable autogen or create it","typeGuard":"def has_project_config(root) -> bool:\n    from pathlib import Path\n    return (Path(root) / 'serena_project.yml').is_file()","tryCatchPattern":"try:\n    cfg = ProjectConfig.load(root, autogen=ProjectConfigAutoGenerationMode.DISABLED)\nexcept FileNotFoundError:\n    cfg = ProjectConfig.autogenerate(root)","preventionTips":["Always onboard new projects with the serena CLI before loading them","Verify project root contents (serena_project.yml present) in CI before running Serena","Keep autogeneration enabled unless you have a reason to forbid it"],"tags":["configuration","file-not-found","python"],"backgroundTag":"config-file-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}