{"record":{"id":"a16393357387dc68","repo":"EpicGames/lore","slug":"failed-to-create-lock-store-plugin-mode-e","errorCode":null,"errorMessage":"Failed to create lock store plugin '{mode}': {e}","messagePattern":"Failed to create lock store plugin '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lore-server/src/server.rs","lineNumber":1006,"sourceCode":"            return Ok(None);\n        }\n\n        if mode == store_mode::LOCAL {\n            info!(\"Creating local (in-memory) lock store\");\n            let store = crate::lock::store::LocalLockStore::default();\n            return Ok(Some(Arc::new(store)));\n        }\n\n        // All other modes use the plugin system\n        let plugin_config =\n            resolve_plugin_config_with_fallback(&settings.plugins, mode, \"lock_store\")\n                .unwrap_or_else(|| toml::Value::Table(toml::map::Map::new()));\n\n        info!(mode, \"Creating lock store via plugin system\");\n\n        let store = registry\n            .create_lock_store(mode, &plugin_config)\n            .map_err(|e| anyhow!(\"Failed to create lock store plugin '{mode}': {e}\"))?;\n\n        return Ok(Some(store));\n    }\n\n    Ok(None)\n}\n\nstatic LOCAL_STORE: OnceLock<Weak<dyn ImmutableStore>> = OnceLock::new();\n\nfn local_store() -> Option<Arc<dyn ImmutableStore>> {\n    LOCAL_STORE.get().and_then(|weak| weak.upgrade())\n}\n\n/// Directory under the system temporary directory where the server keeps\n/// zero-config artifacts (local stores and ephemeral certificates) when no\n/// explicit locations are configured.\nfn local_data_dir() -> PathBuf {\n    std::env::temp_dir().join(\"lore-server\")","sourceCodeStart":988,"sourceCodeEnd":1024,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/server.rs#L988-L1024","documentation":"configure_lock_store_via_plugin creates the lock store only when a [lock_store] section exists; modes other than \"none\"/\"local\" go through PluginRegistry::create_lock_store. Any Err from the plugin factory is re-wrapped with `anyhow!(\"Failed to create lock store plugin '{mode}': {e}\")` at server.rs:1006, keeping the original plugin error as its source.","triggerScenarios":"A `[lock_store]` section is present with a plugin-mode value (not \"none\" or \"local\") and create_lock_store fails — unregistered mode, missing/malformed [plugins.*] config for the lock store, or the plugin's backend failing during construction.","commonSituations":"Distributed deployments configuring a remote lock store whose backend (e.g. Redis/DB) is misconfigured or unreachable; typo in the lock store mode; lock-store plugin feature not enabled in the build.","solutions":["Read the wrapped cause: the plugin's own error message says why creation failed.","Verify the lock store plugin for this mode is registered/compiled in and the mode string is spelled correctly.","Provide the required `[plugins.<mode>]` settings for the lock store and verify backend reachability.","If you don't need distributed locking, set `[lock_store] mode = \"none\"` (or \"local\" for in-process locks)."],"exampleFix":"// before (settings.toml)\n[lock_store]\nmode = \"redis\"\n\n// after (settings.toml)\n[lock_store]\nmode = \"redis\"\n\n[plugins.redis]\nurl = \"redis://localhost:6379\"","handlingStrategy":"try-catch","validationCode":"// Rust\nfn validate_lock_store(settings: &Settings) -> Result<(), String> {\n    if let Some(ls) = &settings.lock_store {\n        if ls.mode != \"none\" && ls.mode != \"local\" {\n            // must be backed by a registered plugin\n            return Err(format!(\"lock store mode '{}' requires a registered plugin\", ls.mode));\n        }\n    }\n    Ok(())\n}","typeGuard":null,"tryCatchPattern":"match configure_lock_store_via_plugin(&registry, &settings) {\n    Ok(Some(store)) => { /* register LockService */ }\n    Ok(None) => { /* locking disabled, fine */ }\n    Err(e) => {\n        for cause in e.chain() { eprintln!(\"caused by: {cause}\"); }\n        return Err(e);\n    }\n}","preventionTips":["Use mode = \"none\" or \"local\" when distributed locking isn't needed.","Ensure the lock-store plugin and its backend are reachable before startup.","Validate lock_store mode strings and [plugins.*] blocks in CI config checks."],"tags":["plugin","lock-store","configuration","startup"],"backgroundTag":"module-init-failed","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}