{"record":{"id":"ffad041dae0f5860","repo":"apache/hadoop","slug":"invalid-file-name-src","errorCode":null,"errorMessage":"Invalid file name: <src>","messagePattern":"Invalid file name: <src>","errorType":"exception","errorClass":"InvalidPathException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java","lineNumber":732,"sourceCode":"   * @param src The path to resolve.\n   * @param dirOp The {@link DirOp} that controls additional checks.\n   * @return if the path indicates an inode, return path after replacing up to\n   *        {@code <inodeid>} with the corresponding path of the inode, else\n   *        the path in {@code src} as is. If the path refers to a path in\n   *        the \"raw\" directory, return the non-raw pathname.\n   * @throws FileNotFoundException\n   * @throws AccessControlException\n   * @throws ParentNotDirectoryException\n   * @throws UnresolvedLinkException\n   */\n  @VisibleForTesting\n  public INodesInPath resolvePath(FSPermissionChecker pc, String src,\n      DirOp dirOp) throws UnresolvedLinkException, FileNotFoundException,\n      AccessControlException, ParentNotDirectoryException {\n    boolean isCreate = (dirOp == DirOp.CREATE || dirOp == DirOp.CREATE_LINK);\n    // prevent creation of new invalid paths\n    if (isCreate && !DFSUtil.isValidName(src)) {\n      throw new InvalidPathException(\"Invalid file name: \" + src);\n    }\n\n    byte[][] components = INode.getPathComponents(src);\n    boolean isRaw = isReservedRawName(components);\n    components = resolveComponents(components, this);\n    INodesInPath iip = INodesInPath.resolve(rootDir, components, isRaw);\n    if (isPermissionEnabled && pc != null && isRaw) {\n      switch(dirOp) {\n      case READ_LINK:\n      case READ:\n        break;\n      default:\n        pc.checkSuperuserPrivilege(iip.getPath());\n        break;\n      }\n    }\n    // verify all ancestors are dirs and traversable.  note that only\n    // methods that create new namespace items have the signature to throw","sourceCodeStart":714,"sourceCodeEnd":750,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java#L714-L750","documentation":"Error \"Invalid file name: <src>\" thrown in apache/hadoop.","triggerScenarios":"Resolving a path whose name is null, empty, or malformed (e.g. does not start with '/').","commonSituations":"See trigger scenarios.","solutions":["Use a valid file name: non-empty and without path separators or reserved components."],"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"}