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")
	@ResponseBody

View on GitHub (pinned to 96fb33f5ec)

Solutions

  1. Verify the log exists: SELECT id, trigger_time, handle_code FROM xxl_job_log WHERE id = <id>.
  2. If the log was purged, it is gone — check the log retention setting (XXL-Job admin → System Configuration → logRetentionDays) and increase it if needed.
  3. If the log should exist, check the log cleanup job configuration — it may be running too aggressively.
  4. 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

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.