{"record":{"id":"886922bbea52cbf2","repo":"FoundationAgents/OpenManus","slug":"file-already-exists-at-path-cannot-overwrite-f","errorCode":null,"errorMessage":"File already exists at: {path}. Cannot overwrite files using command `create`.","messagePattern":"File already exists at: (.+?)\\. Cannot overwrite files using command `create`\\.","errorType":"exception","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"app/tool/str_replace_editor.py","lineNumber":192,"sourceCode":"        # Only check if path exists for non-create commands\n        if command != \"create\":\n            if not await operator.exists(path):\n                raise ToolError(\n                    f\"The path {path} does not exist. Please provide a valid path.\"\n                )\n\n            # Check if path is a directory\n            is_dir = await operator.is_directory(path)\n            if is_dir and command != \"view\":\n                raise ToolError(\n                    f\"The path {path} is a directory and only the `view` command can be used on directories\"\n                )\n\n        # Check if file exists for create command\n        elif command == \"create\":\n            exists = await operator.exists(path)\n            if exists:\n                raise ToolError(\n                    f\"File already exists at: {path}. Cannot overwrite files using command `create`.\"\n                )\n\n    async def view(\n        self,\n        path: PathLike,\n        view_range: Optional[List[int]] = None,\n        operator: FileOperator = None,\n    ) -> CLIResult:\n        \"\"\"Display file or directory content.\"\"\"\n        # Determine if path is a directory\n        is_dir = await operator.is_directory(path)\n\n        if is_dir:\n            # Directory handling\n            if view_range:\n                raise ToolError(\n                    \"The `view_range` parameter is not allowed when `path` points to a directory.\"","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/FoundationAgents/OpenManus/blob/52a13f2a57d8c7f6737eefb02ccf569594d44273/app/tool/str_replace_editor.py#L174-L210","documentation":"Error \"File already exists at: {path}. Cannot overwrite files using command `create`.\" thrown in FoundationAgents/OpenManus.","triggerScenarios":"Raised when the `create` command targets a path where a file already exists, since create will not overwrite existing files.","commonSituations":"See trigger scenarios.","solutions":["Use command `str_replace` or `insert` to modify the existing file instead of `create`.","Delete or rename the existing file first if you must recreate it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"52a13f2a57d8c7f6737eefb02ccf569594d44273","analyzedAt":"2026-08-15T02:33:49.993Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}