tauri-apps/tauri · warning

unable to kill native webdriver server

Error message

unable to kill native webdriver server

What it means

Panic in tauri-driver's server signal handler: on receiving SIGTERM/SIGINT/SIGQUIT the handler calls `_driver.kill()` on the native webdriver child process and `.expect`s success. If the child has already exited or kill fails (process gone, permission problem), this panics. It happens during shutdown, so the impact is an ugly crash instead of a clean exit.

Solutions

  1. Ignore the panic if it occurs only at shutdown — the driver was already dead; fix the underlying reason the webdriver exited (check its stderr).
  2. Change the handler to tolerate kill errors: replace `.expect(...)` with `let _ = _driver.kill();` and exit gracefully.
  3. Investigate why the native webdriver crashed (version mismatch with the browser/WebView, missing deps).
  4. Update tauri-driver/browser driver versions so the child process stays alive through the session.

Example fix

// before
_driver.kill().expect("unable to kill native webdriver server");
// after
let _ = _driver.kill();
std::process::exit(0);
Defensive patterns

Strategy: try-catch

Validate before calling

// check the native webdriver is still alive before sending shutdown signals
pgrep -f msedgedriver || echo "webdriver already exited — kill will fail during shutdown"

Try / catch

// tolerate kill failure during signal shutdown:
match _driver.kill() {
  Ok(_) => {}
  Err(e) => eprintln!("webdriver already exited: {e}"),
}
std::process::exit(0);

Prevention

When it happens

Trigger: Pressing Ctrl-C or sending SIGTERM/SIGINT to tauri-driver when the native webdriver child process has already terminated on its own, so `kill()` returns an error.

Common situations: Native webdriver crashed mid-session and the user then interrupts tauri-driver; driver binary exited due to its own error; rapid double signal where the first cleanup already reaped the child.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/e45cd482e7ba4446. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri-driver/src/server.rs:186

#[tokio::main(flavor = "current_thread")]
pub async fn run(args: Args, mut _driver: Child) -> Result<(), Error> {
  #[cfg(unix)]
  let (signals_handle, signals_task) = {
    use futures_util::StreamExt;
    use signal_hook::consts::signal::*;

    let signals = signal_hook_tokio::Signals::new([SIGTERM, SIGINT, SIGQUIT])?;
    let signals_handle = signals.handle();
    let signals_task = tokio::spawn(async move {
      let mut signals = signals.fuse();
      #[allow(clippy::never_loop)]
      while let Some(signal) = signals.next().await {
        match signal {
          SIGTERM | SIGINT | SIGQUIT => {
            _driver
              .kill()
              .expect("unable to kill native webdriver server");
            std::process::exit(0);
          }
          _ => unreachable!(),
        }
      }
    });
    (signals_handle, signals_task)
  };

  let address = std::net::SocketAddr::from(([127, 0, 0, 1], args.port));

  // the client we use to proxy requests to the native webdriver
  let client = Client::builder(TokioExecutor::new())
    .http1_preserve_header_case(true)
    .http1_title_case_headers(true)
    .retry_canceled_requests(false)
    .build_http();

View on GitHub (pinned to 460ec35447)