{"record":{"id":"9b9c541e6f8fa765","repo":"oraios/serena","slug":"serena-config-file-not-found","errorCode":null,"errorMessage":"Serena config file not found","messagePattern":"Serena config file not found","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/dashboard.py","lineNumber":699,"sourceCode":"                raise ValueError(\"No active project\")\n            project.memory_manager.delete_memory(request_delete_memory.memory_name, is_tool_context=False)\n\n        self._agent.execute_task(run, logged=True, name=\"DeleteMemory\")\n\n    def _rename_memory(self, request_rename_memory: RequestRenameMemory) -> str:\n        def run() -> str:\n            project = self._agent.get_active_project()\n            if project is None:\n                raise ValueError(\"No active project\")\n\n            return project.memory_manager.move_memory(request_rename_memory.old_name, request_rename_memory.new_name, is_tool_context=False)\n\n        return self._agent.execute_task(run, logged=True, name=\"RenameMemory\")\n\n    def _get_serena_config(self) -> ResponseGetSerenaConfig:\n        config_path = self._agent.serena_config.config_file_path\n        if config_path is None or not os.path.exists(config_path):\n            raise ValueError(\"Serena config file not found\")\n\n        with open(config_path, encoding=\"utf-8\") as f:\n            content = f.read()\n\n        return ResponseGetSerenaConfig(content=content)\n\n    def _save_serena_config(self, request_save_config: RequestSaveSerenaConfig) -> None:\n        def run() -> None:\n            config_path = self._agent.serena_config.config_file_path\n            if config_path is None:\n                raise ValueError(\"Serena config file path not set\")\n\n            with open(config_path, \"w\", encoding=\"utf-8\") as f:\n                f.write(request_save_config.content)\n\n        self._agent.execute_task(run, logged=True, name=\"SaveSerenaConfig\")\n\n    # ===== Remote News Methods =====","sourceCodeStart":681,"sourceCodeEnd":717,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/dashboard.py#L681-L717","documentation":"The `/get_serena_config` endpoint reads and returns the Serena configuration file. `_get_serena_config` raises ValueError('Serena config file not found') when `serena_config.config_file_path` is None (no path configured) or the path does not exist on disk. This happens when Serena runs in a mode where no global config file was created.","triggerScenarios":"Calling GET /get_serena_config when: (a) Serena has never generated a config file (config_file_path is None), or (b) the configured path was deleted/moved, or points at a non-existent location (e.g. wrong HOME/XDG path).","commonSituations":"Fresh installs before the first config write; running in containers/CI where HOME differs and the config was never initialized; users deleting `~/.serena/serena_config.yml`; overridden config paths that don't exist.","solutions":["Initialize Serena once (run any command that generates the default config) so `~/.serena/serena_config.yml` is created, then retry.","Check the resolved `config_file_path` (via the Serena config API or logs) and verify it exists with os.path.exists.","Recreate the config file from the project's default template if it was deleted.","Fix HOME/XDG_CONFIG_HOME or path overrides pointing to the wrong location in containers/CI."],"exampleFix":"# before\ncfg = requests.get(f\"{dashboard}/get_serena_config\").json()\n# after\nif os.path.exists(config_file_path):\n    cfg = requests.get(f\"{dashboard}/get_serena_config\").json()\nelse:\n    init_default_config()  # create ~/.serena/serena_config.yml first","handlingStrategy":"validation","validationCode":"import os\ncfg_path = agent.serena_config.config_file_path\nif cfg_path is None or not os.path.exists(cfg_path):\n    # skip the /get_serena_config call or initialize the default config first\n    init_serena_config()","typeGuard":null,"tryCatchPattern":"try:\n    resp = requests.get(f\"{dashboard}/get_serena_config\")\n    resp.raise_for_status()\nexcept (ValueError, requests.HTTPError) as e:\n    logger.warning(\"Serena config unavailable, using defaults: %s\", e)\n    config_content = DEFAULT_SERENA_CONFIG","preventionTips":["Run Serena once in the target environment to generate ~/.serena/serena_config.yml.","In containers/CI, persist the .serena directory across runs or create the config in the image.","Verify HOME/XDG overrides resolve where you expect before calling config endpoints.","Fall back to bundled defaults when the config endpoint fails."],"tags":["dashboard","config","file-not-found","http"],"backgroundTag":"config-file-not-found","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}