tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] Error 71 (Protocol error) dispatching to Wayland display.

Open Lunasciel opened this issue 1 year ago • 18 comments

Describe the bug

Application won't start anymore.

Error: Gdk-Message: 23:55:52.007: Error 71 (Protocol error) dispatching to Wayland display.

Reproduction

Execute yarn tauri dev under Linux and try to start your Application

Expected behavior

Normal starting without errors

Full tauri info output

> tauri info


[✔] Environment
    - OS: Linux Rolling Release X64
    ✔ webkit2gtk-4.0: 2.44.3
    ✔ rsvg2: 2.58.3
    ✔ rustc: 1.80.0 (051478957 2024-07-21)
    ✔ cargo: 1.80.0 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 22.6.0
    - yarn: 1.22.22
    - npm: 10.8.2

[-] Packages
    - tauri [RUST]: 1.7.1
    - tauri-build [RUST]: 1.5.3
    - wry [RUST]: 0.24.10
    - tao [RUST]: 0.16.9
    - @tauri-apps/api [NPM]: 1.6.0
    - @tauri-apps/cli [NPM]: 1.6.0

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

Stack trace

No response

Additional context

I haven't changed anything in the project since the last time and everything still worked.

Lunasciel avatar Aug 20 '24 22:08 Lunasciel

Looks like the bug has made it's way to GitButler. Getting this exact error trying to start it.

Thought it was this error at first, but the problem persists after removing the window-state file

Edit: this is giving me nvidia-problem vibes. Are you using nvidia?

7RST1 avatar Aug 27 '24 20:08 7RST1

this is giving me nvidia-problem vibes. Are you using nvidia?

Can confirm on my end that it is related to NVIDIA. I got the same error on my NVIDIA-only machine.

Here is the log with WAYLAND_DEBUG=1, https://pastebin.pl/view/5fd8b401

[2610755.730] {Display Queue} wl_display#1.error(wp_linux_drm_syncobj_surface_v1#50, 4, "explicit sync is used, but no acquire point is set")
Gdk-Message: 04:05:57.352: Error 71 (Protocol error) dispatching to Wayland display.

Edit: My machine is running Arch Linux, NVIDIA 560.35.03, NVIDIA EGL Wayland 1.1.16.

TheBill2001 avatar Aug 27 '24 21:08 TheBill2001

I recently migrated over to wayland, and came across this same issue (though in a tauri v2 app)

A temporary solution is to use

WEBKIT_DISABLE_DMABUF_RENDERER=1 pnpm tauri dev

found from here

Weshnaw avatar Sep 03 '24 23:09 Weshnaw

This happens for me when running Webkit2gtk's MiniBrowser example app, so it's likely an upstream issue. I've filed https://bugs.webkit.org/show_bug.cgi?id=280210 .

ColonelThirtyTwo avatar Sep 23 '24 21:09 ColonelThirtyTwo

fixed some of the issues causing “Error 71 (Protocol error)” in https://github.com/tauri-apps/tao/pull/979. I believe the update will be applied in the next version after tao 0.30.2.

Zamoca42 avatar Sep 28 '24 15:09 Zamoca42

is this fixed?

AmeerArsala avatar Oct 17 '24 23:10 AmeerArsala

__NV_DISABLE_EXPLICIT_SYNC=1 also fixes the issue for me Full WAYLAND_DEBUG=1 output: https://pastebin.com/DSN7mq9G

lll-Death-lll avatar Dec 08 '24 08:12 lll-Death-lll

Also have this in Arch Linux + Nvidia.

Tauri Info:

[✔] Environment - OS: Arch Linux Rolling Release x86_64 (X64) (gnome on wayland) ✔ webkit2gtk-4.1: 2.46.5 ✔ rsvg2: 2.59.2 ✔ rustc: 1.84.0 (9fc6b4312 2025-01-07) ✔ cargo: 1.84.0 (66221abde 2024-11-19) ✔ rustup: 1.27.1 (2024-05-07) ✔ Rust toolchain: stable-x86_64-unknown-linux-gnu (environment override by RUSTUP_TOOLCHAIN) - node: 18.20.5 - yarn: 1.22.22 - npm: 11.0.0

