{"record":{"id":"6c9de21be340708d","repo":"flowable/flowable-engine","slug":"failedjobretrytimecycle-has-wrong-format-faile-6c9de2","errorCode":null,"errorMessage":"failedJobRetryTimeCycle has wrong format:\" + failedJobRetryTimeCycle","messagePattern":"failedJobRetryTimeCycle has wrong format:\" \\+ failedJobRetryTimeCycle","errorType":"exception","errorClass":"ActivitiException","httpStatus":null,"severity":"error","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/JobRetryCmd.java","lineNumber":128,"sourceCode":"                    newJobEntity = deadLetterJob;\r\n                } else {\r\n                    TimerJobEntity timerJob = new TimerJobEntity(job);\r\n                    timerJob.insert();\r\n                    newJobEntity = timerJob;\r\n                }\r\n\r\n                newJobEntity.setDuedate(durationHelper.getDateAfter());\r\n\r\n                if (job.getExceptionMessage() == null) { // is it the first exception\r\n                    LOGGER.debug(\"Applying JobRetryStrategy '{}' the first time for job {} with {} retries\", failedJobRetryTimeCycle, job.getId(), durationHelper.getTimes());\r\n\r\n                } else {\r\n                    LOGGER.debug(\"Decrementing retries of JobRetryStrategy '{}' for job {}\", failedJobRetryTimeCycle, job.getId());\r\n                }\r\n                newJobEntity.setRetries(jobRetries - 1);\r\n\r\n            } catch (Exception e) {\r\n                throw new ActivitiException(\"failedJobRetryTimeCycle has wrong format:\" + failedJobRetryTimeCycle, exception);\r\n            }\r\n        }\r\n\r\n        if (exception != null) {\r\n            newJobEntity.setExceptionMessage(exception.getMessage());\r\n            newJobEntity.setExceptionStacktrace(getExceptionStacktrace());\r\n        }\r\n\r\n        job.delete();\r\n\r\n        // Dispatch both an update and a retry-decrement event\r\n        FlowableEventDispatcher eventDispatcher = commandContext.getEventDispatcher();\r\n        if (eventDispatcher.isEnabled()) {\r\n            eventDispatcher.dispatchEvent(ActivitiEventBuilder.createEntityEvent(\r\n                    FlowableEngineEventType.ENTITY_UPDATED, newJobEntity), EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\r\n            eventDispatcher.dispatchEvent(ActivitiEventBuilder.createEntityEvent(\r\n                    FlowableEngineEventType.JOB_RETRIES_DECREMENTED, newJobEntity), EngineConfigurationConstants.KEY_PROCESS_ENGINE_CONFIG);\r\n        }\r","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/cmd/JobRetryCmd.java#L110-L146","documentation":"Thrown from JobRetryCmd.execute() when parsing the failedJobRetryTimeCycle value fails while decrementing job retries. The retry time cycle (e.g. \"R5/PT7M\") is parsed with a DurationHelper; any exception during parsing is rethrown as ActivitiException with the offending value, wrapping the original exception.","triggerScenarios":"A job fails and its boundary event/failed job retry configuration has a malformed time cycle string (missing R prefix, bad ISO-8601 duration like \"7 minutes\" or \"R/PT10M\"); the async executor then attempts to compute the next retry and hits the parse error.","commonSituations":"Typo in flowable:failedJobRetryTimeCycle extension element in BPMN XML; copy-pasted cycle with wrong separator (comma instead of slash); Spring/XSD not validating the attribute so bad values deploy unnoticed.","solutions":["Fix the failedJobRetryTimeCycle value in the BPMN XML to valid ISO-8601 (e.g. R5/PT7M)","Redeploy the process definition with the corrected extension attribute","Check the wrapped 'exception' cause in the message/log for the exact parse failure","Validate the cycle expression before deployment (unit-test DurationHelper.parse)"],"exampleFix":"// before\n<flowable:failedJobRetryTimeCycle value=\"5/7 minutes\" />\n// after\n<flowable:failedJobRetryTimeCycle value=\"R5/PT7M\" />","handlingStrategy":"validation","validationCode":"// validate retry cycle at deploy time\njava.time.Duration.parse(\"PT7M\"); // cycle must be ISO-8601 like R5/PT7M\nif (!cycle.matches(\"R\\\\d*/PT?[^/]+\")) throw new IllegalArgumentException(\"bad failedJobRetryTimeCycle: \" + cycle);","typeGuard":null,"tryCatchPattern":"try { jobExecutor handling } catch (ActivitiException e) { if (e.getMessage().contains(\"failedJobRetryTimeCycle\")) { fixBpmnAndRedeploy(); } throw e; }","preventionTips":["Always use ISO-8601 repetition format (Rn/PT) in failedJobRetryTimeCycle","Add BPMN lint/deploy-time tests parsing every retry cycle used","Read the wrapped cause exception in logs for the exact parse error"],"tags":["java","activiti","configuration","retry","iso8601"],"backgroundTag":"invalid-argument-format","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}