Skip to content

"Failed to initialize GTK" error when starting the AppImage on Linux / niri (Wayland) #370

@ralt

Description

@ralt

Variant

Desktop app (Linux)

Affected area

Desktop app (Tauri)

Bug description

I'm on Debian using niri, a Wayland compositor.

When starting the AppImage, I get this error right away:

$ ./World.Monitor_2.5.7_amd64.AppImage 

thread 'main' (143954) panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tao-0.34.5/src/platform_impl/linux/event_loop.rs:218:53:
Failed to initialize gtk backend!: BoolError { message: "Failed to initialize GTK", filename: "/home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gtk-0.18.2/src/rt.rs", function: "gtk::rt::init", line: 141 }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

If I try to turn on the full rust backtraces, I get:

$ RUST_BACKTRACE=full ./World.Monitor_2.5.7_amd64.AppImage 

thread 'main' (143987) panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tao-0.34.5/src/platform_impl/linux/event_loop.rs:218:53:
Failed to initialize gtk backend!: BoolError { message: "Failed to initialize GTK", filename: "/home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gtk-0.18.2/src/rt.rs", function: "gtk::rt::init", line: 141 }
stack backtrace:
   0:     0x55fdfac5cae2 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h1851ca2a850bd9a9
   1:     0x55fdfac6f787 - core::fmt::write::h22467d3ad5dd5554
   2:     0x55fdfac29b16 - std::io::Write::write_fmt::h5e3b6a876f7a20bf
   3:     0x55fdfac3bd89 - std::panicking::default_hook::{{closure}}::he43c3ac33dfa4b50
   4:     0x55fdfac3bbe9 - std::panicking::default_hook::hd124da54acf1152f
   5:     0x55fdfac3c07b - std::panicking::panic_with_hook::h9b5f1f19954f65a8
   6:     0x55fdfac3be48 - std::panicking::panic_handler::{{closure}}::hf431df8c849ee0d6
   7:     0x55fdfac36489 - std::sys::backtrace::__rust_end_short_backtrace::hf97362b31a346cc0
   8:     0x55fdfac1d98d - __rustc[9e6a08e89e4b9111]::rust_begin_unwind
   9:     0x55fdfac7824c - core::panicking::panic_fmt::ha4414e4328fe24a0
  10:     0x55fdfac774f2 - core::result::unwrap_failed::hac9339a6c7ad693b
  11:     0x55fdfa8bab77 - tauri_runtime_wry::Wry<T>::init_with_builder::h03be54ed681bec1a
  12:     0x55fdfa89329c - tauri::app::Builder<R>::build::h87e19f629ddea8c6
  13:     0x55fdfa83530b - world_monitor::main::hc402b60017b0595b
  14:     0x55fdfa9fba43 - std::sys::backtrace::__rust_begin_short_backtrace::hebf5afc0fba38547
  15:     0x55fdfa984ee9 - std::rt::lang_start::{{closure}}::hc3f816830a711eb0
  16:     0x55fdfac2b436 - std::rt::lang_start_internal::hb84cc625940d332a
  17:     0x55fdfa86aea5 - main
  18:     0x7fc3d5c34ca8 - __libc_start_call_main
                               at ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
  19:     0x7fc3d5c34d65 - __libc_start_main_impl
                               at ./csu/../csu/libc-start.c:360:3
  20:     0x55fdfa719655 - _start
  21:                0x0 - <unknown>

Googling around, there seems to be a few environment variables one can try to set, but I've tried all of these to no avail (excerpt from my bash history):

 1983  WEBKIT_DISABLE_DMABUF_RENDERER=0 ./World.Monitor_2.5.7_amd64.AppImage 
 1984  __NV_DISABLE_EXPLICIT_SYNC=1 WEBKIT_DISABLE_DMABUF_RENDERER=0 ./World.Monitor_2.5.7_amd64.AppImage 
 1985  __NV_DISABLE_EXPLICIT_SYNC=1 ./World.Monitor_2.5.7_amd64.AppImage 
 1989  WEBKIT_DISABLE_COMPOSITING_MODE=1 ./World.Monitor_2.5.7_amd64.AppImage 
 1990  WEBKIT_DISABLE_DMABUF_RENDERER=1 WEBKIT_DISABLE_COMPOSITING_MODE=1 ./World.Monitor_2.5.7_amd64.AppImage 

Steps to reproduce

Start the AppImage in a Wayland session.

Expected behavior

A desktop application that starts up.

Screenshots / Console errors

No response

Browser & OS

Debian Trixie / Wayland session

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions