{"record":{"id":"58faf8899db1df7f","repo":"alibaba/COLA","slug":"no-jobexecution-with-id-executionid-found","errorCode":null,"errorMessage":"No jobExecution with id:${executionId} found","messagePattern":"No jobExecution with id:(.+?) found","errorType":"exception","errorClass":"JobException","httpStatus":null,"severity":"error","filePath":"cola-components/cola-component-job/src/main/java/com/alibaba/cola/job/repository/memory/MemoryJobRepository.java","lineNumber":72,"sourceCode":"    }\n\n    @Override\n    public JobExecution saveJobExecution(JobExecution jobExecution) {\n        Assert.notNull(jobExecution, \"jobExecution cannot be null\");\n        Assert.notNull(jobExecution.getJobDef(), \"job cannot be null.\");\n        Assert.notNull(jobExecution.getJobId(), \"jobExecutionId cannot be null.\");\n        jobMap.put(jobExecution.getJobId(), jobExecution);\n        return jobExecution;\n    }\n\n    @Override\n    public void updateJobExecution(JobExecution jobExecution) {\n        Assert.notNull(jobExecution, \"jobExecution cannot be null\");\n        String executionId = jobExecution.getJobId();\n        Assert.notNull(executionId, \"jobExecutionId cannot be null.\");\n        JobExecution oldJobExecution = jobMap.get(executionId);\n        if (oldJobExecution == null) {\n            throw new JobException(\"No jobExecution with id:\" + executionId + \" found\");\n        }\n        jobMap.put(executionId, jobExecution);\n    }\n\n    @Override\n    public void saveStepExecution(StepExecution stepExecution) {\n        Assert.notNull(stepExecution.getJobExecution(), \"jobExecution cannot be null\");\n        String jobExecutionId = stepExecution.getJobExecution().getJobId();\n        String stepName = stepExecution.getStepName();\n        stepMap.put(jobExecutionId + stepName, stepExecution);\n        Set<StepExecution> stepSet = stepSetMap.get(jobExecutionId);\n        if (stepSet == null) {\n            stepSet = new HashSet<>();\n            stepSetMap.put(jobExecutionId, stepSet);\n        }\n        stepSet.add(stepExecution);\n    }\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/alibaba/COLA/blob/352e1a867538d9cd40e1b11e4028fa652fc97557/cola-components/cola-component-job/src/main/java/com/alibaba/cola/job/repository/memory/MemoryJobRepository.java#L54-L90","documentation":"MemoryJobRepository.updateJobExecution looks up the existing JobExecution by jobId in its in-memory map and throws JobException when no entry with that id exists. Updates require the execution to have been saved first; the in-memory store is also empty after restart.","triggerScenarios":"Calling updateJobExecution with a JobExecution whose jobId was never put into the repository, or after a JVM restart wiped the memory map.","commonSituations":"Calling update before saveJobExecution; wrong/ungenerated jobId; in-memory repository used across restarts or across different bean instances in tests; data lost because MEMORY repositoryType is not persistent.","solutions":["Call saveJobExecution (or create) before updateJobExecution for that id","Verify jobExecution.getJobId() is the correct, persisted identifier","Switch repositoryType to DB or REDIS if state must survive restarts"],"exampleFix":"// before\njobRepository.updateJobExecution(execution); // never saved\n// after\njobRepository.saveJobExecution(execution);\nexecution.setStatus(FINISHED);\njobRepository.updateJobExecution(execution);","handlingStrategy":"try-catch","validationCode":"// ensure the execution exists before updating\nif (jobRepository.getJobExecution(execution.getJobId()) == null) {\n    jobRepository.saveJobExecution(execution);\n}","typeGuard":null,"tryCatchPattern":"try {\n    jobRepository.updateJobExecution(execution);\n} catch (JobException e) {\n    if (e.getMessage().startsWith(\"No jobExecution with id:\")) {\n        log.warn(\"Execution {} missing in memory repository; saving anew\", execution.getJobId());\n        jobRepository.saveJobExecution(execution);\n    } else throw e;\n}","preventionTips":["Always save before update in the execution lifecycle","Use DB or REDIS repositoryType when state must survive restarts","Log jobId at creation and propagate the same instance/id through the workflow","In tests, use one shared repository bean instance"],"tags":["java","repository","not-found"],"backgroundTag":"record-not-found","analyzedSha":"352e1a867538d9cd40e1b11e4028fa652fc97557","analyzedAt":"2026-09-08T00:46:23.972Z","contentChangedAt":"2026-09-08T00:46:23.972Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}