EpicGames/lore · error
put should work
Error message
put should work
What it means
In immutable_local_query_routes_to_local_store, the test puts a fragment into the local store via local_store.put(...) and panics if the put fails. The put is expected to always succeed because it is seeding data for the subsequent query-routing assertion; failure means the local store rejected the write.
Solutions
- Check the put error message to identify which precondition failed (context, store state, or argument validation)
- Confirm the put call still matches the current signature (repository, address, fragment, payload Option, bool)
- Ensure the LORE_CONTEXT.scope(execution) wrapper is present and the execution context is the one from create_two_stores
- Verify the fragment/payload sizes are within store limits
Example fix
// before
local_store.put(repository.into(), address, fragment, Some(payload), false).await.expect("put should work");
// after
local_store.put(repository.into(), address, fragment, Some(payload), false).await
.unwrap_or_else(|e| panic!("local store put failed: {e:?}")); Defensive patterns
Strategy: try-catch
Validate before calling
// ensure context scope and store readiness before puts assert!(LORE_CONTEXT.try_with(|_| true).is_ok(), "LORE_CONTEXT not active");
Try / catch
match local_store.put(repository.into(), address, fragment, Some(payload), false).await {
Ok(_) => {},
Err(e) => panic!("seeding put failed: {e:?} — check signature, context scope, store state"),
} Prevention
- Keep put call sites updated when the signature/flag arguments change
- Always wrap seeding writes in LORE_CONTEXT.scope with the correct ExecutionContext
- Verify store initialization succeeded before writing
- Validate fragment/payload sizes against store limits in test fixtures
When it happens
Trigger: put returns Err due to store capacity/config issues, wrong repository/address/fragment arguments after API changes, the ExecutionContext scope not being active (LORE_CONTEXT.scope), or a store that was not properly initialized.
Common situations: Refactors changing the put signature (the trailing bool flag) leaving arguments misaligned, missing context causing internal put errors, or the local store being dropped/closed before the puts complete.
Related errors
- Failed to create main store
- Failed to create local store
- file refused further writes
- file refused further writes
- handler should succeed even for a miss
AI-assisted analysis of EpicGames/lore@074eb0b0d1 (2026-09-13).
Data as JSON: /api/errors/bc0b2a61fa9b9fce.
Report an issue: GitHub.
Appendix: source
Thrown at lore-server/src/quic/replication_store_service/server.rs:1093
(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 {
local_store
.put(repository.into(), address, fragment, Some(payload), false)
.await
.expect("put should work");
})
.await;
}
let request = Query {
header: ReplicationHeader {
correlation_id: Uuid::new_v4(),
repository,
},
addresses: vec![address],
};
let service = ReplicationStoreService::new(
main_store.clone(),
local_store.clone(),
Arc::new(UserAgentFilter::default()),
);
View on GitHub (pinned to 074eb0b0d1)