jeecgboot/JeecgBoot · error · RuntimeException
joblog_logid_invalid
joblog_logid_invalid
Error message
joblog_logid_invalid
What it means
Thrown by JobLogController.logDetailPage when xxlJobLogMapper.load(id) returns null. This means the requested execution log ID does not exist in xxl_job_log — the log was either purged by the log retention policy, the ID is wrong, or the log was never created. The log detail page cannot render without the log record. Message from i18n key 'joblog_logid_invalid'.
Source
Thrown at jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/business/controller/JobLogController.java:268
List<Long> logIds = null;
do {
logIds = xxlJobLogMapper.findClearLogIds(jobGroup, jobId, clearBeforeTime, clearBeforeNum, 1000);
if (logIds!=null && !logIds.isEmpty()) {
xxlJobLogMapper.clearLog(logIds);
}
} while (logIds!=null && !logIds.isEmpty());
return Response.ofSuccess();
}
@RequestMapping("/logDetailPage")
public String logDetailPage(HttpServletRequest request, @RequestParam("id") long id, Model model){
// base check
XxlJobLog jobLog = xxlJobLogMapper.load(id);
if (jobLog == null) {
throw new RuntimeException(I18nUtil.getString("joblog_logid_invalid"));
}
// valid permission
JobGroupPermissionUtil.validJobGroupPermission(request, jobLog.getJobGroup());
// load jobInfo
XxlJobInfo jobInfo = xxlJobInfoMapper.loadById(jobLog.getJobId());
// data
model.addAttribute("triggerCode", jobLog.getTriggerCode());
model.addAttribute("handleCode", jobLog.getHandleCode());
model.addAttribute("logId", jobLog.getId());
model.addAttribute("jobInfo", jobInfo);
return "business/log.detail";
}
@RequestMapping("/logDetailCat")
@ResponseBodyView on GitHub (pinned to 96fb33f5ec)
Solutions
- Verify the log exists: SELECT id, trigger_time, handle_code FROM xxl_job_log WHERE id = <id>.
- If the log was purged, it is gone — check the log retention setting (XXL-Job admin → System Configuration → logRetentionDays) and increase it if needed.
- If the log should exist, check the log cleanup job configuration — it may be running too aggressively.
- On the frontend, handle this error gracefully with a 'Log not found or expired' message rather than showing a raw stack trace.
Example fix
// before: direct navigation without existence check
window.open('/logDetailPage?id=' + logId);
// after: handle missing log gracefully
try {
const res = await api.get(`/joblog/logDetailCat?id=${logId}`);
if (res.data.code !== 200) {
alert('Log not found or has been purged.');
return;
}
window.open('/logDetailPage?id=' + logId);
} catch (e) {
alert('Failed to load log detail.');
} Defensive patterns
Strategy: validation
Validate before calling
// Validate log exists before opening detail page
public boolean logExists(long id) {
return xxlJobLogMapper.load(id) != null;
} Try / catch
try {
return "business/job.log.detail";
} catch (RuntimeException e) {
if (e.getMessage().contains("joblog_logid_invalid")) {
model.addAttribute("error", "Log not found or has been purged.");
return "redirect:/joblog";
}
throw e;
} Prevention
- Increase logRetentionDays in XXL-Job system configuration if logs are being purged too quickly.
- Handle missing log errors gracefully on the frontend with a 'log expired' message.
- Avoid bookmarking individual log detail pages — they are transient by nature.
- Export critical logs to external storage if long-term retention is needed.
When it happens
Trigger: User clicks a log detail link for an old execution that has been cleaned up by XXL-Job's log retention (logRetentionDays). Manually navigating to /logDetailPage?id=99999 with a non-existent log ID. The log was partially written and then purged due to DB cleanup. Concurrent log cleanup (scheduled purge job) deleted the log between the list render and detail click.
Common situations: Old log entries past the retention window (default 30 days). Database cleanup or manual deletion of xxl_job_log rows. User bookmarked a specific log detail page that has since expired. Cron-based log cleanup ran between page load and detail navigation.
Related errors
AI-assisted analysis of jeecgboot/JeecgBoot@96fb33f5ec (2026-08-14).
Data as JSON: /api/errors/d59dd8f12c3ffa4f.
Report an issue: GitHub.