fix(tauri): panic in CefRuntime::init assertion failure on Linux
Bug Report
Description
App crashes on startup with a panic in CefRuntime<T>::init — an assertion left == right fails (left: 0, right: 1). Affects Linux users including WSL2.
Sentry issues:
- OPENHUMAN-TAURI-K1 — panic: assertion
left == rightfailed in CefRuntime init (55 events)
Combined impact: 55 events. Fatal panic on app startup — the app never opens. All events are from Linux (native and WSL2).
Error
panic: assertion `left == right` failed
left: 0
right: 1
- Culprit:
tauri_runtime_cef::CefRuntime<T>::init - Platform: Linux x86_64 (6.12.73+deb13-amd64, WSL2 5.10.16.3-microsoft-standard-WSL2)
- Version: [email protected]
- Environment: production
Root Cause Analysis
The panic is inside the vendored tauri-runtime-cef crate's CefRuntime::init. The assertion likely checks CEF initialization state (e.g. cef_initialize return value, or a global initialization counter). The left: 0, right: 1 pattern suggests a function returned 0 (failure) where 1 (success) was expected.
On Linux/WSL2, CEF initialization can fail due to:
- Missing shared libraries (libcef, X11/Wayland deps)
- Sandbox restrictions (especially WSL2 — no real GPU, restricted /dev/shm)
- The CEF framework bundle not being found at the expected relative path
This is in vendored code (app/src-tauri/vendor/tauri-cef), so the fix may need to either add a pre-flight check before the assertion or handle the 0 return gracefully.
Proposed Fix
- Add a pre-flight check in the Tauri shell startup path that validates CEF prerequisites before calling
CefRuntime::init - Replace the assertion with a recoverable error that shows a user-facing message about missing dependencies
- For WSL2: detect the environment and log guidance about required X11/Wayland setup
- Investigate if the CEF sandbox flag needs to be disabled on WSL2
Labels
sentry-traced-bug, os:linux, bug, priority: high, area: tauri