{"record":{"id":"808187f223ddd859","repo":"apache/hadoop","slug":"create-pathname-too-long-limit-characters","errorCode":null,"errorMessage":"create: Pathname too long.  Limit {} characters, {} levels.","messagePattern":"create: Pathname too long\\.  Limit (.+?) characters, (.+?) levels\\.","errorType":"validation","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java","lineNumber":819,"sourceCode":"  @Override // ClientProtocol\n  public FsServerDefaults getServerDefaults() throws IOException {\n    checkNNStartup();\n    return namesystem.getServerDefaults();\n  }\n\n  @Override // ClientProtocol\n  public HdfsFileStatus create(String src, FsPermission masked,\n      String clientName, EnumSetWritable<CreateFlag> flag,\n      boolean createParent, short replication, long blockSize,\n      CryptoProtocolVersion[] supportedVersions, String ecPolicyName,\n      String storagePolicy)\n      throws IOException {\n    checkNNStartup();\n    String clientMachine = getClientMachine();\n    stateChangeLog.debug(\"*DIR* NameNode.create: file {} for {} at {}.\",\n        src, clientName, clientMachine);\n    if (!checkPathLength(src)) {\n      throw new IOException(\"create: Pathname too long.  Limit \"\n          + MAX_PATH_LENGTH + \" characters, \" + MAX_PATH_DEPTH + \" levels.\");\n    }\n    namesystem.checkOperation(OperationCategory.WRITE);\n    CacheEntryWithPayload cacheEntry = getCacheEntryWithPayload(null);\n    if (cacheEntry != null && cacheEntry.isSuccess()) {\n      return (HdfsFileStatus) cacheEntry.getPayload();\n    }\n\n    HdfsFileStatus status = null;\n    try {\n      PermissionStatus perm = new PermissionStatus(getRemoteUser()\n          .getShortUserName(), null, masked);\n      status = namesystem.startFile(src, perm, clientName, clientMachine,\n          flag.get(), createParent, replication, blockSize, supportedVersions,\n          ecPolicyName, storagePolicy, cacheEntry != null);\n    } finally {\n      RetryCache.setState(cacheEntry, status != null, status);\n    }","sourceCodeStart":801,"sourceCodeEnd":837,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNodeRpcServer.java#L801-L837","documentation":"Error \"create: Pathname too long.  Limit {} characters, {} levels.\" thrown in apache/hadoop.","triggerScenarios":"A create call uses a pathname exceeding the configured character or depth limits.","commonSituations":"Creating deeply nested paths or very long file names beyond default HDFS limits.","solutions":["Shorten the path or filename, or raise dfs.namenode.fs-limits.max-component-length / max-directory-items limits if appropriate."],"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"}