{"record":{"id":"82e450ca479feb92","repo":"crewAIInc/crewAI","slug":"action-chmod-requires-path","errorCode":null,"errorMessage":"action='chmod' requires 'path'","messagePattern":"action='chmod' requires 'path'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py","lineNumber":305,"sourceCode":"                if path is None:\n                    raise ValueError(\"action='exists' requires 'path'\")\n                return self._exists(sandbox, path)\n            if action == \"move\":\n                if path is None or destination is None:\n                    raise ValueError(\"action='move' requires 'path' and 'destination'\")\n                sandbox.fs.move_files(path, destination)\n                return {\"status\": \"moved\", \"from\": path, \"to\": destination}\n            if action == \"find\":\n                if path is None or pattern is None:\n                    raise ValueError(\"action='find' requires 'path' and 'pattern'\")\n                return self._find(sandbox, path, pattern)\n            if action == \"search\":\n                if path is None or pattern is None:\n                    raise ValueError(\"action='search' requires 'path' and 'pattern'\")\n                return self._search(sandbox, path, pattern)\n            if action == \"chmod\":\n                if path is None:\n                    raise ValueError(\"action='chmod' requires 'path'\")\n                return self._chmod(sandbox, path, mode=mode, owner=owner, group=group)\n            if action == \"replace\":\n                if paths is None or pattern is None or replacement is None:\n                    raise ValueError(\n                        \"action='replace' requires 'paths', 'pattern', and \"\n                        \"'replacement'\"\n                    )\n                return self._replace(sandbox, paths, pattern, replacement)\n            raise ValueError(f\"Unknown action: {action}\")\n        finally:\n            self._release_sandbox(sandbox, should_delete)\n\n    def _read(self, sandbox: Any, path: str, *, binary: bool) -> dict[str, Any]:\n        data: bytes = sandbox.fs.download_file(path)\n        if binary:\n            return {\n                \"path\": path,\n                \"encoding\": \"base64\",","sourceCodeStart":287,"sourceCodeEnd":323,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/daytona_sandbox_tool/daytona_file_tool.py#L287-L323","documentation":"action='chmod' in DaytonaFileTool._run needs a 'path' to apply permission/ownership changes to via self._chmod(sandbox, path, mode=mode, owner=owner, group=group). A None path raises ValueError before any sandbox command runs. mode, owner, and group are optional; only path is mandatory.","triggerScenarios":"Calling _run(action='chmod', mode='0644') with no path; agents that list the desired permissions but forget the target file; passing the target as 'file' instead of 'path'.","commonSituations":"Agents paraphrasing a chmod request and dropping the filename; users assuming the tool applies to the most recently written file (it does not — each call is independent).","solutions":["Include the target: _run(action='chmod', path='/workspace/run.sh', mode='0755').","Pre-validate that chmod calls carry a path.","Require agents to restate the full path in every chmod step of a plan."],"exampleFix":"# before\nfile_tool._run(action='chmod', mode='0755')\n\n# after\nfile_tool._run(action='chmod', path='/workspace/run.sh', mode='0755')","handlingStrategy":"validation","validationCode":"def chmod(file_tool, path: str | None, mode: str | None = None):\n    if not path:\n        raise ValueError(\"action='chmod' requires 'path'\")\n    return file_tool._run(action='chmod', path=path, mode=mode)","typeGuard":null,"tryCatchPattern":"try:\n    file_tool._run(action='chmod', path=path, mode=mode)\nexcept ValueError as e:\n    if \"chmod\" in str(e):\n        raise PermissionPlanError('chmod step missing target path') from e\n    raise","preventionTips":["Bundle path+mode into one request object validated before dispatch.","Require agents to restate the file path in every permission step.","Validate mode strings (e.g. octal 4-digit) in your wrapper too."],"tags":["daytona","argument-validation","file-tool","chmod","permissions"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}