{"record":{"id":"c46a453c4056ee8a","repo":"tauri-apps/tauri","slug":"unable-to-autogenerate-out-path","errorCode":null,"errorMessage":"unable to autogenerate {out_path:?}","messagePattern":"unable to autogenerate (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-utils/src/acl/build.rs","lineNumber":309,"sourceCode":"\n    let toml = format!(\n      r###\"{license_header}# Automatically generated - DO NOT EDIT!\n{schema_entry}\n[[permission]]\nidentifier = \"allow-{slugified_command}\"\ndescription = \"Enables the {command} command without any pre-configured scope.\"\ncommands.allow = [\"{command}\"]\n\n[[permission]]\nidentifier = \"deny-{slugified_command}\"\ndescription = \"Denies the {command} command without any pre-configured scope.\"\ncommands.deny = [\"{command}\"]\n\"###,\n    );\n\n    let out_path = path.join(format!(\"{command}.toml\"));\n    write_if_changed(&out_path, toml)\n      .unwrap_or_else(|_| panic!(\"unable to autogenerate {out_path:?}\"));\n\n    autogenerated\n      .allowed\n      .push(format!(\"allow-{slugified_command}\"));\n    autogenerated\n      .denied\n      .push(format!(\"deny-{slugified_command}\"));\n  }\n\n  autogenerated\n}\n\nconst PERMISSION_TABLE_HEADER: &str =\n  \"## Permission Table\\n\\n<table>\\n<tr>\\n<th>Identifier</th>\\n<th>Description</th>\\n</tr>\\n\";\n\n/// Generate a markdown documentation page containing the list of permissions of the plugin.\npub fn generate_docs(\n  permissions: &[PermissionFile],","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-utils/src/acl/build.rs#L291-L327","documentation":"autogenerate_command_permissions writes a default `<command>.toml` permissions file for each ACL command during the Tauri build script. If write_if_changed fails (unwritable directory, permission issue, out_path being a directory), it panics with `unable to autogenerate {out_path:?}`, halting the build script.","triggerScenarios":"Running cargo build where the ACL permissions target directory (e.g. src-tauri/permissions/<plugin>/ orgen dir) cannot be written: read-only checkout, file locked by another process, or a directory already existing at the .toml path.","commonSituations":"Building in a read-only container/CI checkout; the target file is checked out read-only or owned by root after sudo builds; a path collision where `<command>.toml` is a directory; antivirus locking the file on Windows.","solutions":["Ensure the permissions directory exists and is writable (chown/chmod the src-tauri tree)","Delete a stray directory (or locked file) at the reported out_path","Avoid sudo cargo builds that leave root-owned files; `sudo chown -R $USER src-tauri`","Build outside read-only mounts or copy the repo to a writable location"],"exampleFix":"// before\nsudo cargo tauri build   # leaves root-owned permissions dir\n// after\nsudo chown -R $USER:$USER src-tauri/permissions && cargo tauri build","handlingStrategy":"validation","validationCode":"import os, sys, pwd\np = 'src-tauri/permissions'\nif not os.access(p, os.W_OK) and not os.access(os.path.dirname(p) or '.', os.W_OK):\n    sys.exit(f'cannot write ACL permissions into {p}')\nif os.path.isdir(os.path.join(p, 'allow-command.toml')):\n    sys.exit('toml path collides with a directory')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run cargo builds with sudo; chown back any root-owned files","Build in writable workspaces, not read-only mounts","Add permissions-dir writability checks to CI setup","Exclude src-tauri/permissions from tools that lock or quarantine files"],"tags":["acl","permissions","build-script","file-write"],"backgroundTag":"file-write-failed","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}