{"record":{"id":"fc4bac2511cbfe01","repo":"apache/hadoop","slug":"can-t-make-directory-for-path-s-under-s","errorCode":null,"errorMessage":"Can't make directory for path \"%s\" under \"%s\".","messagePattern":"Can't make directory for path \"(.+?)\" under \"(.+?)\"\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java","lineNumber":338,"sourceCode":"    } catch (SftpException e) {\n      throw new IOException(e);\n    }\n    Path absolute = makeAbsolute(workDir, file);\n    String pathName = absolute.getName();\n    if (!exists(client, absolute)) {\n      Path parent = absolute.getParent();\n      created =\n          (parent == null || mkdirs(client, parent, FsPermission.getDefault()));\n      if (created) {\n        String parentDir = parent.toUri().getPath();\n        boolean succeeded = true;\n        try {\n          final String previousCwd = client.pwd();\n          client.cd(parentDir);\n          client.mkdir(pathName);\n          client.cd(previousCwd);\n        } catch (SftpException e) {\n          throw new IOException(String.format(E_MAKE_DIR_FORPATH, pathName,\n              parentDir));\n        }\n        created = created & succeeded;\n      }\n    } else if (isFile(client, absolute)) {\n      throw new IOException(String.format(E_DIR_CREATE_FROMFILE, absolute));\n    }\n    return created;\n  }\n\n  /**\n   * Convenience method, so that we don't open a new connection when using this\n   * method from within another method. Otherwise every API invocation incurs\n   * the overhead of opening/closing a TCP connection.\n   * @throws IOException\n   */\n  private boolean isFile(ChannelSftp channel, Path file) throws IOException {\n    try {","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/sftp/SFTPFileSystem.java#L320-L356","documentation":"Error \"Can't make directory for path \"%s\" under \"%s\".\" thrown in apache/hadoop.","triggerScenarios":"Thrown by SFTPFileSystem.mkdirs when the parent directory portion of the target path cannot be created on the SFTP server.","commonSituations":"See trigger scenarios.","solutions":["Create the parent directory first, or check permissions to create directories under the given parent.","Verify the parent path on the SFTP server is a directory and writable."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}