{"record":{"id":"cb9f242c609a6f65","repo":"apache/hadoop","slug":"input-output-error-cb9f24","errorCode":null,"errorMessage":"Input/output error","messagePattern":"Input/output error","errorType":"exception","errorClass":"PathIOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java","lineNumber":126,"sourceCode":"      getRemoteDestination(args);\n    }\n\n    @Override\n    protected void processPath(PathData src, PathData target) throws IOException {\n      String srcUri = src.fs.getUri().getScheme() + \"://\" +\n          src.fs.getUri().getHost();\n      String dstUri = target.fs.getUri().getScheme() + \"://\" +\n          target.fs.getUri().getHost();\n      if (!srcUri.equals(dstUri)) {\n        throw new PathIOException(src.toString(),\n            \"Does not match target filesystem\");\n      }\n      if (target.exists) {\n        throw new PathExistsException(target.toString());\n      }\n      if (!target.fs.rename(src.path, target.path)) {\n        // we have no way to know the actual error...\n        throw new PathIOException(src.toString());\n      }\n    }\n  }\n}\n","sourceCodeStart":108,"sourceCodeEnd":131,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java#L108-L131","documentation":"Rename.processPath (MoveCommands.java:126) throws PathIOException (default message 'Input/output error') when target.fs.rename(src, target) returns false. The inline comment admits 'we have no way to know the actual error...' — the boolean return discards the reason, so any FS-level refusal lands here.","triggerScenarios":"FileSystem.rename returning false after the same-FS and target-not-exists checks passed: no WRITE permission on the destination parent, source deleted by a concurrent process between enumeration and rename, namespace quota exceeded on the destination directory, or the destination parent disappearing mid-operation.","commonSituations":"Moving data into directories owned by another user; concurrent jobs racing over the same files; renames during safe mode or NN failover returning false; quota-limited landing zones in ingestion pipelines.","solutions":["Check WRITE permission on the destination's parent directory and fix ownership ('hadoop fs -chown'/'-chmod' as owner or via admin)","Confirm the source still exists ('hadoop fs -ls <src>') — it may have been moved/deleted concurrently","Check NameNode logs and quota state ('hdfs dfsadmin -quotas' path-level via 'hdfs dfs -count -q') for the underlying refusal","Retry once the transient cause (failover, concurrent job) clears; the two earlier guards make stale-target causes unlikely"],"exampleFix":"# diagnose: rename returned false without a reason\nhadoop fs -ls /final            # parent perms + does source still exist?\nhadoop fs -count -q /final      # namespace quota remaining\nhadoop fs -chmod ...            # grant write, then re-run mv","handlingStrategy":"retry","validationCode":"// pre-flight the three common false-causes\nif (!fs.exists(src)) throw new FileNotFoundException(src.toString());\nif (!fs.getFileStatus(dst.getParent()).isDirectory()) throw new IOException(\"dst parent missing\");\n// ensure WRITE on dst parent via permissions check before calling rename","typeGuard":null,"tryCatchPattern":"catch (PathIOException e) { diagnose: source still present? dst-parent writable? quota remaining?; fix cause then retry rename exactly once }","preventionTips":["Require WRITE permission on the destination parent","Verify source existence immediately before mv","Check namespace quota on landing directories"],"tags":["mv","rename","io-error","permissions","hadoop-shell"],"backgroundTag":"rename-failed","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}