{"record":{"id":"a38ace348e3f53d9","repo":"tauri-apps/tauri","slug":"failed-to-read-plugin-manifest-map","errorCode":null,"errorMessage":"failed to read plugin manifest map","messagePattern":"failed to read plugin manifest map","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-codegen/src/context.rs","lineNumber":396,"sourceCode":"      if !sets_isolation_hook {\n        panic!(\"The isolation application does not contain a file setting the `window.__TAURI_ISOLATION_HOOK__` value.\");\n      }\n\n      let schema = options.isolation_schema;\n\n      quote!(#root::Pattern::Isolation {\n        assets: ::std::sync::Arc::new(#assets),\n        schema: #schema.into(),\n        key: #key.into(),\n        crypto_keys: std::boxed::Box::new(::tauri::utils::pattern::isolation::Keys::new().expect(\"unable to generate cryptographically secure keys for Tauri \\\"Isolation\\\" Pattern\")),\n      })\n    }\n  };\n\n  let acl_file_path = out_dir.join(ACL_MANIFESTS_FILE_NAME);\n  let acl: BTreeMap<String, Manifest> = if acl_file_path.exists() {\n    let acl_file =\n      std::fs::read_to_string(acl_file_path).expect(\"failed to read plugin manifest map\");\n    serde_json::from_str(&acl_file).expect(\"failed to parse plugin manifest map\")\n  } else {\n    Default::default()\n  };\n\n  let capabilities_file_path = out_dir.join(CAPABILITIES_FILE_NAME);\n  let capabilities_from_files = if capabilities_file_path.exists() {\n    let capabilities_json =\n      std::fs::read_to_string(&capabilities_file_path).expect(\"failed to read capabilities\");\n    serde_json::from_str(&capabilities_json).expect(\"failed to parse capabilities\")\n  } else {\n    Default::default()\n  };\n  let capabilities = get_capabilities(\n    &config,\n    capabilities_from_files,\n    additional_capabilities.as_deref(),\n  )","sourceCodeStart":378,"sourceCodeEnd":414,"githubUrl":"https://github.com/tauri-apps/tauri/blob/52e4b6e71d8632a7e648f866c442e287ecddee34/crates/tauri-codegen/src/context.rs#L378-L414","documentation":"Build-time panic in tauri-codegen while loading the ACL manifest cache. tauri-build writes acl-manifests.json into OUT_DIR during dependency collection; tauri-codegen later does std::fs::read_to_string(acl_file_path).expect(\"failed to read plugin manifest map\"). Because the exists() check already passed, the read itself failed — permissions changed, the file was deleted or locked between check and read, or the content is non-UTF-8.","triggerScenarios":"generate_context! reading OUT_DIR/acl-manifests.json while a concurrent cargo process, antivirus, or cache cleaner removes/locks it; a target directory shared between users with different permissions; a truncated artifact left by a killed build.","commonSituations":"Two cargo/rust-analyzer builds racing in the same target dir (CI matrix jobs sharing a volume); cargo killed mid-build leaving a zero-byte file; permission flips after one build step ran as root.","solutions":["Run cargo clean (or delete the app crate's target directory) and rebuild","Ensure only one cargo process builds the workspace at a time (lock the target dir in CI)","Fix ownership/permissions of target/ (chown -R) and avoid mixing root and user builds","Exclude the target directory from antivirus/backup scanning that may lock files"],"exampleFix":"# before: panic: failed to read plugin manifest map\n\n# after\ncargo clean && cargo build","handlingStrategy":"validation","validationCode":"# CI: serialize builds on a shared target dir and clean interrupted artifacts\nfind target -name acl-manifests.json -size -10c -delete 2>/dev/null || true\ncargo clean -p \"$APP_CRATE\" 2>/dev/null || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run two cargo builds against the same target directory concurrently","Avoid mixing root and user builds; keep target/ owned by the build user","Exclude target/ from antivirus and backup scanners"],"tags":["acl","build","codegen","filesystem"],"backgroundTag":"stale-build-artifact","analyzedSha":"52e4b6e71d8632a7e648f866c442e287ecddee34","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}