theia-blueprint icon indicating copy to clipboard operation
theia-blueprint copied to clipboard

Appimage wont start at all (1.51)(Wayland)

Open squalou opened this issue 1 year ago • 5 comments

Bug Description:

Downloaded latest Appimage, chmod +x, try to run it.

First I got a segmentation fault, tried again and since then I get

Error: node-loader:
Error: /tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/native/pty.node: cannot open shared object file: No such file or directory
    at 24632 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:599)

sometimes the seg fault is back

Steps to Reproduce:

  1. Download latet AppImage (at the moment : 1.51)
  2. chmod +x TheiaIDE.AppImage
  3. ./TheiaIDE.AppImage
Error: node-loader:
Error: /tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/native/pty.node: cannot open shared object file: No such file or directory
    at 24632 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:599)
    at i (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/main.js:1:14494)
    at 85969 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:1392011)
    at i (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/main.js:1:14494)
    at 87047 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:1387699)
    at i (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/main.js:1:14494)
    at 3979 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:410632)
    at i (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/main.js:1:14494)
    at 47552 (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/268.js:2:402568)
    at i (/tmp/.mount_TheiaInkhtIA/resources/app/lib/backend/main.js:1:14494)


Additional Information

  • Operating System: PopOS 22.04
  • Theia Version: 1.51
  • Using Wayland

Workaround

see below to use x11 instead of wayland

squalou avatar Jul 15 '24 08:07 squalou

OK probably my bad : I'm using wayland.

./TheiaIDE.AppImage --ozone-platform=x11

and it works

squalou avatar Jul 15 '24 16:07 squalou

@squalou Is this issue then closed for you or do you want to adapt the description?

JonasHelming avatar Jul 22 '24 09:07 JonasHelming

I am observing the same issue in a KDE Plasma 6 Wayland session on an up-to-date Endeavour OS. Launching the TheiaIDE.AppImage (version 1.52) gives:

$ ~/Downloads/TheiaIDE.AppImage             
Configuring to accept webviews on '^.+\.webview\..+$' hostname.
2024-08-13T12:14:46.233Z root INFO Backend u.initialize: 14.8 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend Object.initialize: 13.8 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend a.initialize: 1.2 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend a.initialize: 1.0 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend a.initialize: 0.8 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend f.initialize: 0.9 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.237Z root INFO Backend l.initialize: 0.8 ms [Finished 0.413 s after backend start]
2024-08-13T12:14:46.239Z root INFO Backend l.initialize: 15.0 ms [Finished 0.414 s after backend start]
2024-08-13T12:14:46.242Z root INFO configured all backend app contributions
2024-08-13T12:14:46.242Z root INFO Backend l.onStart: 1.0 ms [Finished 0.423 s after backend start]
2024-08-13T12:14:46.242Z root INFO Configuration directory URI: 'file://~/.theia'
2024-08-13T12:14:46.243Z root INFO Theia app listening on http://127.0.0.1:38355.
2024-08-13T12:14:46.244Z root INFO Backend g.onStart: 1.7 ms [Finished 0.424 s after backend start]
2024-08-13T12:14:46.244Z root INFO Backend a.onStart: 0.2 ms [Finished 0.425 s after backend start]
2024-08-13T12:14:46.254Z root INFO Backend p.onStart: 0.2 ms [Finished 0.425 s after backend start]
2024-08-13T12:14:46.254Z root INFO Backend n.onStart: 9.8 ms [Finished 0.435 s after backend start]
2024-08-13T12:14:46.254Z root INFO Finished starting backend application: 0.0 ms [Finished 0.435 s after backend start]
2024-08-13T12:14:46.255Z root WARN The local plugin referenced by local-dir:~/.theia-ide/plugins does not exist.
2024-08-13T12:14:46.256Z root WARN The local plugin referenced by local-dir:~/.theia-ide/deployedPlugins does not exist.
2024-08-13T12:14:46.293Z root INFO Resolve plugins list: 49.7 ms [Finished 0.473 s after backend start]
2024-08-13T12:14:46.368Z root INFO Deploy plugins list: 125.2 ms [Finished 0.549 s after backend start]
[1]    30395 segmentation fault (core dumped)  ~/Downloads/TheiaIDE.AppImage

The workaround ./TheiaIDE.AppImage --ozone-platform=x11 by @squalou makes Theia IDE launch successfully and use its proper icon. After that, --ozone-platform=x11 is not any more necessary. However, the IDE gets assigned a generic Wayland icon:

