EpicGames/lore · error

Failed to create stores

Error message

Failed to create stores

What it means

A Rust test panic from `.expect("Failed to create stores")` on `test_store_create()` in `parse_client_identify_opcode_returns_variant` (lore-server/src/quic/storage_service_v4.rs:539). The shared helper `test_store_create` (which builds an immutable store, a mutable store, and an ExecutionContext via `lore_storage::local` backends under a LORE_CONTEXT scope) returned a `lore_storage::StoreError`, so the test cannot construct the StorageServiceV4 fixture. The stores are only needed to instantiate the service; the parse itself doesn't use them.

Solutions

  1. Surface the real StoreError: `.unwrap_or_else(|e| panic!("Failed to create stores: {e:?}"))` and rerun to see whether it is an IO/permission/path error.
  2. Check the test environment: ensure the temp directory used by `lore_storage::local` exists, is writable, and any required env vars/config are set.
  3. Verify `test_store_create` (lore-server/src/store/mod.rs:232) and `setup_test_execution` still match the current `lore_storage::local` create APIs; update the helper if the backend changed.
  4. Rerun with a clean build/target dir to rule out stale test state from a previous run.

Example fix

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

Strategy: retry

Validate before calling

// Pre-flight: verify the temp root the local stores use is writable
let dir = std::env::temp_dir();
assert!(dir.exists() && !dir.metadata().unwrap().permissions().readonly(),
        "temp dir must exist and be writable for store fixtures");

Try / catch

let (immutable, mutable, exec) = test_store_create()
    .await
    .unwrap_or_else(|e| panic!("Failed to create stores: {e:?}"));

Prevention

When it happens

Trigger: Calling `test_store_create().await` in a `#[tokio::test]` and the local store backend fails to initialize — e.g. temp-directory creation/permission failure, `lore_storage::local::immutable_store::create` erroring, or `setup_test_execution()`/LORE_CONTEXT scope misconfigured.

Common situations: Happens on machines/CI where the test temp root is read-only or full, when environment variables the local store backend relies on are unset, or after a change to the store-creation helper's signature or the local backend's init requirements.

Related errors


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

Appendix: source

Thrown at lore-server/src/quic/storage_service_v4.rs:539

            immutable_store.clone(),
            mutable_store,
            Arc::new(UserAgentFilter::default()),
        )
    }

    fn make_header(cmd: u8) -> CommandHeader {
        CommandHeader {
            cmd,
            ..CommandHeader::default()
        }
    }

    #[tokio::test]
    async fn parse_client_identify_opcode_returns_variant() {
        use lore_transport::quic::storage_service::Command;
        // The stores are unused by parse_request_bytes, so a minimal service suffices.
        let (immutable_store, mutable_store, _exec) =
            test_store_create().await.expect("Failed to create stores");
        let service = make_service(immutable_store, mutable_store);

        let header = make_header(Command::ClientIdentify as u8);
        let payload = Bytes::from("my-client/1.0");

        let parsed = service
            .parse_request_bytes(&header, payload)
            .expect("parsing a ClientIdentify request must succeed");

        assert!(
            matches!(parsed, ParsedStorageRequestV4::ClientIdentify(_)),
            "expected ClientIdentify variant, got {parsed:?}"
        );
    }

    #[tokio::test]
    async fn parse_client_identify_stores_value() {
        use lore_transport::quic::storage_service::Command;

View on GitHub (pinned to 074eb0b0d1)