{"record":{"id":"8966fbf1d757df56","repo":"jeecgboot/JeecgBoot","slug":"jobgroup-empty","errorCode":"jobgroup_empty","errorMessage":"jobgroup_empty","messagePattern":"jobgroup_empty","errorType":"exception","errorClass":"XxlJobException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobInfoController.java","lineNumber":66,"sourceCode":"\tprivate XxlJobService xxlJobService;\n\t\n\t@RequestMapping\n\tpublic String index(HttpServletRequest request, Model model, @RequestParam(value = \"jobGroup\", required = false, defaultValue = \"-1\") int jobGroup) {\n\n\t\t// 枚举-字典\n\t\tmodel.addAttribute(\"ExecutorRouteStrategyEnum\", ExecutorRouteStrategyEnum.values());\t    // 路由策略-列表\n\t\tmodel.addAttribute(\"GlueTypeEnum\", GlueTypeEnum.values());\t\t\t\t\t\t\t\t// Glue类型-字典\n\t\tmodel.addAttribute(\"ExecutorBlockStrategyEnum\", ExecutorBlockStrategyEnum.values());\t    // 阻塞处理策略-字典\n\t\tmodel.addAttribute(\"ScheduleTypeEnum\", ScheduleTypeEnum.values());\t    \t\t\t\t// 调度类型\n\t\tmodel.addAttribute(\"MisfireStrategyEnum\", MisfireStrategyEnum.values());\t    \t\t\t// 调度过期策略\n\n\t\t// 执行器列表\n\t\tList<XxlJobGroup> jobGroupListTotal =  xxlJobGroupMapper.findAll();\n\n\t\t// filter group\n\t\tList<XxlJobGroup> jobGroupList = JobGroupPermissionUtil.filterJobGroupByPermission(request, jobGroupListTotal);\n\t\tif (CollectionTool.isEmpty(jobGroupList)) {\n\t\t\tthrow new XxlJobException(I18nUtil.getString(\"jobgroup_empty\"));\n\t\t}\n\n\t\t// parse jobGroup\n\t\tif (!(CollectionTool.isNotEmpty(jobGroupList)\n\t\t\t\t&& jobGroupList.stream().map(XxlJobGroup::getId).toList().contains(jobGroup))) {\n\t\t\tjobGroup = -1;\n\t\t}\n\n\t\tmodel.addAttribute(\"JobGroupList\", jobGroupList);\n\t\tmodel.addAttribute(\"jobGroup\", jobGroup);\n\n\t\treturn \"business/job.list\";\n\t}\n\n\t@RequestMapping(\"/pageList\")\n\t@ResponseBody\n\tpublic Response<PageModel<XxlJobInfo>> pageList(HttpServletRequest request,\n\t\t\t\t\t\t\t\t\t\t\t\t\t@RequestParam(required = false, defaultValue = \"0\") int offset,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobInfoController.java#L48-L84","documentation":"Thrown by JobInfoController.index when the permission-filtered job group list is empty. JobGroupPermissionUtil.filterJobGroupByPermission returns only job groups the current user is authorized to see. If the result is empty, the user has no job group permissions at all, so the job management page cannot render. Thrown as XxlJobException with i18n key 'jobgroup_empty'.","triggerScenarios":"A user with no assigned job group roles accesses the job management page. All job groups were deleted from xxl_job_group. The permission filter is too restrictive and excludes all groups for this user's role. A new user account was created without being granted executor/group permissions.","commonSituations":"New admin or operator account that hasn't been granted executor group permissions. Job groups were cleaned up during maintenance and none remain. Permission configuration mismatch between the user's role and the job group permission mappings.","solutions":["Check if any job groups exist: SELECT id, app_name, title FROM xxl_job_group.","If groups exist, verify the current user has permission — check the job group permission configuration in XXL-Job admin (typically role-to-group mappings or the user's associated executor groups).","Create at least one executor group in XXL-Job admin → Executor Management → Add, then grant the user access to it.","If using the permission filter, check JobGroupPermissionUtil's logic — it may filter based on request roles or headers that are misconfigured."],"exampleFix":"// before: no guard on the frontend — user sees a blank page or error\nrouter.push('/jobinfo');\n\n// after: check permissions before navigating\nconst groups = await fetchJobGroups();\nif (!groups || groups.length === 0) {\n  message.error('No executor groups available. Contact admin to assign permissions.');\n  return;\n}\nrouter.push('/jobinfo');","handlingStrategy":"validation","validationCode":"// Check if user has any authorized job groups before loading the page\npublic boolean hasAuthorizedJobGroups(HttpServletRequest request) {\n    List<XxlJobGroup> allGroups = xxlJobGroupMapper.findAll();\n    List<XxlJobGroup> filtered = JobGroupPermissionUtil.filterJobGroupByPermission(request, allGroups);\n    return !CollectionTool.isEmpty(filtered);\n}","typeGuard":null,"tryCatchPattern":"try {\n    return \"business/job.list\";\n} catch (XxlJobException e) {\n    if (e.getMessage().contains(\"jobgroup_empty\")) {\n        model.addAttribute(\"error\", \"No executor groups assigned. Contact admin.\");\n        return \"business/job.list\";\n    }\n    throw e;\n}","preventionTips":["Grant executor group permissions to users who need to manage jobs.","Ensure at least one executor group exists and is registered before users access the job management page.","Check permission configuration in XXL-Job admin for new user accounts.","Create executor groups proactively during initial setup."],"tags":["xxl-job","job-group","permissions","executor","i18n"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}