DesktopEditors icon indicating copy to clipboard operation
DesktopEditors copied to clipboard

Linux binaries crashes on startup on Wayland

Open WhyNotHugo opened this issue 4 years ago • 45 comments

Do you want to request a feature or report a bug? A bug

What is the current behavior? Crash on startup:

$ onlyoffice-desktopeditors
This application failed to start because it could not find or load the Qt platform plugin "wayland"
in "".

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

Reinstalling the application may fix this problem.
zsh: abort (core dumped)  onlyoffice-desktopeditors

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Run the binaries here on Linux with any wayland compositor (crash will probably not happen on Xorg, but haven't checked).

What is the expected behavior?

Should start normally.

Which versions of DesktopEditors, and which OS are affected by this issue? Did this work in previous versions of DesktopEditors?

Haven't tried previous versions.

Other notes

This looks like something's misconfigured in the pipeline that builds the binaries themselves, and is likely not a code error in itself. I tries looking at how this is configured, but couldn't find the pipelines that do the building/releasing.

WhyNotHugo avatar May 11 '20 00:05 WhyNotHugo

Run the binaries here on Linux with any wayland compositor

Hi, any advice on simplest way to setup system with Wayland?

ShockwaveNN avatar May 12 '20 06:05 ShockwaveNN

I believe you can run sway (a light wayland compositor) inside Xorg, and it'll run wayland nested inside Xorg. I don't have Xorg set up on my system, so I'm not entirely sure of the finer details, but IIRC, just running sway from a terminal should work.

As an alternative, I do believe that recent Ubuntu/Fedora releases let you pick wayland from the login screen.

WhyNotHugo avatar May 12 '20 15:05 WhyNotHugo

I've failed to find the build scripts for these binaries, but if you can point me to them, I can try and pinpoint what's wrong there. I have an impression that the Qt build is missing wayland support for some reason

WhyNotHugo avatar May 12 '20 15:05 WhyNotHugo

I believe you can run sway (a light wayland compositor) inside Xorg, and it'll run wayland nested inside Xorg.

Ok, we'll try it. @XDmitryK please try to run DesktopEditors on Ubuntu with wayland server, I think this instruction is enough

I've failed to find the build scripts for these binaries

All build instuction at https://github.com/ONLYOFFICE/build_tools repo

ShockwaveNN avatar May 12 '20 15:05 ShockwaveNN

@WhyNotHugo I launched the desktop on Ubuntu 20.04 with WayLand (deb package) What installation method did you use? And also our need information about your OS Oracle VM VirtualBox 202

XDmitryK avatar May 13 '20 11:05 XDmitryK

I installed via an ArchLinux User Package which basically downloads upstream binaries.

Maybe it's running via XWayland. Can you try either:

  • Running via a terminal after running unset DISPLAY, or
  • Running via a terminal setting QT_QPA_PLATFORM=wayland?

That should force it to use Wayland, at which point you might see the error I'm mentioning. (Also, if you enable desktop scaling to something like 1.5x, you'll probably notice the version running via Xorg scales very blurry. This is due to an Xorg limitation).

WhyNotHugo avatar May 13 '20 15:05 WhyNotHugo

@WhyNotHugo Unfortunately on Ubuntu this is not repeated Can you send us an image of your system in a VM file?

XDmitryK avatar May 14 '20 10:05 XDmitryK

I'd like to confirm that this issue is still present in the latest versions (6.0.0. and 5.6.4). I am running Arch Linux and Sway, and I have tried both the version from the AUR (updated today) and the latest AppImage.

The binaries work on XWayland (QT_QPA_PLATFORM=xcb) but this causes the editor to become blurry on displays with scaling enabled as mentioned before.

sheepymeh avatar Oct 17 '20 10:10 sheepymeh

Same issue here. Sway on arch linux. However, so far QT_QPA_PLATFORM=xcb seems to fix it.

andersfylling avatar Dec 02 '20 16:12 andersfylling

Using QT_QPA_PLATFORM=xcb forces the application to run via XWayland, which has it's own set of issues. I'd rather just run the application natively.

