{"record":{"id":"d0d570868fb158d0","repo":"jeecgboot/JeecgBoot","slug":"jobinfo-field-id","errorCode":"jobinfo_field_id","errorMessage":"jobinfo_field_id + system_invalid","messagePattern":"jobinfo_field_id \\+ system_invalid","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobLogController.java","lineNumber":83,"sourceCode":"\t\t\t\t\t\t@RequestParam(value = \"jobId\", required = false, defaultValue = \"0\") Integer jobId) {\n\n\t\t// 1、init JobGroupList\n\t\t// find all jobGroup\n\t\tList<XxlJobGroup> jobGroupListTotal =  xxlJobGroupMapper.findAll();\n\n\t\t// filter JobGroupList\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\t\tList<Integer> jobGroupIds = jobGroupList.stream().map(XxlJobGroup::getId).toList();\n\n\t\t// 2、check jobId\n\t\tif (jobId > 0) {\n\t\t\t// valid jobId\n\t\t\tXxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobId);\n\t\t\tif (jobInfo == null) {\n\t\t\t\tthrow new RuntimeException(I18nUtil.getString(\"jobinfo_field_id\") + I18nUtil.getString(\"system_invalid\"));\n\t\t\t}\n\t\t\t// valid jobGroup\n\t\t\tjobGroup = jobInfo.getJobGroup();\n\t\t}\n\n\t\t// 3、init jobGroup, default first 1\n\t\tif (!jobGroupIds.contains(jobGroup)) {\n\t\t\tjobGroup = jobGroupList.get(0).getId();\n\t\t}\n\n\t\t// 4、init jobInfoList\n\t\tList<XxlJobInfo> jobInfoList = xxlJobInfoMapper.getJobsByGroup(jobGroup);\n\t\tList<Integer> jobIds = jobInfoList.stream().map(XxlJobInfo::getId).toList();\n\n\t\t// 5、init JobId, default 0\n\t\tif (!jobIds.contains(jobId)) {\n\t\t\tjobId = 0;\n\t\t}","sourceCodeStart":65,"sourceCodeEnd":101,"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/JobLogController.java#L65-L101","documentation":"Thrown by JobLogController.index when jobId > 0 but xxlJobInfoMapper.loadById(jobId) returns null. This means the user passed a specific job ID filter (e.g., via URL parameter ?jobId=999) for a job that does not exist. The message is a concatenation of two i18n keys: 'jobinfo_field_id' (label 'Job ID') + 'system_invalid' (label 'invalid'), producing something like 'Job ID invalid'.","triggerScenarios":"Navigating to the job log page with a URL like /joblog?jobId=99999 where job 99999 doesn't exist. The job was deleted but the user accessed a bookmarked filtered URL. The jobId parameter was manually entered incorrectly. Concurrent deletion of a job while a user has a filtered log view open.","commonSituations":"Stale bookmarks pointing to deleted jobs. Deep links shared between users where the target job was later removed. Copy-paste errors in the jobId URL parameter. Testing/debugging with hardcoded jobIds that no longer exist.","solutions":["Verify the job exists: SELECT id, job_desc FROM xxl_job_info WHERE id = <jobId>.","If the job was deleted, navigate to the log page without the jobId filter (just /joblog) and select a valid job from the dropdown.","Update or remove stale bookmarks that reference deleted jobIds.","Add URL parameter validation on the frontend before loading the log page."],"exampleFix":"// before: direct link with hardcoded jobId\n<a href=\"/joblog?jobId=12345\">View Logs</a>\n\n// after: validate jobId before navigating\nasync function viewJobLogs(jobId) {\n  const job = await api.get(`/jobinfo/loadById?id=${jobId}`);\n  if (!job.data) {\n    alert('Job does not exist. Redirecting to log list.');\n    window.location.href = '/joblog';\n    return;\n  }\n  window.location.href = `/joblog?jobId=${jobId}`;\n}","handlingStrategy":"validation","validationCode":"// Validate job exists before using jobId filter on log page\npublic boolean jobExists(int jobId) {\n    if (jobId <= 0) return false;\n    return xxlJobInfoMapper.loadById(jobId) != null;\n}","typeGuard":null,"tryCatchPattern":"try {\n    return \"business/job.log\";\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"system_invalid\")) {\n        model.addAttribute(\"error\", \"Specified job does not exist.\");\n        // Fall through without jobId filter\n        return \"business/job.log\";\n    }\n    throw e;\n}","preventionTips":["Remove stale bookmarks that reference deleted jobIds.","Validate the jobId parameter on the frontend before loading the log page.","When sharing deep links to job logs, verify the jobId still exists.","Handle the invalid jobId gracefully by falling back to the unfiltered log view."],"tags":["xxl-job","job-log","validation","i18n"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}