{"record":{"id":"715641c8a2e1fee0","repo":"EpicGames/lore","slug":"failed-to-create-main-store","errorCode":null,"errorMessage":"Failed to create main store","messagePattern":"Failed to create main store","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"lore-server/src/quic/replication_store_service/server.rs","lineNumber":1071,"sourceCode":"\n        let service_output = service\n            .run_request_handler(AttributeMap::default().into(), parse_output)\n            .await\n            .expect(\"handler should succeed even for a miss\");\n        let parsed_response =\n            get_metadata::parse_response(collapse_bytes(&service_output)).expect(\"Failed to parse\");\n        assert_eq!(parsed_response.match_made, StoreMatch::MatchNone);\n    }\n\n    /// Helper to create a second independent store for local-store routing tests\n    async fn create_two_stores() -> (\n        Arc<dyn ImmutableStore>,\n        Arc<dyn ImmutableStore>,\n        Arc<lore_revision::interface::ExecutionContext>,\n    ) {\n        let (main_store, _, execution) = test_store_create()\n            .await\n            .expect(\"Failed to create main store\");\n        let (local_store, _, _) = test_store_create()\n            .await\n            .expect(\"Failed to create local store\");\n        (main_store, local_store, execution)\n    }\n\n    #[tokio::test]\n    async fn immutable_local_query_routes_to_local_store() {\n        let (main_store, local_store, execution) = create_two_stores().await;\n\n        let repository = random::<Context>();\n        let (fragment, address, payload) = fragment::generate_random();\n\n        // put data only in the local store\n        {\n            let local_store = local_store.clone();\n            LORE_CONTEXT\n                .scope(execution.clone(), async move {","sourceCodeStart":1053,"sourceCodeEnd":1089,"githubUrl":"https://github.com/EpicGames/lore/blob/074eb0b0d1194c997d7cf28b55519e3e197b3e23/lore-server/src/quic/replication_store_service/server.rs#L1053-L1089","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run the failing test in isolation with output captured to see test_store_create's underlying error","Ensure the test environment has a writable temp directory and no leftover lock files from prior runs","Update create_two_stores if test_store_create's signature or error behavior changed","Check backend requirements (e.g. embedded DB versions, filesystem permissions) in CI"],"exampleFix":"// before\nlet (main_store, _, execution) = test_store_create().await.expect(\"Failed to create main store\");\n// after\nlet (main_store, _, execution) = test_store_create().await\n    .unwrap_or_else(|e| panic!(\"Failed to create main store: {e:?}\"));","handlingStrategy":"fallback","validationCode":"// preflight: writable temp dir and no stale lock\nlet dir = std::env::temp_dir();\nassert!(dir.writable(), \"temp dir not writable for test store\");","typeGuard":null,"tryCatchPattern":"match test_store_create().await {\n    Ok((store, _, exec)) => { /* use store */ },\n    Err(e) => panic!(\"main store init failed, check backend/env: {e:?}\"),\n}","preventionTips":["Clean stale temp/lock files between CI runs","Verify writable temp directories in CI images","Keep test_store_create's signature and store-creation API changes synchronized with helpers","Limit parallel test workers when store creation is resource-heavy"],"tags":["rust","test","store","initialization"],"backgroundTag":"module-init-failed","analyzedSha":"074eb0b0d1194c997d7cf28b55519e3e197b3e23","analyzedAt":"2026-09-13T09:00:57.509Z","contentChangedAt":"2026-09-13T09:00:57.509Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}