{"record":{"id":"16df00009fdc0cf3","repo":"apache/incubator-seata","slug":"unknown-store-mode","errorCode":null,"errorMessage":"unknown store mode:{}","messagePattern":"unknown store mode:(.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"common/src/main/java/org/apache/seata/common/store/StoreMode.java","lineNumber":63,"sourceCode":"    private String name;\n\n    StoreMode(String name) {\n        this.name = name;\n    }\n\n    /**\n     * get value of store mode\n     *\n     * @param name the mode name\n     * @return the store mode\n     */\n    public static StoreMode get(String name) {\n        for (StoreMode sm : StoreMode.class.getEnumConstants()) {\n            if (sm.name.equalsIgnoreCase(name)) {\n                return sm;\n            }\n        }\n        throw new IllegalArgumentException(\"unknown store mode:\" + name);\n    }\n\n    /**\n     * whether contains value of store mode\n     *\n     * @param name the mode name\n     * @return the boolean\n     */\n    public static boolean contains(String name) {\n        try {\n            return get(name) != null ? true : false;\n        } catch (IllegalArgumentException e) {\n            return false;\n        }\n    }\n\n    public String getName() {\n        return name;","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/apache/incubator-seata/blob/e01f97c6db397165050caa6764020410c2c8199a/common/src/main/java/org/apache/seata/common/store/StoreMode.java#L45-L81","documentation":"StoreMode.get(name) converts a store.mode configuration string to the StoreMode enum (values such as file, db, redis, raft) case-insensitively. Any unrecognized value throws IllegalArgumentException 'unknown store mode:<name>'. StoreMode.contains(name) wraps get() in try/catch and returns false instead of throwing, for safe validation.","triggerScenarios":"Bootstrap reads store.mode (file.conf / application.yml / CLI arg) and calls StoreMode.get(value); value is null, empty, misspelled, or a non-mode string like 'mysql8', 'oracl', 'none'.","commonSituations":"Typo in store.mode in registry/file configuration; passing a store-mode string from an incompatible older seata version; empty environment variable interpolated to empty string; using a database nickname instead of 'db'.","solutions":["Set store.mode to a supported value (file, db, redis, raft — check your version's enum).","Fix typos and ensure the property is not empty after env-var interpolation.","Pre-validate with StoreMode.contains(name) and fail with a clear config error message."],"exampleFix":"# before\nstore.mode=redis-cluster\n\n# after\nstore.mode=redis","handlingStrategy":"validation","validationCode":"String mode = System.getProperty(\"store.mode\", \"\").trim();\nif (!StoreMode.contains(mode)) {\n    throw new IllegalArgumentException(\"store.mode must be one of file/db/redis/raft, got: '\" + mode + \"'\");\n}\nStoreMode storeMode = StoreMode.get(mode);","typeGuard":null,"tryCatchPattern":"try {\n    StoreMode mode = StoreMode.get(name);\n} catch (IllegalArgumentException e) {\n    // unknown store mode value: surface allowed values and the raw config string\n    throw e;\n}","preventionTips":["Prefer StoreMode.contains() over try/catch when probing supported modes.","Check for empty env-var interpolation (e.g. ${STORE_MODE:} defaulting to blank).","Use 'db' for any JDBC database store, never the vendor name."],"tags":["configuration","enum","store-mode","seata"],"backgroundTag":null,"analyzedSha":"e01f97c6db397165050caa6764020410c2c8199a","analyzedAt":"2026-08-14T10:23:53.097Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}