grafik

See here, here, and here for options on how to fix it.

maehne avatar Aug 13 '24 12:08 maehne

@squalou Is this issue then closed for you or do you want to adapt the description?

Well I don't know if this is to be considered an issue, or just a missing documentation somewhere, I'll just adapt the description for now to help maybe other people find it, but as far as I'm concerned you also could close the issue due to the workaround.

squalou avatar Aug 13 '24 13:08 squalou

From my point of view, this is clearly a Wayland-related issue, which should be kept open until the workaround --ozone-platform=x11 is not necessary.

maehne avatar Aug 13 '24 13:08 maehne

I just download the latest theia-ide appimage and ran into the same issue reported by OP. theia segfaults when being run for the first time without --ozone-platform=x11

I've included a workaround summary that lets Theia run wayland-native at the bottom. Below are some thoughts and debugging details.

Debugging details

Running with --ozone-platform=x11 lets theia run just fine. However, it uses x11-wayland, which doesn't support fractional scaling, so theia looks terrible on my laptop under x11-wayland.

I was able to run theia with --ozone-platform=wayland and it correctly uses wayland and fractional scaling works, so theia does indeed work natively on wayland. However, I tried running the appimage for the first time (immediately after downloading) using --ozone-platform=wayland and it segfaulted, so it appears that theia needs to be run under x11-wayland first, then it will work wayland-native after that.

Electron apps generally don't use wayland by default yet, so we have to run electron apps with --ozone-platform=wayland or --ozone-platform-hint=wayland (--ozone-platform-hint=auto also works sometimes). There's also an ELECTRON_OZONE_PLATFORM_HINT environment variable that can be set.

I have ELECTRON_OZONE_PLATFORM_HINT set to auto. The appimage uses wayland without any arguments for me, i.e., ./TheiaIDE.AppImage uses wayland. So indeed, --ozone-platform=x11 is needed on first launch, but after that all the ways to force electron to use wayland appear to be working.

If someone else wants to verify that using --ozone-platform=x11 is needed upon first launch, that would be great.

I don't think needing --ozone-platform=x11 on first launch is an electron issue, but it might be. It could be a Theia issue or an electron issue. I did not need to use --ozone-platform=x11 the first time I launched VS Codium, which makes me think this is a Theia issue. However, I haven't verified that Codium and Theia are using the same electron version.


Workaround summary

To get Theia to use wayland:

  1. Run the appimage with --ozone-platform=x11 the first time you run it: ./TheiaIDE.AppImage --ozone-platform=x11
  2. Run Theia with --ozone-platform=wayland, --ozone-platform-hint=wayland, --ozone-platform-hint=auto, or setting the ELECTRON_OZONE_PLATFORM_HINT environment variable to auto or wayland.

In my experience, Theia uses the correct icon instead of a generic wayland icon. This might just be something that is fixed/different in version 1.57.100 vs 1.51. I have not verified this.

tvannoy avatar Jan 10 '25 05:01 tvannoy

I just did the following on Ubuntu: 24.10

  1. echo $XDG_SESSION_TYPE gives 'wayland'
  2. Downloaded the latest app image (1.58.100)
  3. chmod and run the app image
  4. The IDE starts without trouble.

@tvannoy what am I missing?

tsmaeder avatar Feb 19 '25 13:02 tsmaeder

Everything seems to be working fine for me now, too. I tried with the latest AppImage as well as a few other versions including 1.51 (which the issue started with). They all launched just fine for me under Wayland. I removed the .theia and .config/Theia IDE folders to try starting fresh each time, though maybe there was some leftover config somewhere else.

I am using the Cinnamon DE on Debian right now. Before I was using hyprland on Debian, which is broken right now so I can't test.

@tsmaeder I think we can close this issue. Everything seems to be working perfectly, at least on major distros and DEs.

tvannoy avatar Feb 21 '25 02:02 tvannoy

@tsmaeder Here's how to reproduce it on my Debian 12 with a Gnome wayland session: if ELECTRON_OZONE_PLATFORM_HINT environment variable is set to wayland in order to use electron applications with wayland, first run of TheiaIDE.AppImage crashes with "Segmentation Fault". If the first run could be made by passing --ozone-platform=x11, subsequent runs work without passing any options on wayland. So it seems it's capable of working on wayland except the first run.

omhomurlu avatar Mar 26 '25 05:03 omhomurlu