{"record":{"id":"cb123560f266d78b","repo":"iflytek/astron-agent","slug":"sysdata-is-empty-for-version-botid-versionname","errorCode":null,"errorMessage":"SysData is empty for version: botId={}, versionName={}","messagePattern":"SysData is empty for version: botId=(.+?), versionName=(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowReleaseServiceImpl.java","lineNumber":280,"sourceCode":"            }\n\n            String sysData = workflowVersion.getSysData();\n            if (sysData != null && !sysData.trim().isEmpty()) {\n                try {\n                    JSONObject versionData = JSON.parseObject(sysData);\n                    return versionData == null || versionData.isEmpty() ? null : versionData;\n                } catch (Exception e) {\n                    log.error(\n                            \"Failed to parse sysData JSON: botId={}, versionName={}, sysDataLength={}\",\n                            botId,\n                            versionName,\n                            sysData.length(),\n                            e);\n                    return null;\n                }\n            }\n\n            log.warn(\"SysData is empty for version: botId={}, versionName={}\", botId, versionName);\n            return null;\n\n        } catch (Exception e) {\n            log.error(\"Exception occurred while getting version system data: botId={}, versionName={}\",\n                    botId, versionName, e);\n            return null;\n        }\n    }\n\n    /**\n     * Update audit result\n     */\n    private boolean updateAuditResult(\n            Long versionId, String flowId, String auditResult, String executionUid, Long executionSpaceId) {\n        if (versionId == null) {\n            log.warn(\"Version ID is null, skipping audit result update\");\n            return false;\n        }","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/workflow/impl/WorkflowReleaseServiceImpl.java#L262-L298","documentation":"getVersionSysData found the workflow_version row but its sys_data column is null or blank, so there is no serialized system data to return. It logs a warning with botId and versionName and returns null. This usually means the version was published without sysData being persisted.","triggerScenarios":"versionData(botId, versionName) hits a row whose sys_data is empty/null — e.g. publish pipeline failed to write sysData, an older schema/migration left the column empty, or the row was written by a code path that never populates sys_data.","commonSituations":"Versions created before a migration added sys_data; publish interrupted after row insert but before sysData write; a different service overwrote sys_data to empty; environment where JSON serialization of flow data silently failed.","solutions":["Inspect the row: SELECT sys_data FROM workflow_version WHERE bot_id=? AND name=? to confirm emptiness","Re-publish the version so sysData is regenerated and persisted","Backfill sys_data for legacy rows via migration from the bot's current flow data","Add a publish-time assertion that sysData is non-empty before committing the version row"],"exampleFix":"// before\nif (StringUtils.isBlank(sysData)) { return null; }\n// after\nif (StringUtils.isBlank(sysData)) {\n    log.warn(\"SysData empty, regenerating for botId={}, versionName={}\", botId, versionName);\n    return regenerateAndPersistSysData(botId, versionName);\n}","handlingStrategy":"validation","validationCode":"WorkflowVersion v = mapper.selectOne(new LambdaQueryWrapper<WorkflowVersion>()\n    .eq(WorkflowVersion::getBotId, botId).eq(WorkflowVersion::getName, versionName));\nif (v == null || v.getSysData() == null || v.getSysData().isBlank()) {\n    throw new IllegalStateException(\"Version exists but sysData missing for \" + versionName);\n}","typeGuard":"boolean hasSysData(WorkflowVersion v) { return v != null && v.getSysData() != null && !v.getSysData().trim().isEmpty(); }","tryCatchPattern":"try {\n    return mapper.selectOne(qw).getSysData();\n} catch (NullPointerException | IllegalStateException e) {\n    log.error(\"sysData unavailable for botId={}, versionName={}\", botId, versionName, e);\n    return regenerateSysData(botId, versionName);\n}","preventionTips":["Enforce non-empty sysData at publish time with a DB NOT NULL/CHECK constraint","Add a migration to backfill sys_data for legacy version rows","Alert on any inserted workflow_version row with empty sys_data","Re-publish versions after schema upgrades that touch sys_data"],"tags":["java","mybatis","database","empty-data"],"backgroundTag":"empty-required-field","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}