{"record":{"id":"8e65a3c558f99e2f","repo":"apache/hadoop","slug":"ownerstr-does-not-match-expected-pattern","errorCode":null,"errorMessage":"'\" + ownerStr + \"' does not match expected pattern for [owner][:group].","messagePattern":"'\" \\+ ownerStr \\+ \"' does not match expected pattern for \\[owner\\]\\[: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":159,"sourceCode":"    protected String owner = null;\n    protected String group = null;\n\n    @Override\n    protected void processOptions(LinkedList<String> args) throws IOException {\n      CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, \"R\");\n      cf.parse(args);\n      setRecursive(cf.getOpt(\"R\"));\n      parseOwnerGroup(args.removeFirst());\n    }\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;","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java#L141-L177","documentation":"Error \"'\" + ownerStr + \"' does not match expected pattern for [owner][:group].\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FsShellPermissions.java:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use the form 'owner', 'owner:', ':group', or 'owner:group' with valid user/group names.","Remove invalid characters from the owner/group specification."],"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-23T01:17:44.959Z"}