EpicGames/lore · error

Failed to create store

Error message

Failed to create store

What it means

This is a `.expect("Failed to create store")` panic in the `test_command` QUIC integration test when the shared `test_store_create()` helper fails to build the immutable store, mutable store, and execution context. The helper initializes a temporary repository-backed store inside the LORE_CONTEXT runtime scope; any StoreError from setup (temp dir creation, store initialization, state serialization) aborts the test with this message.

Solutions

  1. Check the underlying StoreError source in the panic message to identify which setup step failed
  2. Verify TMPDIR is writable and has free space in the test environment
  3. Run `cargo test -p lore-server test_command -- --nocapture` to see the full error chain
  4. Fix the store/execution initialization regression in lore-server/src/store/mod.rs test_store_create

Example fix

// before
let (immutable_store, mutable_store, execution) =
    test_store_create().await.expect("Failed to create store");
// after
let (immutable_store, mutable_store, execution) = test_store_create()
    .await
    .unwrap_or_else(|e| panic!("test store setup failed: {e:?}"));
Defensive patterns

Strategy: try-catch

Validate before calling

// Rust: assert setup succeeds with context instead of bare expect
let stores = test_store_create().await.unwrap_or_else(|e|
    panic!("test store setup failed: {e:?}"));

Try / catch

match test_store_create().await {
    Ok((i, m, e)) => (i, m, e),
    Err(err) => panic!("store setup failed: {err:?}"),
}

Prevention

When it happens

Trigger: `test_store_create().await.expect(...)` returns Err — e.g. the temp repository directory cannot be created/written, the ExecutionContext or store backends fail to initialize, or the tokio runtime context (LORE_CONTEXT) is not set up as the helper expects.

Common situations: Running tests in a sandboxed CI without writable temp space; disk-full or permission-restricted TMPDIR; a regression in store initialization code that the 160+ tests sharing this helper immediately expose; running the test outside the expected async runtime setup.

Related errors


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

Appendix: source

Thrown at lore-server/src/quic/stream_handler.rs:1090

    impl StreamHandlerFactory for SingleServiceFactory {
        fn supported_protocols(&self) -> Vec<String> {
            self.service_store.get_supported_services()
        }

        fn get_stream_handler_builder(
            &self,
            protocol: &str,
        ) -> Option<(&&'static str, &StreamDataHandlerBuilder)> {
            self.service_store.get_stream_builder(protocol)
        }
    }

    #[tokio::test]
    async fn test_command() {
        let repository = random::<Context>();

        let (immutable_store, mutable_store, execution) =
            test_store_create().await.expect("Failed to create store");
        lore_spawn!(LORE_CONTEXT.scope(execution.clone(), async move {
            let mut harness = serve_and_connect(
                Box::new(TestHandlerFactory::new(
                    immutable_store,
                    mutable_store.clone(),
                )),
                TEST_PROTOCOL,
            )
            .await;

            let token = "some-token";
            let token_bytes = token.as_bytes();

            let header = CommandHeader::new(
                Command::Authorize as QuicOpCode,
                random::<u32>(),
                size_of::<Context>() + token_bytes.len(),
            );

View on GitHub (pinned to 074eb0b0d1)