EpicGames/lore · error

get from local store should work

Error message

get from local store should work

What it means

A Rust test panic from `.expect("get from local store should work")` in `immutable_local_put_routes_to_local_store` (lore-server/src/quic/replication_store_service/server.rs:1286). The test previously wrote data via the ImmutableLocalPut handler and now reads it back with `local_store.get(repository, address)`; the get returned an error (or `into_payload` failed), so the immutable put did not land the data where the test expects. It asserts that ImmutableLocalPut routes writes to the local store only, not the main store.

Solutions

  1. Check whether the preceding `run_request_handler` actually wrote to the local store by listing/reading the local store directly with the same (repository, address) the handler used.
  2. Verify the handler's ImmutableLocalPut path still targets the local store and not the main store; fix the routing if it was inverted.
  3. Confirm the `address` and `repository` values match what the handler derived from the request (hash/payload serialization differences change the address).
  4. Print the StoreError to distinguish NotFound (wrong store/address) from an IO error (env/path problem in the test backend).

Example fix

// before
let get_output = local_store
    .get(repository.into(), address)
    .await
    .and_then(lore_storage::StoreGetData::into_payload)
    .expect("get from local store should work");
// after
let get_output = local_store
    .get(repository.into(), address)
    .await
    .unwrap_or_else(|e| panic!("get from local store failed: {e:?}"))
    .into_payload()
    .expect("payload conversion failed");
Defensive patterns

Strategy: validation

Validate before calling

// Confirm the write landed before asserting the readback
let exists = local_store
    .get(repository.into(), address)
    .await
    .is_ok();
assert!(exists, "expected data at {:?} in local store after put", address);

Type guard

fn read_payload(res: Result<lore_storage::StoreGetData, lore_storage::StoreError>) -> Option<(Vec<u8>, Bytes)> {
    res.ok().and_then(|d| d.into_payload().ok())
}

Try / catch

match local_store.get(repository.into(), address).await {
    Ok(data) => match data.into_payload() {
        Ok(p) => p,
        Err(e) => panic!("payload conversion failed: {e:?}"),
    },
    Err(e) => panic!("local store get failed: {e:?}"),
}

Prevention

When it happens

Trigger: Calling `local_store.get(repository.into(), address).await.and_then(StoreGetData::into_payload)` inside `LORE_CONTEXT.scope(execution, ...)` after a successful handler Put, and either the store returns NotFound/error or the payload conversion fails — i.e. the put wrote to a different store, a different address, or was not committed.

Common situations: Typical when ImmutableLocalPut routing was changed to write into the main store instead of the local one (or vice versa), when the address computed by the handler differs from the `address` the test recomputed, or when the store's async context (`LORE_CONTEXT` scope) is wrong so the local backend can't resolve its path.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


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

Appendix: source

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

            ParsedReplicationStoreRequest::Put(_)
        ));

        let handle_output = service
            .run_request_handler(AttributeMap::default().into(), parse_output)
            .await
            .expect("handler failed");
        assert!(handle_output.is_empty());

        // Verify the data landed in the local store
        {
            let local_store = local_store.clone();
            LORE_CONTEXT
                .scope(execution.clone(), async move {
                    let get_output = local_store
                        .get(repository.into(), address)
                        .await
                        .and_then(lore_storage::StoreGetData::into_payload)
                        .expect("get from local store should work");
                    assert_eq!(get_output.1, payload);
                })
                .await;
        }

        // Verify the data is NOT in the main store
        LORE_CONTEXT
            .scope(execution, async move {
                assert!(
                    main_store
                        .get(repository.into(), address)
                        .await
                        .unwrap_err()
                        .is_address_not_found()
                );
            })
            .await;
    }

View on GitHub (pinned to 074eb0b0d1)