{"record":{"id":"e9bb503eb70a8fe1","repo":"oraios/serena","slug":"serena-config-file-path-not-set","errorCode":null,"errorMessage":"Serena config file path not set","messagePattern":"Serena config file path not set","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/dashboard.py","lineNumber":710,"sourceCode":"            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 =====\n\n    # The branch from which news are fetched. Change to a feature branch for testing.\n    _NEWS_JSON_URL = \"https://oraios-software.de/serena_news.json\"\n\n    def _fetch_news(self) -> None:\n        \"\"\"Fetch news.json from GitHub using ETag-based caching and store in memory. Silently ignores network errors.\"\"\"\n        paths = SerenaPaths()\n\n        headers: dict[str, str] = {}\n        # Load stored ETag if available\n        if os.path.exists(paths.news_etag_file) and os.path.exists(paths.news_file):","sourceCodeStart":692,"sourceCodeEnd":728,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/dashboard.py#L692-L728","documentation":"The save-config handler (`_save_serena_config`) writes the posted content to `serena_config.config_file_path`. If that path is None — Serena was started without a config file location (no global config has ever been created/resolved) — it raises ValueError('Serena config file path not set') and nothing is written.","triggerScenarios":"PUT /save_serena_config in an environment where the Serena config path was never resolved: fresh state with no `~/.serena/serena_config.yml`, or a config object constructed without a file path. Note this differs from error [66]: here the path is None, not merely missing on disk.","commonSituations":"Editing config through the dashboard in a container/CI where Serena never initialized its global config; HOME set to a location where no config exists and none was generated; testing the dashboard against an in-memory config.","solutions":["Ensure the global config file exists (run Serena once to generate `~/.serena/serena_config.yml` or create it manually) before saving via the dashboard.","Verify HOME/XDG path overrides resolve to the location Serena reads its config from.","Initialize the config via Serena's config-loading API so config_file_path is populated, then retry the save.","If the file exists but the error persists, restart the agent so it reloads the config path."],"exampleFix":"# before\nrequests.put(f\"{dashboard}/save_serena_config\", json={\"content\": cfg_text})\n# after\nPath(\"~/.serena/serena_config.yml\").expanduser().parent.mkdir(parents=True, exist_ok=True)\nif not Path(\"~/.serena/serena_config.yml\").expanduser().exists():\n    Path(\"~/.serena/serena_config.yml\").expanduser().write_text(default_config)\nrequests.put(f\"{dashboard}/save_serena_config\", json={\"content\": cfg_text})","handlingStrategy":"validation","validationCode":"import os\npath = agent.serena_config.config_file_path\nassert path is not None, \"Serena config path not set; create the global config first\"\nif not os.path.exists(path):\n    Path(path).parent.mkdir(parents=True, exist_ok=True)\n    Path(path).write_text(default_config_yaml)","typeGuard":null,"tryCatchPattern":"try:\n    requests.put(f\"{dashboard}/save_serena_config\", json={\"content\": new_yaml})\nexcept ValueError as e:\n    if \"path not set\" in str(e):\n        create_default_config_file()\n        requests.put(f\"{dashboard}/save_serena_config\", json={\"content\": new_yaml})","preventionTips":["Ensure the global Serena config file exists before attempting dashboard-based edits.","Create ~/.serena/serena_config.yml in Dockerfiles/CI setup steps.","Check that HOME overrides don't hide the expected config location.","Restart the agent after creating the config so config_file_path is resolved."],"tags":["dashboard","config","file-not-found","http"],"backgroundTag":"config-path-not-set","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}