{"record":{"id":"647fbdb5ff3631d6","repo":"apache/hadoop","slug":"ownerstr-does-not-specify-owner-or-group","errorCode":null,"errorMessage":"'\" + ownerStr + \"' does not specify owner or group.","messagePattern":"'\" \\+ ownerStr \\+ \"' does not specify owner or group\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java","lineNumber":168,"sourceCode":"    }\n    \n    /**\n     * Parse the first argument into an owner and group\n     * @param ownerStr string describing new ownership\n     */\n    protected void parseOwnerGroup(String ownerStr) {\n      Matcher matcher = chownPattern.matcher(ownerStr);\n      if (!matcher.matches()) {\n        throw new IllegalArgumentException(\n            \"'\" + ownerStr + \"' does not match expected pattern for [owner][:group].\");\n      }\n      owner = matcher.group(1);\n      group = matcher.group(3);\n      if (group != null && group.length() == 0) {\n        group = null;\n      }\n      if (owner == null && group == null) {\n        throw new IllegalArgumentException(\n            \"'\" + ownerStr + \"' does not specify owner or group.\");\n      }    \n    }\n    \n    @Override\n    protected void processPath(PathData item) throws IOException {\n      //Should we do case insensitive match?\n      String newOwner = (owner == null || owner.equals(item.stat.getOwner())) ?\n                        null : owner;\n      String newGroup = (group == null || group.equals(item.stat.getGroup())) ?\n                        null : group;\n\n      if (newOwner != null || newGroup != null) {\n        try {\n          item.fs.setOwner(item.path, newOwner, newGroup);\n        } catch (IOException e) {\n          LOG.debug(\"Error changing ownership of \" + item, e);\n          throw new IOException(","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java#L150-L186","documentation":"Error \"'\" + ownerStr + \"' does not specify owner or group.\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Specify at least an owner or a group in the chown argument.","Use 'user' or 'user:group' syntax instead of an empty string."],"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"}