[-] Packages - tauri 🦀: 2.2.3 - tauri-build 🦀: 2.0.5 - wry 🦀: 0.48.1 - tao 🦀: 0.31.1 - tauri-cli 🦀: 2.2.5

[-] Plugins - tauri-plugin-opener 🦀: 2.2.5

[-] App - build-type: bundle - CSP: unset - frontendDist: ../dist - devUrl: http://localhost:1420/

I was able to get around it by running the above suggested: WEBKIT_DISABLE_DMABUF_RENDERER=1 cargo tauri dev

roomtin avatar Jan 22 '25 00:01 roomtin

For me __NV_DISABLE_EXPLICIT_SYNC=1 appears to solve it only at first glance, but the app is full of graphic glitches. WEBKIT_DISABLE_DMABUF_RENDERER=1 On the other hand works fine without any glitches.

Simon-Laux avatar May 03 '25 16:05 Simon-Laux

WEBKIT_DISABLE_DMABUF_RENDERER=1 seriously slows down the application and causes problems with smoothness of animations. I found a more suitable combination of flags that does not affect performance:

std::env::set_var("__GL_THREADED_OPTIMIZATIONS", "0");
std::env::set_var("__NV_DISABLE_EXPLICIT_SYNC", "1");

gravit0 avatar Jun 03 '25 12:06 gravit0

This looks like a threading issue, since when testing again even the flags WEBKIT_DISABLE_DMABUF_RENDERER=1 or WEBKIT_DISABLE_COMPOSITING_MODE=1 lead to a white screen, and in successful cases glitches are visible at startup. Apparently, this also depends on the scene load, since deleting the cache in .cache is guaranteed or very likely to help

UPD: https://wiki.gnome.org/Projects(2f)WebKitGtk(2f)ProgrammingGuide(2f)Tutorial.html works fine with __NV_DISABLE_EXPLICIT_SYNC=1 without perfomance issues

gravit0 avatar Jun 03 '25 13:06 gravit0

Tried tauri today for the first time, no luck as I'm blocked by this bug. Whether I use the variables described by @gravit0 or WEBKIT_DISABLE_DMABUF_RENDERER=1 the screen is often just white with no content. Both will render the app but only if I first run it with tauri dev and then save some file causing the app to reload. On the first launch it is just a white screen.

willmtemple avatar Jul 15 '25 01:07 willmtemple

Today tauri dev works fine(with disable explicit sync)

NVIDIA nvidia-open 575.64.03-4 KDE Plasma 6.4.3 KDE Framework 6.16.0 Qt 6.9.1 Kernel 6.15.7 Webkit2gtk 2.48.3-1

gravit0 avatar Jul 18 '25 09:07 gravit0

well I get a blank screen 1/2 times, gotta do the file edition to make the dev environment reload and fix itself. This is pretty annoying.

TheDogHusky avatar Jul 22 '25 12:07 TheDogHusky

@Weshnaw thanks ''WEBKIT_DISABLE_DMABUF_RENDERER=1'' works

thenobrainguy avatar Aug 27 '25 23:08 thenobrainguy

Ran into the same issue

Arch linux linux 6.17.2.arch1-1 nvidia 580.95.05-3 hyprland 0.51.1-6

WEBKIT_DISABLE_DMABUF_RENDERER=1 npm run tauri dev works

TheKoTech avatar Oct 15 '25 13:10 TheKoTech

I encountered this issue as well running Sveltekit + Tauri.

Gentoo linux kernel 6.12.41-gentoo-x86_64 nvidia 580.95.05 hyprland 0.51.1

WEBKIT_DISABLE_DMABUF_RENDERER=1 pnpm tauri dev

works, but is causing really slow animations and it's not really usable because of that.

__NV_DISABLE_EXPLICIT_SYNC=1 pnpm tauri dev

is better, and animations are smooth. However, display buffer glitches are sometimes noticeable, clearing up only when the cursor is passed over them.

BlueManCZ avatar Oct 16 '25 12:10 BlueManCZ