@XDmitryK Can you try using the latest fedora image? It has a nice GUI to switch to use Wayland instead of Xorg.

However, did the application run okay for you after running unset DISPLAY? That should not be possible, since it should not be able to communicate with Xorg if this variable is unset.

WhyNotHugo avatar Dec 03 '20 20:12 WhyNotHugo

Version v6.1.0 is out, still not compiled with wayland support

genofire avatar Dec 08 '20 11:12 genofire

I am using the latest version Manjaro (it's a rolling release) and installed the "onlyoffice-desktopeditors" from the official package repository and it's working just fine under Wayland. I guess it's using XWayland tho, because everything is blurred on my 4K display with fractional scaling enabled. On the FullHD Monitor which is not using fractional scaling it's looking good.

So if it's possible to build the Qt application (it's not using electron right?) with native Wayland support, i would be very happy to test it :heart:

major-mayer avatar Dec 11 '20 09:12 major-mayer

I guess it's using XWayland tho, because everything is blurred on my 4K display with fractional scaling enabled.

I'd guess it's using XWayland too. You can confirm this by running xeyes, and moving the cursor around on top of onlyoffice. If the eyes track the cursor, then the application is using xwayland.

If you're using sway, you can also confirm by inspecting the output of swaymsg -t get_tree.

WhyNotHugo avatar Dec 11 '20 11:12 WhyNotHugo

Uhh nice tool, didn't know about this yet. And yes as you expected, the eyes track the cursor over the whole onlyoffice window which does not happen on native GTK3 apps or things like Thunderbird and Firefox(-Wayland)

major-mayer avatar Dec 11 '20 12:12 major-mayer

It'd be great if they could update to the latest version of QT in order to natively support Wayland protocol...

duvh93 avatar Jan 14 '21 15:01 duvh93

Anything new here @ShockwaveNN @XDmitryK ? Would be really nice if this could be fixed at some point. Wayland support of most Qt apps is pretty solid nowadays, so I wonder why this couldn't get archived for onlyoffice too.

If you really need it, I can configure you a vm with a Wayland session pre-set, but it shouldn't be too hard to reproduce this on your own.

Just start your already working Ubuntu Gnome Desktop with session type Wayland (you can choose this with the bottom right gear icon if you are using GDM (depending on your theme)) and execute onlyoffice with the parameter --platform wayland. Et voilà Onlyoffice doesn't start anymore, because somehow it isn't compiled with Qt's Wayland support (that's where I can't help either unfortunately).

major-mayer avatar Mar 18 '21 22:03 major-mayer

@major-mayer I confim this bug is reproduced. i posted this in our local bugtracker.(bug 49179)

XDmitryK avatar Mar 19 '21 10:03 XDmitryK

Thanks you for the confirmation 👍

major-mayer avatar Mar 19 '21 11:03 major-mayer

I guess that adding '-qt-wayland' to qt_params in build_tools/automate.py may resolve this issue.

shih-liang avatar Apr 17 '21 06:04 shih-liang

Those scripts seem broken though. I ran:

git clone [email protected]:ONLYOFFICE/build_tools.git
cd build_tools
mkdir out
docker build --tag onlyoffice-document-editors-builder .
docker run -v $PWD/out:/build_tools/out onlyoffice-document-editors-builder

And it failed on the last command:

update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/appletviewer to provide /usr/bin/appletviewer (appletviewer) in auto mode
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/bin/jconsole to provide /usr/bin/jconsole (jconsole) in auto mode
Setting up libatk-wrapper-java-jni:amd64 (0.30.4-4) ...
Processing triggers for libc-bin (2.19-0ubuntu6.15) ...
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
Nothing to configure.
There is only one alternative in link group javac (providing /usr/bin/javac): /usr/lib/jvm/java-8-openjdk-amd64/bin/javac
Nothing to configure.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   310  100   310    0     0    844      0 --:--:-- --:--:-- --:--:--   844
100   196  100   196    0     0    317      0 --:--:-- --:--:-- --:--:--   317
tar: This does not look like a tar archive
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
install dependencies...
install qt...
Error (tar): 2

