Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] tauri app panics at startup with runtime error 'code: 0x800700AA, message: The requested resource is in use.' #9805

Closed
admgthu opened this issue May 17, 2024 · 3 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@admgthu
Copy link

admgthu commented May 17, 2024

Describe the bug

Hi,

About 1 week ago, my tauri app stopped working and panicked at startup with a runtime exception, whereas it has been working fine for the last couple of months.
I tried figuring out the issue, and ended up creating a new vanilla app (npm, vite, typescript) with the tauri create app npm module.

The vanilla app also fails with the same runtime exception:

$ RUST_BACKTRACE=1 npm run tauri dev

footauri@0.0.0 tauri
tauri dev

 Running BeforeDevCommand (`npm run dev`)

footauri@0.0.0 dev
vite

VITE v5.2.11 ready in 207 ms

➜ Local: http://localhost:1420/
➜ Network: use --host to expose
Info Watching C:\tauri\footauri\src-tauri for changes...
Updating crates.io index
Blocking waiting for file lock on build directory
Compiling footauri v0.0.0 (C:\tauri\footauri\src-tauri)
Finished dev [unoptimized + debuginfo] target(s) in 4.85s
thread 'main' panicked at src\main.rs:14:10:
error while running tauri application: Runtime(CreateWebview(WebView2Error(WindowsError(Error { code: 0x800700AA, message: The requested resource is in use. }))))

It seems to be caused by a new WebView2 version, installed by auto update.
I tried to rollback the version by using the bundle/windows config in tauri.json.config, but the version used for dev is still the same.

Online, it says it might be due to corrupt windows files, but I run a filesystem check, and the issue still arises after that.
I updated node.js, webview2, tauri.. but the issue is once again still there.

Nothing obvious on my side, so any help would be greatly appreciated :-)
Thanks.

Reproduction

create and launch a vanilla tauri app typescript/vite/npm with the env info below, and it should panic at launch, with an instantaneous runtime exception.

Expected behavior

The default vanilla tauri app should launch and work correctly.

Full tauri info output

> footauri@0.0.0 tauri
> tauri info


[✔] Environment
    - OS: Windows 10.0.22621 X64
    ✔ WebView2: 124.0.2478.97
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Community 2022
    ✔ rustc: 1.73.0 (cc66ad468 2023-10-03)
    ✔ cargo: 1.73.0 (9c4383fb5 2023-08-26)
    ✔ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (default)
    - node: 20.13.1
    - yarn: 1.22.19
    - npm: 10.7.0

[-] Packages
    - tauri [RUST]: 1.6.5
    - tauri-build [RUST]: 1.5.2
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api [NPM]: 1.5.6
    - @tauri-apps/cli [NPM]: 1.5.14

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - bundler: Vite

Stack trace

thread 'main' panicked at src\main.rs:14:10:
error while running tauri application: Runtime(CreateWebview(WebView2Error(WindowsError(Error { code: 0x800700AA, message: The requested resource is in use. }))))
stack backtrace:
   0:     0x7ff7d09f696a - std::sys_common::backtrace::_print::impl$0::fmt
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:44
   1:     0x7ff7d0a0e95b - core::fmt::rt::Argument::fmt
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\fmt\rt.rs:138
   2:     0x7ff7d0a0e95b - core::fmt::write
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\fmt\mod.rs:1094
   3:     0x7ff7d09f2df1 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\io\mod.rs:1714
   4:     0x7ff7d09f66ea - std::sys_common::backtrace::_print
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:47
   5:     0x7ff7d09f66ea - std::sys_common::backtrace::print
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:34
   6:     0x7ff7d09f8e8a - std::panicking::default_hook::closure$1
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:270
   7:     0x7ff7d09f8af8 - std::panicking::default_hook
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:290
   8:     0x7ff7d09f953e - std::panicking::rust_panic_with_hook
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:707
   9:     0x7ff7d09f942d - std::panicking::begin_panic_handler::closure$0
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:599
  10:     0x7ff7d09f7359 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\sys_common\backtrace.rs:170
  11:     0x7ff7d09f9130 - std::panicking::begin_panic_handler
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:595
  12:     0x7ff7d0a180a5 - core::panicking::panic_fmt
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\panicking.rs:67
  13:     0x7ff7d0a18604 - core::result::unwrap_failed
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\core\src\result.rs:1652
  14:     0x7ff7d02fb73b - enum2$<core::result::Result<tuple$<>,enum2$<tauri::error::Error> > >::expect<tuple$<>,enum2$<tauri::error::Error> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\result.rs:1034
  15:     0x7ff7d0286ade - footauri::main
                               at C:\tauri\footauri\src-tauri\src\main.rs:11
  16:     0x7ff7d030fdcb - core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\core\src\ops\function.rs:250
  17:     0x7ff7d033d27e - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\sys_common\backtrace.rs:154
  18:     0x7ff7d033d27e - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\sys_common\backtrace.rs:154
  19:     0x7ff7d035a071 - std::rt::lang_start::closure$0<tuple$<> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\rt.rs:166
  20:     0x7ff7d09ecef8 - std::rt::lang_start_internal::closure$2
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\rt.rs:148
  21:     0x7ff7d09ecef8 - std::panicking::try::do_call
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:502
  22:     0x7ff7d09ecef8 - std::panicking::try
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panicking.rs:466
  23:     0x7ff7d09ecef8 - std::panic::catch_unwind
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\panic.rs:142
  24:     0x7ff7d09ecef8 - std::rt::lang_start_internal
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library\std\src\rt.rs:148
  25:     0x7ff7d035a04a - std::rt::lang_start<tuple$<> >
                               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33\library\std\src\rt.rs:165
  26:     0x7ff7d0287a19 - main
  27:     0x7ff7d0a15d6c - invoke_main
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
  28:     0x7ff7d0a15d6c - __scrt_common_main_seh
                               at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
  29:     0x7ff9638b257d - BaseThreadInitThunk
  30:     0x7ff96490aa48 - RtlUserThreadStart

Additional context

No response

@admgthu admgthu added status: needs triage This issue needs to triage, applied to new issues type: bug labels May 17, 2024
@0rvar
Copy link
Contributor

0rvar commented May 17, 2024

Does the problem go away if you update to the newest Webview2 version? 124.0.2478.109 is now available.

I have suspicions that there are issues with 124.0.2478.97. But I don't have a way of installing .97 to verify for myself.

@admgthu
Copy link
Author

admgthu commented May 17, 2024

it might be an issue with my laptop - I am unable to update webview2, with the same error code. Probably a corrupt system file? I will try to re-install windows. Thanks for your help!

@admgthu
Copy link
Author

admgthu commented May 18, 2024

Hi,

I found the issue: it is corrupted files in the webview2 user data directory.
If this happens again, one just needs to rename or delete directory C:\Users<user>\AppData\Local\com.tauri.dev

More explanations here:
https://learn.microsoft.com/en-us/microsoft-edge/webview2/concepts/user-data-folder?tabs=win32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

3 participants