{"record":{"id":"83d6016885531dcd","repo":"tauri-apps/tauri","slug":"unable-to-autogenerate-default-permission-path","errorCode":null,"errorMessage":"unable to autogenerate {default_permission_path:?}","messagePattern":"unable to autogenerate (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-build/src/acl.rs","lineNumber":206,"sourceCode":"        DefaultPermissionRule::Allow(permissions) => permissions,\n      });\n      if let Some(default_permissions) = default_permissions {\n        let default_permissions = default_permissions\n          .iter()\n          .map(|p| format!(\"\\\"{p}\\\"\"))\n          .collect::<Vec<String>>()\n          .join(\",\");\n        let default_permission = format!(\n          r###\"# Automatically generated - DO NOT EDIT!\n[default]\npermissions = [{default_permissions}]\n\"###\n        );\n\n        let default_permission_path = plugin_out_dir.join(\"default.toml\");\n\n        write_if_changed(&default_permission_path, default_permission)\n          .unwrap_or_else(|_| panic!(\"unable to autogenerate {default_permission_path:?}\"));\n      }\n\n      tauri_utils::acl::build::define_permissions(\n        &PathBuf::from(glob::Pattern::escape(&plugin_out_dir.to_string_lossy()))\n          .join(\"*\")\n          .to_string_lossy(),\n        name,\n        &plugin_out_dir,\n        |_| true,\n      )?\n    };\n\n    if let Some(pattern) = plugin.permissions_path_pattern {\n      permission_files.extend(tauri_utils::acl::build::define_permissions(\n        pattern,\n        name,\n        &plugin_out_dir,\n        |_| true,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/tauri-apps/tauri/blob/dd6befda925845fc74ca595d6d42de6c49580dd8/crates/tauri-build/src/acl.rs#L188-L224","documentation":"Build-time panic in tauri-build's ACL machinery. After collecting the plugin's permission files it autogenerates a `default.toml` (a [default] permission aggregating them) into the plugin's output directory and calls write_if_changed; if that write fails the closure panics with the destination path. It is an environment/IO failure, not a content problem.","triggerScenarios":"The permissions output directory (under the cargo target/ build dir) is not writable: an earlier build ran under root/sudo and left root-owned files, the directory sits on a read-only or network filesystem, an antivirus/IDE has the file locked, or the disk is full.","commonSituations":"Mixed sudo/non-sudo cargo builds on Linux/macOS; CI caches restored with a different user; workspace vendored onto a read-only mount; CI runners out of disk space.","solutions":["Delete the stale generated permissions output (or `cargo clean`) and rebuild","Fix ownership of the target directory: `sudo chown -R $(whoami) target` (or the whole workspace)","Never run cargo/tauri as root; free disk space and exclude the target dir from antivirus/lockers"],"exampleFix":"# before: panic!(\"unable to autogenerate .../permissions/default.toml\")\nsudo cargo tauri build   # root-owned artifacts poison later builds\n\n# after\ncargo clean\ncargo tauri build         # run as the normal user from now on","handlingStrategy":"validation","validationCode":"#!/usr/bin/env bash\n# run before cargo tauri build\ndir=\"${CARGO_TARGET_DIR:-target}\"\nif [ -d \"$dir\" ] && [ ! -w \"$dir\" ]; then echo \"target dir not writable (sudo build residue?)\"; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never build with sudo; fix ownership with chown if it already happened","In CI, avoid caching the generated permissions dir across users; clean caches when builds start failing on write","Keep the target directory on a local writable filesystem and monitor disk space"],"tags":["tauri-build","acl","permissions","build","filesystem"],"backgroundTag":"build-dir-write-failed","analyzedSha":"dd6befda925845fc74ca595d6d42de6c49580dd8","analyzedAt":"2026-08-20T13:59:20.734Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}