EpicGames/lore · error

Failed to create lock store plugin

Error message

Failed to create lock store plugin '{mode}': {e}

What it means

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.

Solutions

  1. Read the wrapped cause: the plugin's own error message says why creation failed.
  2. Verify the lock store plugin for this mode is registered/compiled in and the mode string is spelled correctly.
  3. Provide the required `[plugins.<mode>]` settings for the lock store and verify backend reachability.
  4. If you don't need distributed locking, set `[lock_store] mode = "none"` (or "local" for in-process locks).

Example fix

// before (settings.toml)
[lock_store]
mode = "redis"

// after (settings.toml)
[lock_store]
mode = "redis"

[plugins.redis]
url = "redis://localhost:6379"
Defensive patterns

Strategy: try-catch

Validate before calling

// Rust
fn validate_lock_store(settings: &Settings) -> Result<(), String> {
    if let Some(ls) = &settings.lock_store {
        if ls.mode != "none" && ls.mode != "local" {
            // must be backed by a registered plugin
            return Err(format!("lock store mode '{}' requires a registered plugin", ls.mode));
        }
    }
    Ok(())
}

Try / catch

match configure_lock_store_via_plugin(&registry, &settings) {
    Ok(Some(store)) => { /* register LockService */ }
    Ok(None) => { /* locking disabled, fine */ }
    Err(e) => {
        for cause in e.chain() { eprintln!("caused by: {cause}"); }
        return Err(e);
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of EpicGames/lore@074eb0b0d1 (2026-09-13). Data as JSON: /api/errors/a16393357387dc68. Report an issue: GitHub.

Appendix: source

Thrown at lore-server/src/server.rs:1006

            return Ok(None);
        }

        if mode == store_mode::LOCAL {
            info!("Creating local (in-memory) lock store");
            let store = crate::lock::store::LocalLockStore::default();
            return Ok(Some(Arc::new(store)));
        }

        // All other modes use the plugin system
        let plugin_config =
            resolve_plugin_config_with_fallback(&settings.plugins, mode, "lock_store")
                .unwrap_or_else(|| toml::Value::Table(toml::map::Map::new()));

        info!(mode, "Creating lock store via plugin system");

        let store = registry
            .create_lock_store(mode, &plugin_config)
            .map_err(|e| anyhow!("Failed to create lock store plugin '{mode}': {e}"))?;

        return Ok(Some(store));
    }

    Ok(None)
}

static LOCAL_STORE: OnceLock<Weak<dyn ImmutableStore>> = OnceLock::new();

fn local_store() -> Option<Arc<dyn ImmutableStore>> {
    LOCAL_STORE.get().and_then(|weak| weak.upgrade())
}

/// Directory under the system temporary directory where the server keeps
/// zero-config artifacts (local stores and ephemeral certificates) when no
/// explicit locations are configured.
fn local_data_dir() -> PathBuf {
    std::env::temp_dir().join("lore-server")

View on GitHub (pinned to 074eb0b0d1)