{"record":{"id":"35c950852ea86e17","repo":"apache/hadoop","slug":"permission-denied-by-sticky-bit-user-s-path-s","errorCode":null,"errorMessage":"Permission denied by sticky bit: user=%s, path=\"%s\":%s:%s:%s%s, parent=\"%s\":%s:%s:%s%s","messagePattern":"Permission denied by sticky bit: user=(.+?), path=\"(.+?)\":(.+?):(.+?):(.+?)(.+?), parent=\"(.+?)\":(.+?):(.+?):(.+?)(.+?)","errorType":"exception","errorClass":"AccessControlException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java","lineNumber":808,"sourceCode":"                                      INodeAttributes inode) {\n    // If this user is the directory owner, return\n    if (parent.getUserName().equals(getUser())) {\n      return false;\n    }\n\n    // if this user is the file owner, return\n    if (inode.getUserName().equals(getUser())) {\n      return false;\n    }\n\n    return true;\n  }\n\n  private void throwStickyBitException(\n      String inodePath, INodeAttributes inode,\n      String parentPath, INodeAttributes parent)\n      throws AccessControlException {\n    throw new AccessControlException(String.format(\n        FSExceptionMessages.PERMISSION_DENIED_BY_STICKY_BIT +\n            \": user=%s, path=\\\"%s\\\":%s:%s:%s%s, \" +\n            \"parent=\\\"%s\\\":%s:%s:%s%s\", user, inodePath, inode.getUserName(),\n        inode.getGroupName(), inode.isDirectory() ? \"d\" : \"-\",\n        inode.getFsPermission().toString(), parentPath, parent.getUserName(),\n        parent.getGroupName(), parent.isDirectory() ? \"d\" : \"-\",\n        parent.getFsPermission().toString()));\n  }\n\n  /**\n   * Whether a cache pool can be accessed by the current context\n   *\n   * @param pool CachePool being accessed\n   * @param access type of action being performed on the cache pool\n   * @throws AccessControlException if pool cannot be accessed\n   */\n  public void checkPermission(CachePool pool, FsAction access)\n      throws AccessControlException {","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSPermissionChecker.java#L790-L826","documentation":"Error \"Permission denied by sticky bit: user=%s, path=\"%s\":%s:%s:%s%s, parent=\"%s\":%s:%s:%s%s\" thrown in apache/hadoop.","triggerScenarios":"A user deletes or renames a file inside a sticky-bit directory without owning the file or the directory.","commonSituations":"Deleting another user's files in a world-writable sticky directory such as /tmp on HDFS.","solutions":["Only the file owner, directory owner, or superuser may delete/rename entries in a sticky-bit directory (e.g., /tmp); use the owning user."],"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"}