I haven't even made any changes to it. Is this currently being used to generate the builds?

WhyNotHugo avatar May 12 '21 16:05 WhyNotHugo

@WhyNotHugo Problem with qt link described here - https://github.com/ONLYOFFICE/build_tools/issues/306

ShockwaveNN avatar May 13 '21 07:05 ShockwaveNN

For quite some time, this worked for me on Manjaro with Sway DM and the environment variable `` set. However, now I get

This application failed to start because it could not find or load the Qt platform plugin "wayland"
in "QT_QPA_PLATFORM=wayland".

again. Also, I confirm that I have qt5-wayland installed:

$ pacman -Qs qt5-wayland
local/qt5-wayland 5.15.2+kde+r36-1 (qt qt5)
    Provides APIs for Wayland

patzm avatar Dec 13 '21 17:12 patzm

The problem is still here on version 7.0.0 : onlyoffice isn't compatible with wayland. I tried to add the "-qt-wayland" parameter in build_tools/automate.py and compiled but got this error : ERROR: Unknown command line option '-qt-wayland'.

It could be great if devs could implement wayland support because it is blurry on my hidpi screen : is this feature planned ?

maximushugus avatar Feb 05 '22 17:02 maximushugus

@maximushugus Sorry, the issue with Wayland is still actual and I don't quite remember, but I think because we use rather old CEF as the base of our app

I cannot promise that we have enough resources to fix it soon, sorry

ShockwaveNN avatar Feb 05 '22 17:02 ShockwaveNN

@maximushugus Sorry, the issue with Wayland is still actual and I don't quite remember, but I think because we use rather old CEF as the base of our app

I cannot promise that we have enough resources to fix it soon, sorry

What do you mean by "CEF" ?

maximushugus avatar Feb 05 '22 17:02 maximushugus

Chromium Embedded Framework

On Sat, 5 Feb 2022, 20:21 maximushugus, @.***> wrote:

@maximushugus https://github.com/maximushugus Sorry, the issue with Wayland is still actual and I don't quite remember, but I think because we use rather old CEF as the base of our app

I cannot promise that we have enough resources to fix it soon, sorry

What do you mean by "CEF" ?

— Reply to this email directly, view it on GitHub https://github.com/ONLYOFFICE/DesktopEditors/issues/382#issuecomment-1030663667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFDG3HB6V3H6IRJXLHGOJ3UZVMDBANCNFSM4M5PL3WA . You are receiving this because you were mentioned.Message ID: @.***>

ShockwaveNN avatar Feb 05 '22 17:02 ShockwaveNN

I'm don't know how you combine CEF and Qt (two desktop toolkits?) but CEF still does not feature native Wayland support for embedded apps. So even upgrading wouldn't help...

Edit : for reference see here https://bitbucket.org/chromiumembedded/cef/issues/2804/ozone-wayland-x11-support

major-mayer avatar Feb 05 '22 17:02 major-mayer

So my memory is right, and yes we defenetly use CEF

ShockwaveNN avatar Feb 05 '22 17:02 ShockwaveNN

For CEF you can use common Chromium flags to enable the usage of Wayland (those work with CEF, with Electron, with Chrome, etc). For reference, ArchWiki Page. If you are using an older CEF version, as stated above, use --enable-features=UseOzonePlatform --ozone-platform=wayland. This works for Spotify (although their wrapper has X11 hardcoded and generates two windows, which shouldn't happen here as Qt supports wayland). So, for this case it should be, if installed from Flatpak:

flatpak run --env=QT_QPA_PLATFORM=wayland org.onlyoffice.desktopeditors --enable-features=UseOzonePlatform --ozone-platform=wayland

But your distributed Qt does not have the "wayland" plugin.

Available platform plugins are: linuxfb, minimal, offscreen, vnc, xcb.

If you can enable the plugin and the flags I mentioned are passed to CEF, it should work fine.

juxuanu avatar Apr 11 '22 13:04 juxuanu

@juxuanu Thanks, I'll show this to our devs

ShockwaveNN avatar Apr 11 '22 13:04 ShockwaveNN