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

Could not create default EGL display: EGL_BAD_PARAMETER. Aborting... #5282

Closed
esamson opened this issue Oct 23, 2024 · 39 comments · Fixed by #5301
Closed

Could not create default EGL display: EGL_BAD_PARAMETER. Aborting... #5282

esamson opened this issue Oct 23, 2024 · 39 comments · Fixed by #5301
Labels
bug Something isn't working distribution Something related to the packaged binaries, app-images and installers

Comments

@esamson
Copy link

esamson commented Oct 23, 2024

Version

0.13.6

Operating System

Linux

Distribution Method

AppImage (Linux)

Describe the issue

Upon launch, I just get an empty window.

I'm using Fedora 40 (KDE Plasma) with Wayland.

Relevant log output

** (git-butler:3207): WARNING **: 21:29:40.424: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
2024-10-23T13:29:40.445664Z  INFO crates/gitbutler-tauri/src/main.rs:64: system git executable for fetch/push: "git"
2024-10-23T13:29:40.445781Z  INFO crates/gitbutler-tauri/src/main.rs:101: starting app version=0.13.6 name=GitButler
Could not create default EGL display: EGL_BAD_PARAMETER. Aborting...

** (git-butler:3207): WARNING **: 21:30:05.447: atk-bridge: get_device_events_reply: unknown signature
@esamson esamson added the bug Something isn't working label Oct 23, 2024
@Keloran
Copy link

Keloran commented Oct 23, 2024

if you need to download the old one to get your system working again

https://releases.gitbutler.com/releases/release/0.13.5-1375/linux/x86_64/git-butler_0.13.5_amd64.AppImage.tar.gz

@Byron Byron added the distribution Something related to the packaged binaries, app-images and installers label Oct 24, 2024
@Byron
Copy link
Collaborator

Byron commented Oct 24, 2024

Thanks a lot for reporting!

The compatibility story for the Linux distribution, particularly related to AppImage, isn't great, and sometimes there is no good solution, from my experience.

But also, I am fortunately not the right one to talk to about this, but @ndom91 is and knows all about it.

@ndom91
Copy link
Contributor

ndom91 commented Oct 24, 2024

Hey thanks for reporting this. So EGL is referring to OpenGL. I ran into this yesterday as well and spent a bunch of time going back and forth between different opengl / mesa versions trying to pin this down, I'm on NixOS. Downgrading to the version on the 24.04 nixpkgs ([email protected]) allowed me to run these newer releases again.

What I've found so far:

  • Nightly 0.5.826 is the last working version for me (AppImage download)
  • The diff to the next version (0.5.827) seems to be very small (nightly/0.5.826...nightly/0.5.827) and has nothing to do with any updates to libwebkit2gtk or any other rendering related libraries, which is a bit confusing as to why opengl is all of a sudden complaining.
  • So first thing I wanted to do was bisect and try building a copy with/without each one of those commits/changes. Maybe having an .envrc messes with the GitHub Actions runner

I'll keep this issue updated once I find something 👍

@ndom91
Copy link
Contributor

ndom91 commented Oct 24, 2024

So I was able to build master locally and run the appimage without issue.

There were two commits in that diff, I tried reverting them both individually and built nightlies on GHA off of the branches:

  1. Revert .envrc
  2. Revert csp changes

Links to the resulting AppImages in comments in those closed PRs

