{"record":{"id":"2f7ac6fffe2e8f6e","repo":"apache/incubator-seata","slug":"unknown-codec-name","errorCode":null,"errorMessage":"unknown codec:{name}","messagePattern":"unknown codec:(.+?)","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/seata/core/compressor/CompressorType.java","lineNumber":94,"sourceCode":"                return b;\n            }\n        }\n        throw new IllegalArgumentException(\"unknown codec:\" + code);\n    }\n\n    /**\n     * Gets result code.\n     *\n     * @param name the code\n     * @return the result code\n     */\n    public static CompressorType getByName(String name) {\n        for (CompressorType b : CompressorType.values()) {\n            if (b.name().equalsIgnoreCase(name)) {\n                return b;\n            }\n        }\n        throw new IllegalArgumentException(\"unknown codec:\" + name);\n    }\n\n    /**\n     * Gets code.\n     *\n     * @return the code\n     */\n    public byte getCode() {\n        return code;\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":106,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/core/src/main/java/org/apache/seata/core/compressor/CompressorType.java#L76-L106","documentation":"Thrown by CompressorType.getByName(String) when the configured compression name does not match any CompressorType enum (case-insensitive). This runs at configuration-load time when transport.compression / serializer compression is resolved from name to enum.","triggerScenarios":"Setting transport.compression (client) or transport.compression on the server to a typo or unsupported value: 'gizp', 'gzip ' with whitespace, 'snappy', 'lz4' on a build that lacks the lz4 dependency.","commonSituations":"Hand-edited file.conf/yaml with a misspelled codec name; copy-pasted config from a different Seata version that supported a different codec set; codec requiring an optional dependency (e.g. sevenz/bzip2) not on the classpath is still a name-miss if enum absent.","solutions":["Correct the name to one of the enum values, e.g. transport.compression = gzip (exact spelling, no whitespace).","List supported names for your Seata version (CompressorType.values()) before choosing; pick NONE to disable.","After fixing, restart the application — this is resolved at startup."],"exampleFix":"# before\ntransport.compression = gizp\n# after\ntransport.compression = gzip","handlingStrategy":"validation","validationCode":"static boolean validCompressorName(String name) {\n    return Arrays.stream(CompressorType.values()).anyMatch(t -> t.name().equalsIgnoreCase(name.trim()));\n}","typeGuard":"static Optional<CompressorType> safeByName(String name) {\n    String n = name == null ? \"\" : name.trim();\n    return Arrays.stream(CompressorType.values()).filter(t -> t.name().equalsIgnoreCase(n)).findFirst();\n}","tryCatchPattern":null,"preventionTips":["Validate config keys in CI with a config-linter against the enum sets","Trim whitespace in yaml values","Fail startup fast on unknown names rather than discovering at runtime"],"tags":["config","compression","typo","startup"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}