#Problem with http permission

18 messages ยท Page 1 of 1 (latest)

meager panther
#

Hello Everyone hope you are going great i need help find what am i doing wrong. so basically i want my app to make some api call to a local server and it works great in development but when i try to bundle my app and launch it something happen.
the error is

thread 'main' panicked at src/lib.rs:36:10:
error while running tauri application: PluginInitialization("http", "Permission denied (os error 13)")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

but i try to add capabilities in capabilities/default.json:

{
  "$schema": "../gen/schemas/desktop-schema.json",
  "identifier": "default",
  "description": "enables the default permissions",
  "windows": [
    "main"
  ],
  "permissions": [
    "core:default",
    {
      "identifier": "shell:allow-execute",
      "allow": [
        {
          "name": "exec-sh",
          "cmd": "sh",
          "args": [
            "-c",
            {
              "validator": "\\S+"
            }
          ],
          "sidecar": false
        }
      ]
    },
    {
      "identifier": "http:default",
      "allow": [{ "url": "https://*.tauri.app" }, { "url": "https://localhost:3001" }, {"url": "https://127.0.0.1:3" }],
      "deny": [{ "url": "https://private.tauri.app" }]
    }
  ]
}

permission/http.toml :

[[permission]]
identifier = "allow-http"
description = "This enables the http command."
commands.allow = [
  "allow-fetch",
  "allow-fetch-cancel",
  "allow-fetch-read-body",
  "allow-fetch-send",
]

if someone can help me and explain why, i think I haven't understood the principle yet of the permission.
Thx

#

but i forgot to say when i launch my app using sodo everything work great

shadow hemlock
#

Whenever you see os error you can completely ignore the capabilities etc. Tauri's permission system is an additional app specific system above the os permissions.

#

I assume this error comes from the cookie cache initialization ๐Ÿค”

#

can you also post the output of the tauri info command please?

#

also, the path of your project may be interesting if sudo makes it work

meager panther
#

yes of course

#

just i was using sudo before and now when i pnpm run tauri dev i got the same error about os error 13

meager panther
# shadow hemlock can you also post the output of the `tauri info` command please?

[email protected] tauri
tauri info

WARNING: Only one package manager should be used, but found pnpm and npm.
Please remove unused package manager lock files, will use pnpm for now!

[โœ”] Environment
- OS: Mac OS 15.2.0 arm64 (X64)
โœ” Xcode Command Line Tools: installed
โœ” rustc: 1.84.0 (9fc6b4312 2025-01-07)
โœ” cargo: 1.84.0 (66221abde 2024-11-19)
โœ” rustup: 1.28.1 (f9edccde0 2025-03-05)
โœ” Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 20.14.0
- pnpm: 9.15.3
- yarn: 1.22.19
- npm: 10.8.2

[-] Packages
- tauri ๐Ÿฆ€: 2.4.1, (outdated, latest: 2.5.0)
- tauri-build ๐Ÿฆ€: 2.1.1, (outdated, latest: 2.2.0)
- wry ๐Ÿฆ€: 0.50.5, (outdated, latest: 0.51.2)
- tao ๐Ÿฆ€: 0.32.8, (outdated, latest: 0.33.0)
- @tauri-apps/api ๎œ˜: 2.4.1
- @tauri-apps/cli ๎œ˜: 2.4.1

[-] Plugins
- tauri-plugin-fs ๐Ÿฆ€: 2.2.1
- @tauri-apps/plugin-fs ๎œ˜: not installed!
- tauri-plugin-log ๐Ÿฆ€: 2.3.1
- @tauri-apps/plugin-log ๎œ˜: not installed!
- tauri-plugin-http ๐Ÿฆ€: 2.4.3
- @tauri-apps/plugin-http ๎œ˜: 2.4.3
- tauri-plugin-shell ๐Ÿฆ€: 2.2.1
- @tauri-apps/plugin-shell ๎œ˜: 2.2.1

[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../build
- devUrl: http://localhost:3000/
- framework: React (Next.js)
- bundler: Webpack

#

adn the PATH=/Users/hijodelaluna/snak-app

shadow hemlock
#

did you use sudo when you initially created or built the app?

#

maybe the data dir has bad permissions now

#

for that to test i guess you could just delete the $HOME/Library/Caches/<your-app-identifier>/ folder (iirc that's where the http plugin saves to)

meager panther
#

Now i got ```[Error: EACCES: permission denied, unlink '/Users/hijodelaluna/snak-app/build/server/app-paths-manifest.json'] {
errno: -13,
code: 'EACCES',
syscall: 'unlink',
path: '/Users/hijodelaluna/snak-app/build/server/app-paths-manifest.json'
}

meager panther
#

Ok i just delete build

#

i check for the bundle but it seems to work !