{"record":{"id":"68e222ca106524f9","repo":"theonedev/onedev","slug":"unable-to-find-group-groupname-68e222","errorCode":null,"errorMessage":"Unable to find group: ${groupName}","messagePattern":"Unable to find group: (.+?)","errorType":"validation","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/util/usermatch/UserMatch.java","lineNumber":80,"sourceCode":"\t}\n\t\n\tprivate static UserMatchCriteria getUserMatchCriteria(CriteriaContext criteriaContext) {\n\t\tif (criteriaContext.Anyone() != null) {\n\t\t\treturn new Anyone();\n\t\t} else if (criteriaContext.userCriteria() != null) {\n\t\t\tString userName = getValue(criteriaContext.userCriteria().Value());\n\t\t\tUser user = OneDev.getInstance(UserService.class).findByName(userName);\n\t\t\tif (user != null)\n\t\t\t\treturn new UserCriteria(user);\n\t\t\telse\n\t\t\t\tthrow new ExplicitException(\"Unable to find user with login: \" + userName);\n\t\t} else if (criteriaContext.groupCriteria() != null) {\n\t\t\tString groupName = getValue(criteriaContext.groupCriteria().Value());\n\t\t\tGroup group = OneDev.getInstance(GroupService.class).find(groupName);\n\t\t\tif (group != null)\n\t\t\t\treturn new GroupCriteria(group);\n\t\t\telse\n\t\t\t\tthrow new ExplicitException(\"Unable to find group: \" + groupName);\n\t\t} else {\n\t\t\tthrow new ExplicitException(\"Unrecognized user match criteria\");\n\t\t}\n\t}\n\t\n\tpublic static UserMatch parse(@Nullable String userMatchString) {\n\t\tList<UserMatchCriteria> criterias = new ArrayList<>();\n\t\tList<UserMatchCriteria> exceptCriterias = new ArrayList<>();\n\t\t\n\t\tif (userMatchString != null) {\n\t\t\tCharStream is = CharStreams.fromString(userMatchString); \n\t\t\tUserMatchLexer lexer = new UserMatchLexer(is);\n\t\t\tlexer.removeErrorListeners();\n\t\t\tlexer.addErrorListener(new BaseErrorListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line,\n\t\t\t\t\t\tint charPositionInLine, String msg, RecognitionException e) {","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/util/usermatch/UserMatch.java#L62-L98","documentation":"UserMatch.getUserMatchCriteria resolves each 'group:<name>' criterion via GroupService.find; an unresolvable group throws ExplicitException with the group name. UserMatch.parse cannot build criteria for a nonexistent group.","triggerScenarios":"Parsing a user match expression referencing a deleted, renamed, or misspelled group, e.g. 'group:devops-team' after that group was removed.","commonSituations":"Group deletion without updating user match settings; cross-instance config import; trailing whitespace in group name.","solutions":["Correct the group name in the match string","Recreate the group or substitute an existing group/user clause","Run UserMatch.parse on the string before saving settings to fail fast"],"exampleFix":"// before\nuserMatchString = \"group:devops-team\";\n// after\nuserMatchString = \"group:devops\";","handlingStrategy":"validation","validationCode":"Group group = OneDev.getInstance(GroupService.class).find(groupName);\nif (group == null)\n    throw new ExplicitException(\"Unknown group in match: \" + groupName);","typeGuard":null,"tryCatchPattern":"try {\n    UserMatch.parse(matchString);\n} catch (ExplicitException e) {\n    ui.showError(e.getMessage());\n}","preventionTips":["Validate group names against GroupService.find at save time","Clean up match settings when groups are removed","Avoid hand-typing group names; use pickers"],"tags":["user-match","group-not-found","validation"],"backgroundTag":"resource-not-found","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}