{"record":{"id":"8fdfbac2919c06bc","repo":"apache/incubator-seata","slug":"the-version-must-not-be-blank","errorCode":null,"errorMessage":"The version must not be blank.","messagePattern":"The version must not be blank\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/protocol/Version.java","lineNumber":120,"sourceCode":"    }\n\n    public static boolean isV0(String version) {\n        return !isAboveOrEqualVersion(version, VERSION_0_7_1);\n    }\n\n    public static boolean isAboveOrEqualVersion(String clientVersion, String divideVersion) {\n        boolean isAboveOrEqualVersion = false;\n        try {\n            isAboveOrEqualVersion = convertVersion(clientVersion) >= convertVersion(divideVersion);\n        } catch (Exception e) {\n            LOGGER.error(\"convert version error, clientVersion:{}\", clientVersion, e);\n        }\n        return isAboveOrEqualVersion;\n    }\n\n    public static long convertVersion(String version) throws IncompatibleVersionException {\n        if (StringUtils.isBlank(version)) {\n            throw new IllegalArgumentException(\"The version must not be blank.\");\n        }\n\n        String[] parts = StringUtils.split(version, '.');\n        int size = parts.length;\n        if (size > MAX_VERSION_DOT + 1) {\n            throw new IncompatibleVersionException(\"incompatible version format:\" + version);\n        }\n\n        long result = 0L;\n        int i = 1;\n        size = MAX_VERSION_DOT + 1;\n        for (String part : parts) {\n            if (StringUtils.isNumeric(part)) {\n                result += calculatePartValue(part, size, i);\n            } else {\n                String[] subParts = StringUtils.split(part, '-');\n                if (StringUtils.isNumeric(subParts[0])) {\n                    result += calculatePartValue(subParts[0], size, i);","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/protocol/Version.java#L102-L138","documentation":"Version.convertVersion parses dotted version strings into a comparable long. It throws IllegalArgumentException when the input is null, empty, or whitespace — the version metadata that should identify the peer was never set.","triggerScenarios":"convertVersion(\"\") reached via isAboveOrEqualVersion(clientVersion, divideVersion) when one side of the comparison has a blank version — e.g. a hand-built RpcMessage missing the version header, or a custom client that never sets its version string during handshake.","commonSituations":"Custom/embedded Seata client code skipping the version handshake; test harnesses constructing messages directly; a proxy stripping identity headers; isAboveOrEqualVersion swallows this and logs 'convert version error', so the visible symptom is a silently false comparison.","solutions":["Set the version (e.g. via Version.set, or the standard client bootstrap that populates it) before any RPC that includes version negotiation.","If using isAboveOrEqualVersion, note it catches this error and returns false — check the error log for 'convert version error' to find the blank side.","Pass a literal version like \"2.0.0\" in custom integrations instead of a value read from an unset property."],"exampleFix":"// before\nboolean ok = Version.isAboveOrEqualVersion(System.getProperty(\"app.seata.version\"), \"1.6.0\");\n// after\nboolean ok = Version.isAboveOrEqualVersion(\"2.0.0\", \"1.6.0\");","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(version)) {\n    version = \"2.0.0\"; // sane default, or fail loudly at config load\n}\nboolean above = Version.isAboveOrEqualVersion(version, \"1.6.0\");","typeGuard":"boolean isUsableVersion(String v) { return v != null && !v.isBlank(); }","tryCatchPattern":"catch (IllegalArgumentException e) {\n    if (e.getMessage().contains(\"must not be blank\")) { useDefaultVersionAndLog(); }\n    else throw e;\n}","preventionTips":["Always populate the version field in custom client handshakes","Watch for 'convert version error' in logs — isAboveOrEqualVersion hides this failure as false"],"tags":["version","validation","handshake"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}