EpicGames/lore · error

Failed to create main store

Error message

Failed to create main store

What it means

create_two_stores builds a main ImmutableStore via test_store_create and panics if creation fails. This is a test helper used by several local-routing tests; the panic means the main test store could not be provisioned (backend init, execution context creation, or schema initialization failed).

Solutions

  1. Run the failing test in isolation with output captured to see test_store_create's underlying error
  2. Ensure the test environment has a writable temp directory and no leftover lock files from prior runs
  3. Update create_two_stores if test_store_create's signature or error behavior changed
  4. Check backend requirements (e.g. embedded DB versions, filesystem permissions) in CI

Example fix

// before
let (main_store, _, execution) = test_store_create().await.expect("Failed to create main store");
// after
let (main_store, _, execution) = test_store_create().await
    .unwrap_or_else(|e| panic!("Failed to create main store: {e:?}"));
Defensive patterns

Strategy: fallback

Validate before calling

// preflight: writable temp dir and no stale lock
let dir = std::env::temp_dir();
assert!(dir.writable(), "temp dir not writable for test store");

Try / catch

match test_store_create().await {
    Ok((store, _, exec)) => { /* use store */ },
    Err(e) => panic!("main store init failed, check backend/env: {e:?}"),
}

Prevention

When it happens

Trigger: test_store_create fails due to unavailable storage backend (e.g. in-memory/temp-dir setup error), missing ExecutionContext configuration, port/resource conflicts, or a breaking change in store initialization APIs.

Common situations: CI environments without writable temp dirs, stale state from previous test runs locking a store path, dependency changes altering test_store_create's signature or behavior so the expect no longer matches.

Related errors


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

Appendix: source

Thrown at lore-server/src/quic/replication_store_service/server.rs:1071

        let service_output = service
            .run_request_handler(AttributeMap::default().into(), parse_output)
            .await
            .expect("handler should succeed even for a miss");
        let parsed_response =
            get_metadata::parse_response(collapse_bytes(&service_output)).expect("Failed to parse");
        assert_eq!(parsed_response.match_made, StoreMatch::MatchNone);
    }

    /// Helper to create a second independent store for local-store routing tests
    async fn create_two_stores() -> (
        Arc<dyn ImmutableStore>,
        Arc<dyn ImmutableStore>,
        Arc<lore_revision::interface::ExecutionContext>,
    ) {
        let (main_store, _, execution) = test_store_create()
            .await
            .expect("Failed to create main store");
        let (local_store, _, _) = test_store_create()
            .await
            .expect("Failed to create local store");
        (main_store, local_store, execution)
    }

    #[tokio::test]
    async fn immutable_local_query_routes_to_local_store() {
        let (main_store, local_store, execution) = create_two_stores().await;

        let repository = random::<Context>();
        let (fragment, address, payload) = fragment::generate_random();

        // put data only in the local store
        {
            let local_store = local_store.clone();
            LORE_CONTEXT
                .scope(execution.clone(), async move {

View on GitHub (pinned to 074eb0b0d1)