Unfortunately, neither GHA built build worked on my machine :(

@ndom91
Copy link
Contributor

ndom91 commented Oct 24, 2024

Okay interestingly, taking the latest AppImage and extracting it and trying to run the AppRun binary found therein did work on my system.

@ndom91
Copy link
Contributor

ndom91 commented Oct 24, 2024

So it seems that the GHA Ubuntu 22.04 instance started installing libwebkit2gtk-4.0-dev version 2.46.1 as of ~2-3 days ago. As opposed to 2.44.1 previously.

First thing I can recommend is try to upgrade libwebkit2gtk on your systems and see if that helps 👍

@ndom91
Copy link
Contributor

ndom91 commented Oct 24, 2024

So I think I figured it out. Can you give the latest nightly a shot? I've pinned the libwebkit2gtk to the previous version.

I put up a PR for this: #5301

@itszero
Copy link

itszero commented Oct 24, 2024

Had the same issue on ArchLinux yesterday and the latest nightly does work on my machine!

@esamson
Copy link
Author

esamson commented Oct 25, 2024

I can confirm that nightly_0.5.835 AppImage works as expected for me. Thanks.

ndom91 added a commit that referenced this issue Oct 28, 2024
@ndom91
Copy link
Contributor

ndom91 commented Oct 28, 2024

We're in the process of upgrading to Tauri 2, which requires libwebkit2gtk-4.1 (as opposed to 4.0 for Tauri v1).

Unfortunately the latest versions of libwebkit2gtk-4.1 also exhibits the same issue again. I'm testing also pinning it to an older version, the Ubuntu 22.04 repo also have 2.36.1 available for libwebkit2gtk-4.1, but that's ~2 years old so I'd love to figure out a better fix for this. Anyone else have any more details about the issue perhaps?

| Sidenote, libwebkit2gtk 4.0 and 4.1 are API versions, not versions of the package, for anyone not familiar with them

@ndom91
Copy link
Contributor

ndom91 commented Oct 29, 2024

Came across this issue on the webkit bug tracker: https://www2.webkit.org/show_bug.cgi?id=280239

Looks like they acknowledged that something is wrong on their side there, but then there's been no movement since end of Sept :/

@ndom91
Copy link
Contributor

ndom91 commented Oct 30, 2024

We've just merged the update to Tauri v2, which also comes with a bump in libwebkit2gtk.

You can try it already by downloading the nightly 0.5.849 (https://app.gitbutler.com/downloads).

The AppImage is conitnuing to work well for me. Additionally two little bugs were fixed via this upgrade in the AppImage - dropzones not being rendered correctly (black hole), and contenteditable divs not being editable 🥳

@binarybaron
Copy link

binarybaron commented Nov 17, 2024

I apologize for bumping this.

We are having the same issues and haven't been able to find a fix yet. We are running Tauri V2. Do you have any pointers for us? This is our release build workflow.

@ndom91
Copy link
Contributor

ndom91 commented Nov 20, 2024

@binarybaron no problem, basically doing what they did here at zmkfirmware should do the trick.

It seems that the latest version of libwebkit2gtk-4.1 in the Ubuntu 22 and 24 repositories doesn't play well with Tauri.

Be aware though that using the solution we did and zmk seems to have, by bumping to building with Ubuntu 24, will use Ubuntu 24s version of glibc and therefore block folks running earlier versions of Ubuntu from using your app.

Alternatively, you could build with Ubuntu 22 and use the previously available version of libwebkit2gtk-4.1 in the Ubuntu 22 repos, however that's like ~2.5 years old and lead to a few CSS bugs in GitButler.

@binarybaron
Copy link

@binarybaron no problem, basically doing what they did here at zmkfirmware should do the trick.

It seems that the latest version of libwebkit2gtk-4.1 in the Ubuntu 22 and 24 repositories doesn't play well with Tauri.

Be aware though that using the solution we did and zmk seems to have, by bumping to building with Ubuntu 24, will use Ubuntu 24s version of glibc and therefore block folks running earlier versions of Ubuntu from using your app.

Alternatively, you could build with Ubuntu 22 and use the previously available version of libwebkit2gtk-4.1 in the Ubuntu 22 repos, however that's like ~2.5 years old and lead to a few CSS bugs in GitButler.

Thanks! For us backwards compatability is quite important. Do you know what the most recent working webkit version on ubuntu 22.04 is that works?

@jokeyrhyme
Copy link

I wonder if maybe the Linux Tauri build ought to statically link/bundle a known-good libwebkit2gtk?

@ndom91
Copy link
Contributor

ndom91 commented Nov 21, 2024

@binarybaron looks like it's 2.36.0. (https://packages.ubuntu.com/jammy/libwebkit2gtk-4.1-0). Latest version is ~2.46.3 I think

binarybaron added a commit to UnstoppableSwap/core that referenced this issue Nov 21, 2024
@Samueru-sama
Copy link

We ran into this issue here: VHSgunzo/sharun#2

Any suggestion besides downgrading? Note that the way we build appimages we bundle all the libs with the dynamic linker so to avoid glibc versioning issues.

brgr added a commit to brgr/summarum that referenced this issue Nov 23, 2024
I'm trying to make the AppImage build correctly on the Ubuntu CI.
I found this here: gitbutlerapp/gitbutler#5282
@SpeeQz1
Copy link

SpeeQz1 commented Dec 16, 2024

@ndom91 I ran in a similar issue when bundling my Tauri 2.0 app as an AppImage on Linux Mint 22 Cinnamon with Nvidia and then trying to test it in a Fedora VM.
Could not create default EGL display: EGL_BAD_PARAMETER. Aborting...
It runs normally in a Linux Mint VM strangely.

@ndom91
Copy link
Contributor

ndom91 commented Dec 18, 2024

Hmm odd that it worked for you in a VM as well. EGL is referring to opengl (often provided by the mesa pkg of your distro) afaik, I bet the qemu video adapter driver is just older / better compatible than the amdgpu/i915/xe/nvidia or whatever we're using on our native installations.

I don't have the time to do a deep dive here, but I'm keeping my eyes on the libwebkit2gtk-4.1 releases hoping they'll work without issue on native installations soon again 🤞

@SpeeQz1
Copy link

SpeeQz1 commented Dec 18, 2024

Hmm odd that it worked for you in a VM as well. EGL is referring to opengl (often provided by the mesa pkg of your distro) afaik, I bet the qemu video adapter driver is just older / better compatible than the amdgpu/i915/xe/nvidia or whatever we're using on our native installations.

I don't have the time to do a deep dive here, but I'm keeping my eyes on the libwebkit2gtk-4.1 releases hoping they'll work without issue on native installations soon again 🤞

I believe there is some issue when it comes to Fedora as per this issue here

@Samueru-sama
Copy link

@ndom91 I ran in a similar issue when bundling my Tauri 2.0 app as an AppImage on Linux Mint 22 Cinnamon with Nvidia and then trying to test it in a Fedora VM. Could not create default EGL display: EGL_BAD_PARAMETER. Aborting... It runs normally in a Linux Mint VM strangely.

Do you have the issue with this AppImage that bundles webkitgtk?

https://github.com/probonopd/PrusaSlicer/releases/tag/continuous

@ndom91
Copy link
Contributor

ndom91 commented Jan 6, 2025

Do you have the issue with this AppImage that bundles webkitgtk?

probonopd/PrusaSlicer@continuous (release)

No, so for me the latest PrusaSlicer AppImage release (2.9.0-rc1-x86_64) seems to run without issue

Shaliaf added a commit to Shaliaf/museeks that referenced this issue Jan 7, 2025
Just for myself to try the app.
More info about the open GL issue here:
gitbutlerapp/gitbutler#5282
@ndom91
Copy link
Contributor

ndom91 commented Jan 15, 2025

Hey everyone, so it looks like Ubuntu's released an update to libwebkit2gtk-4.0 and ..4-1 in their repositories for Jammy (22.04) and Noble (24.04) - 2.46.5.

I gave it a shot with our application here and it seems to have fixed the dreaded "white screen" issue on render.

With [email protected] I was able to remove the version pinning back and build on 22.04 - thereby supporting folks using Ubuntu 22.04 as well again 🙏 🙌

Wondering if anyone else has luck with 2.46.5 too?

@olekolek1000
Copy link

olekolek1000 commented Jan 15, 2025

@ndom91
I'll just add my two cents. I'm in the middle of creating a GitHub runner for my separate project (VR dashboard app) with the webkit2gtk at 2.46.5, no luck running on my local machine with Arch Linux (blank screen).

Logs are mostly the same:

** (WebKitWebProcess:59699): WARNING **: 23:36:12.129: Error loading the injected bundle (././/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so): ././/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so: cannot open shared object file: No such file or directory
Could not create default EGL display: EGL_BAD_PARAMETER. Aborting...

My workflow file

Maybe I'm doing something different, but overall this workflow should work the same as yours.

@Samueru-sama
Copy link

@olekolek1000 that error you have is because you are missing libwebkit2gtkinjectedbundle.so in the AppDir/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle. The entire injected-bundle dir is missing as well.

The only way we managed to get this all to work was to bundle all the libs, including the opengl ones, this also means copying /usr/share/glvnd to the AppDir and include it in __EGL_VENDOR_LIBRARY_DIRS.

@olekolek1000
Copy link

@Samueru-sama Thanks for the clarification. I’ve just made a quick-and-dirty way to copy all required libraries directly into tauri.conf.json, without using ld-preload-open for now:

"bundle": {
         "linux": {
                 "appimage": {
                         "files": {
                                 "/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0": "/lib/x86_64-linux-gnu/libGLX_indirect.so.0",
                                 "/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0": "/lib/x86_64-linux-gnu/libGLX_mesa.so.0",
                                 (... many other libs ...)
                                 "/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so":"/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so",
                                 "/usr/lib/x86_64-linux-gnu/libLLVM-15.so.1":"/lib/x86_64-linux-gnu/libLLVM-15.so.1",
                                 "/usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0":"/lib/x86_64-linux-gnu/libEGL_mesa.so.0",
                         }
                 }
         },
         "active": true,
         "targets": ["appimage"],
         "icon": ["icons/icon.png"]
 }

That definitely fixed these two errors, but another one is showing up: libEGL fatal: did not find extension DRI_Mesa version 1.
As you mentioned, copying /usr/share/glvnd/* would probably solve this issue. However, I’m concerned that Tauri’s AppImage build script doesn’t support creating directories, making it impossible to copy anything to the non-existent /share/ directory in the AppDir, forcing me to create a completely separate builder script just to get this working. I will notify you later about my progress regarding that. This issue is definitely something Tauri should address in the upstream.

@Samueru-sama
Copy link

@Samueru-sama Thanks for the clarification. I’ve just made a quick-and-dirty way to copy all required libraries directly into tauri.conf.json, without using ld-preload-open for now:

"bundle": {
         "linux": {
                 "appimage": {
                         "files": {
                                 "/usr/lib/x86_64-linux-gnu/libGLX_indirect.so.0": "/lib/x86_64-linux-gnu/libGLX_indirect.so.0",
                                 "/usr/lib/x86_64-linux-gnu/libGLX_mesa.so.0": "/lib/x86_64-linux-gnu/libGLX_mesa.so.0",
                                 (... many other libs ...)
                                 "/usr/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so":"/lib/x86_64-linux-gnu/webkit2gtk-4.1/injected-bundle/libwebkit2gtkinjectedbundle.so",
                                 "/usr/lib/x86_64-linux-gnu/libLLVM-15.so.1":"/lib/x86_64-linux-gnu/libLLVM-15.so.1",
                                 "/usr/lib/x86_64-linux-gnu/libEGL_mesa.so.0":"/lib/x86_64-linux-gnu/libEGL_mesa.so.0",
                         }
                 }
         },
         "active": true,
         "targets": ["appimage"],
         "icon": ["icons/icon.png"]
 }

That definitely fixed these two errors, but another one is showing up: libEGL fatal: did not find extension DRI_Mesa version 1. As you mentioned, copying /usr/share/glvnd/* would probably solve this issue. However, I’m concerned that Tauri’s AppImage build script doesn’t support creating directories, making it impossible to copy anything to the non-existent /share/ directory in the AppDir, forcing me to create a completely separate builder script just to get this working. I will notify you later about my progress regarding that. This issue is definitely something Tauri should address in the upstream.

The DRI error is likely because you also need to bundle the /usr/lib/dri dir and set LIBGL_DRIVERS_PATH to it.

Newer mesa does not need that variable to be set anymore, those libs are loaded like any other shared library, however the mesa version that's on ubuntu 24.04 doesn't have that change yet.

If I'm not mistaken tauri will also run linuxdeploy-gtk on the produced AppImage, which just complicates things.

without using ld-preload-open for now

tauri already does something similar to "fix" that issue by running sed on the libwebkit libs patching /usr for ././, and after changing the current working directory to the AppDir this makes the lib find the binaries. This isn't ideal since it changes the cwd is changed before launching the app.

forcing me to create a completely separate builder script just to get this working

Oh this is needed 😅 this is why I mentioned that using linuxdeploygtk complicates things.

Ideally the CI has to be configured to build the binaries without building the appimage and then a shell script is written to deploy the dependencies, should be about ~60 lines of shell, not much but those are one of the most painful lines of shell you will see in your life lol.

This weekend I'm going to try help a different tauri project bundle webkitgtk, if everything goes right then it should be much easier for other projects to port the changes.

@olekolek1000
Copy link

Related Tauri issue:

tauri-apps/tauri#11994

By the way, what's the progress? No pressure, of course. @Samueru-sama

@Samueru-sama
Copy link

Related Tauri issue:

tauri-apps/tauri#11994

By the way, what's the progress? No pressure, of course. @Samueru-sama

Tormak9970/Steam-Art-Manager#240

Got stuck because it also turns out Tauri uses a different method to update appimages outside the official one 😫

In any case the script I wrote is all that should take to fix the issue, it is what we did with Prusaslicer to fix the libwebkitgtk issue as well.

@olekolek1000
Copy link

I've tried and slightly modified your script in the actions. Application launches successfully, the only thing now is that webkit itself is unable to perform any HTTPS connections. HTTP Tauri plugin fetch() works fine though.

Image

@Samueru-sama
Copy link

I've tried and slightly modified your script in the actions. Application launches successfully, the only thing now is that webkit itself is unable to perform any HTTPS connections. HTTP Tauri plugin fetch() works fine though.

Image

extract the appimage and run the AppRun this way: strace ./AppRun |& grep -i enoent | grep -i lib

It likely is missing some ssl libraries or similar.

@olekolek1000
Copy link

These SSL files were attempted to load (ENOENT):

/shared/lib/glibc-hwcaps/x86-64-v3/libssl.so.3
/shared/lib/glibc-hwcaps/x86-64-v2/libssl.so.3
/shared/lib/tls/x86_64/x86_64/libssl.so.3
/shared/lib/tls/x86_64/libssl.so.3
/shared/lib/tls/x86_64/libssl.so.3
/shared/lib/tls/libssl.so.3
/shared/lib/x86_64/x86_64/libssl.so.3
/shared/lib/x86_64/libssl.so.3
/shared/lib/x86_64/libssl.so.3

These libs were successfully opened by webkit:

/shared/lib/libssl.so.3
/shared/lib/libcrypto.so.3

Trying to find more clues, this log is quite large obviously :]

@Samueru-sama
Copy link

mmm I'm not sure what would be missing, no idea how tauri handles https connections either.

Before I've had that problem of libssl missing. I've also have had to add stuff like libnss and pkcs11 to fix other networking issues.

Note that lib4bin I often run it with xvfb as xvfb-run -a -- ./lib4bin -e ..., this makes lib4bin launch the app for 5 seconds with strace to find all the dlopened libraries. I didn't do it in that the example script I shared because I found out that the app refuses to run as root, which commonly happens when the script gets deployed in the CI.

@olekolek1000
Copy link

It works! Thanks for the hint!
Webkit needs gio modules. Also I've added libssl and libcrypto by default to the list, just in case.

./lib4bin -p -v -r -s -k ./usr/bin/wayvr_dashboard \
        /usr/lib/x86_64-linux-gnu/libGL* \
        /usr/lib/x86_64-linux-gnu/libEGL* \
        /usr/lib/x86_64-linux-gnu/libvulkan* \
        /usr/lib/x86_64-linux-gnu/dri/* \
        /usr/lib/x86_64-linux-gnu/libpulsecommon* \
        /usr/lib/x86_64-linux-gnu/libnss_mdns* \
        /usr/lib/x86_64-linux-gnu/libssl.so.3 \
        /usr/lib/x86_64-linux-gnu/libcrypto.so.3 \
        /usr/lib/x86_64-linux-gnu/gio/modules/* <------ This

@Samueru-sama
Copy link

It works! Thanks for the hint! Webkit needs gio modules. Also I've added libssl and libcrypto by default to the list, just in case.

./lib4bin -p -v -r -s -k ./usr/bin/wayvr_dashboard \
        /usr/lib/x86_64-linux-gnu/libGL* \
        /usr/lib/x86_64-linux-gnu/libEGL* \
        /usr/lib/x86_64-linux-gnu/libvulkan* \
        /usr/lib/x86_64-linux-gnu/dri/* \
        /usr/lib/x86_64-linux-gnu/libpulsecommon* \
        /usr/lib/x86_64-linux-gnu/libnss_mdns* \
        /usr/lib/x86_64-linux-gnu/libssl.so.3 \
        /usr/lib/x86_64-linux-gnu/libcrypto.so.3 \
        /usr/lib/x86_64-linux-gnu/gio/modules/* <------ This

Good to know.

I'm trying to PR a webkitgtk hook to lib4bin so that most of this gets done automatically. There is one already for gio

@Samueru-sama
Copy link

@olekolek1000 The PR has been merged and now lib4bin handles webkit2gtk.

Use this as reference to know what needs to be removed.

@olekolek1000
Copy link

@Samueru-sama Works flawlessly 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working distribution Something related to the packaged binaries, app-images and installers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants