{"record":{"id":"bad9f54f031951b7","repo":"flowable/flowable-engine","slug":"error-while-generating-process-diagram-image-will","errorCode":null,"errorMessage":"Error while generating process diagram, image will not be stored in repository","messagePattern":"Error while generating process diagram, image will not be stored in repository","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/deployer/BpmnDeployer.java","lineNumber":165,"sourceCode":"\n                    String diagramResourceName = getDiagramResourceForProcess(resourceName, processDefinition.getKey(), resources);\n\n                    // Only generate the resource when deployment is new to prevent modification of deployment resources\n                    // after the process-definition is actually deployed. Also to prevent resource-generation failure every\n                    // time the process definition is added to the deployment-cache when diagram-generation has failed the first time.\n                    if (deployment.isNew()) {\n                        if (processEngineConfiguration.isCreateDiagramOnDeploy() &&\n                                diagramResourceName == null && processDefinition.isGraphicalNotationDefined()) {\n\n                            try {\n                                byte[] diagramBytes = IoUtil.readInputStream(processEngineConfiguration.getProcessDiagramGenerator().generateDiagram(bpmnParse.getBpmnModel(), \"png\", processEngineConfiguration.getActivityFontName(),\n                                        processEngineConfiguration.getLabelFontName(), processEngineConfiguration.getAnnotationFontName(),\n                                        processEngineConfiguration.getClassLoader(),processEngineConfiguration.isDrawSequenceFlowNameWithNoLabelDI()), null);\n                                diagramResourceName = getProcessImageResourceName(resourceName, processDefinition.getKey(), \"png\");\n                                createResource(diagramResourceName, diagramBytes, deployment);\n\n                            } catch (Throwable t) { // if anything goes wrong, we don't store the image (the process will still be executable).\n                                LOGGER.warn(\"Error while generating process diagram, image will not be stored in repository\", t);\n                            }\n                        }\n                    }\n\n                    processDefinition.setDiagramResourceName(diagramResourceName);\n                    processDefinition.setEngineVersion(\"v5\");\n                    processDefinitions.add(processDefinition);\n                    bpmnModelMap.put(processDefinition.getKey(), bpmnParse.getBpmnModel());\n                }\n            }\n        }\n\n        // check if there are process definitions with the same process key to prevent database unique index violation\n        List<String> keyList = new ArrayList<>();\n        for (ProcessDefinitionEntity processDefinition : processDefinitions) {\n            if (keyList.contains(processDefinition.getKey())) {\n                throw new ActivitiException(\"The deployment contains process definitions with the same key '\" + processDefinition.getKey() + \"' (process id attribute), this is not allowed\");\n            }","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable5-engine/src/main/java/org/activiti/engine/impl/bpmn/deployer/BpmnDeployer.java#L147-L183","documentation":"During deployment, BpmnDeployer generates a PNG process diagram for each process definition when diagram generation is enabled. If any step of diagram generation throws, this warning is logged, the image is not stored as a deployment resource, and the deployment proceeds because the process remains executable.","triggerScenarios":"createDiagram / ProcessDiagramGenerator throws (e.g. invalid or missing BPMN DI (diagram interchange) information, bad fonts, classloader issues) while isCreateDiagramOnDeploy is true.","commonSituations":"BPMN XML without BPMNDiagram/BPMNPlane DI sections; missing or incompatible fonts for configured label/annotation font names; corrupted models generated by tools.","solutions":["Add valid BPMNDiagram DI sections to the BPMN XML (re-save from the modeler)","Disable diagram generation: set createDiagramOnDeploy=false on ProcessEngineConfiguration","Check the configured labelFontName/annotationFontName are valid fonts available to the JVM"],"exampleFix":"// before\n<property name=\"createDiagramOnDeploy\" value=\"true\"/>\n// after (if DI cannot be fixed)\n<property name=\"createDiagramOnDeploy\" value=\"false\"/>","handlingStrategy":"validation","validationCode":"BpmnModel model = converter.convertToBpmnModel(...);\nboolean hasDi = model.getLocationMap() != null && !model.getLocationMap().isEmpty();\nif (!hasDi) config.setCreateDiagramOnDeploy(false);","typeGuard":"boolean hasDiagramInfo(BpmnModel m) { return m != null && m.getLocationMap() != null && !m.getLocationMap().isEmpty(); }","tryCatchPattern":"try { byte[] png = generator.generateDiagram(...); } catch (Throwable t) { LOGGER.warn(\"diagram skipped\", t); }","preventionTips":["Export BPMN with DI information included","Validate font names configured on the engine exist in the deployment environment","Accept the warning as non-fatal; the process still deploys"],"tags":["deployment","diagram","bpmn"],"backgroundTag":"file-write-failed","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"}