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

Cryptomator can't start: Desktop API is not supported on the current platform #1230

Closed
x80486 opened this issue May 29, 2020 · 21 comments
Closed
Labels
os:linux type:bug Something isn't working
Milestone

Comments

@x80486
Copy link

x80486 commented May 29, 2020

Description

I just downloaded the latest version (1.5.5) and it doesn't run. Not sure if this is because a missing library in GNOME 3.36.2 or something with Cryptomator + Linux in general. Where is the Flatpak version anyway 😎

System Setup

  • Operating system and version: Arch Linux (Linux uplink 5.4.42-1-lts #1 SMP Wed, 20 May 2020 20:42:53 +0000 x86_64 GNU/Linux)
  • Cryptomator version: 1.5.5
  • Drive: N/A

Steps to Reproduce

  1. Download version 1.5.5
  2. Launch 🤣

Expected Behavior

Cryptomator should start, as the previous versions.

Actual Behavior

[x80486@uplink:~/Applications]$ ll 
total 126M
drwxr-xr-x 5 x80486 4.0K Feb  1 20:39 brave/
drwxr-xr-x 9 x80486 4.0K Apr  9 09:12 ideaIU/
drwxrwxrwx 4 x80486 4.0K Oct 27  2018 peazip_portable-6.6.1/
-r-xr-xr-x 1 x80486  75M May 16 22:31 Standard-Notes.AppImage*
-r-x--x--x 1 x80486  51M May 29 11:12 cryptomator-1.5.5-x86_64.AppImage*
[x80486@uplink:~/Applications]$ ./cryptomator-1.5.5-x86_64.AppImage --version 
11:25:11.572 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /tmp/.mount_cryptoaeRzZQ/lib/app:/tmp/.mount_cryptoaeRzZQ/bin
11:25:11.574 [main] DEBUG org.cryptomator.common.Environment - user.language: en
11:25:11.574 [main] DEBUG org.cryptomator.common.Environment - user.region: null
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin:~/.Cryptomator/ipcPort.bin
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.keychainPath: null
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.logDir: ~/.local/share/Cryptomator/logs
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.mountPointsDir: ~/.local/share/Cryptomator/mnt
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.minPwLength: null
11:25:11.575 [main] DEBUG org.cryptomator.common.Environment - cryptomator.buildNumber: appimage-1
11:25:11.600 [main] DEBUG org.cryptomator.common.ShutdownHook - Registered shutdown hook.
11:25:11.663 [main] DEBUG org.cryptomator.common.settings.SettingsProvider - Attempting to load settings from /home/x80486/.config/Cryptomator/settings.json
11:25:11.698 [main] INFO org.cryptomator.common.settings.SettingsProvider - Settings loaded from /home/x80486/.config/Cryptomator/settings.json
11:25:11.899 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator 1.5.5 on Linux 5.4.42-1-lts (amd64)
Exception in thread "main" java.lang.UnsupportedOperationException: Desktop API is not supported on the current platform
  at java.desktop/java.awt.Desktop.getDesktop(Unknown Source)
  at org.cryptomator.ui.launcher.UiLauncher.launch(UiLauncher.java:62)
  at org.cryptomator.launcher.Cryptomator.runGuiApplication(Cryptomator.java:91)
  at org.cryptomator.launcher.Cryptomator.run(Cryptomator.java:75)
  at org.cryptomator.launcher.Cryptomator.main(Cryptomator.java:48)
Cryptomator Failed to launch JVM

Reproducibility

Always

@x80486 x80486 added the type:bug Something isn't working label May 29, 2020
@overheadhunter
Copy link
Member

Funnily enough the line in question didn't change for 9 months.

I.e. something else must have changed in your setup.

That said, we can easily wrap the line with a Desktop.isDesktopSupported() check.

@x80486
Copy link
Author

x80486 commented May 29, 2020

The last version I had was 1.5.1. Somehow, the JDK version bundled with that one was OK with the Desktop.isDesktopSupported() call under Wayland. I notice that if I switch to X11 it works fine. I know Arch Linux updates stuff continuously, so I can't really tell what changed 🙄

Not sure if you would like to place a guard for this kind of scenario(s). If so, keep this one opened until it's added, otherwise feel free to close it... I can start it via X11.

@ghost
Copy link

ghost commented Jun 1, 2020

I'm having the same problem. I'm running Arch/Plasma/X11, no wayland.
1.5.3 still works, 1.5.4 and above doesn't. So since I'm already running X11, is this really a X11/wayland thing?
Thanks!

@ghost
Copy link

ghost commented Jun 20, 2020

it isn't an Arch/Plasma problem because I'm running Debian Buster 10.4 and have the same problem (got adoptopenjdk 14). Appimage 1.5.3 is starting and running without problems (the ones before it too) but 1.5.4 and 1.5.5 give me the mentioned "Cryptomator Failed to launch JVM" error. Hope that it will be fixed with 1.5.6 again @overheadhunter

@ghost
Copy link

ghost commented Jun 24, 2020

the new 1.5.6 appimage is just debugging when executed and crashes straight after 3 seconds without any error being displayed when I execute it in the terminal. anyone else?

summary:
1.4.x up to 1.5.3 is working without issues, 1.5.4 and 1.5.5 displaying the Java JVM error and 1.5.6 just crashes immediately after debugging for 3 seconds

@overheadhunter
Copy link
Member

@Distrotube Beginning with version 1.5.4 we re-added jdk.gtk.version=2 due to problems in various distros. See cryptomator/cryptomator-linux#9 and see if removing this flag helps in any way.

@infeo
Copy link
Member

infeo commented Jun 24, 2020

On my Debian Buster VM Cryptomator works as expected.

@Distrotube What is your system setup? Installing an JDK does not change the situation, because Cryptomator ships its own JVM. But since you already installed it, can you try to run the buildkit release? Just unzip it an execute the launcher-linux.sh file

@ghost
Copy link

ghost commented Jun 24, 2020

WORKING SOLUTION BELOW

@infeo I'm running Debian Buster x86 (apparently its a 32bit userland with a 64bit kernel on a x64 Intel Atom CPU)
Linux raspberry 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07) x86_64 GNU/Linux

following your advice, I get this output without modifying the launcher-linux.sh file (btw. I'll tried the same with the 1.5.3 buildkit release and get the same output as below and nothing opens whereas simply executing the 1.5.3 appimage just works as intended):

pi@raspberry:~/Downloads $ ./launcher-linux.sh 
16:43:48.097 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
16:43:48.143 [main] DEBUG org.cryptomator.common.Environment - user.language: en
16:43:48.144 [main] DEBUG org.cryptomator.common.Environment - user.region: null
16:43:48.145 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
16:43:48.146 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json
16:43:48.147 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin
16:43:48.148 [main] DEBUG org.cryptomator.common.Environment - cryptomator.keychainPath: null
16:43:48.150 [main] DEBUG org.cryptomator.common.Environment - cryptomator.logDir: ~/.local/share/Cryptomator/logs
16:43:48.151 [main] DEBUG org.cryptomator.common.Environment - cryptomator.mountPointsDir: ~/.local/share/Cryptomator/mnt
16:43:48.152 [main] DEBUG org.cryptomator.common.Environment - cryptomator.minPwLength: null
16:43:48.152 [main] DEBUG org.cryptomator.common.Environment - cryptomator.buildNumber: null
16:43:48.438 [main] DEBUG org.cryptomator.common.ShutdownHook - Registered shutdown hook.
16:43:48.949 [main] DEBUG org.cryptomator.common.settings.SettingsProvider - Attempting to load settings from /home/pi/.config/Cryptomator/settings.json
16:43:49.261 [main] INFO org.cryptomator.common.settings.SettingsProvider - Settings loaded from /home/pi/.config/Cryptomator/settings.json
GLib-GIO-Message: 16:43:49.714: Using the 'memory' GSettings backend.  Your settings will not be saved or shared with other applications.
16:43:51.173 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator 1.5.6 on Linux 4.19.0-9-amd64 (amd64)
Exception in thread "main" java.lang.UnsupportedOperationException: Desktop API is not supported on the current platform
	at java.desktop/java.awt.Desktop.getDesktop(Desktop.java:303)
	at org.cryptomator.ui.launcher.AppLifecycleListener.<init>(AppLifecycleListener.java:47)
	at org.cryptomator.ui.launcher.AppLifecycleListener_Factory.get(AppLifecycleListener_Factory.java:41)
	at org.cryptomator.ui.launcher.AppLifecycleListener_Factory.get(AppLifecycleListener_Factory.java:11)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.traymenu.TrayMenuController_Factory.get(TrayMenuController_Factory.java:40)
	at org.cryptomator.ui.traymenu.TrayMenuController_Factory.get(TrayMenuController_Factory.java:12)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.ui.traymenu.TrayIconController_Factory.get(TrayIconController_Factory.java:32)
	at org.cryptomator.ui.traymenu.TrayIconController_Factory.get(TrayIconController_Factory.java:9)
	at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
	at org.cryptomator.launcher.DaggerCryptomatorComponent$TrayMenuComponentImpl.trayIconController(DaggerCryptomatorComponent.java:876)
	at org.cryptomator.ui.traymenu.TrayMenuComponent.addIconToSystemTray(TrayMenuComponent.java:20)
	at org.cryptomator.ui.launcher.UiLauncher.launch(UiLauncher.java:47)
	at org.cryptomator.launcher.Cryptomator.runGuiApplication(Cryptomator.java:91)
	at org.cryptomator.launcher.Cryptomator.run(Cryptomator.java:75)
	at org.cryptomator.launcher.Cryptomator.main(Cryptomator.java:48)
pi@raspberry:~/Downloads $ 

SOLUTION:
got the latest Appimage 1.5.6 working by simply removing jdk.gtk.version=2
from launcher-linux.sh thanks
@overheadhunter

That means your precompiled Appimages won't work on my machine anymore and I have to fall back to the buildkit.linux.zip and modify it like this every time a new version gets released? (Or can I turn the modified buildkit into an appimage so that I'm able to use it again as single executable file?)

@infeo
Copy link
Member

infeo commented Jun 24, 2020

Or can I turn the modified buildkit into an appimage so that I'm able to use it again as single executable file?

@Distrotube see #1167 (comment)

@x80486 , @guschtlswife : Can you confirm this? Then we need to think about a strategy for staying on the tightrope between using the option or not.

@overheadhunter
Copy link
Member

Actually I would consider this a JavaFX bug, but its probably faster to solve it ourselves, if we find a way to determine the GTK version before launch.

@ghost
Copy link

ghost commented Jun 25, 2020

@x80486 , @guschtlswife : Can you confirm this? Then we need to think about a strategy for staying on the tightrope between using the option or not.

Confirmed! Removing jdk.gtk.version=2 from launcher-linux.sh makes it working again. Thanks!

@infeo
Copy link
Member

infeo commented Nov 16, 2020

@x80486 @guschtlswife Can you retest, if this problem persists with the current beta?

@infeo infeo added the state:awaiting-response We need further input from the issue author label Nov 16, 2020
@x80486
Copy link
Author

x80486 commented Nov 16, 2020

It doesn't run for me under Arch Linux — but it's because of the GTK version (this happens almost all the time). It does run well under Ubuntu (VM), so I guess it will work.

@no-response no-response bot removed the state:awaiting-response We need further input from the issue author label Nov 16, 2020
@overheadhunter
Copy link
Member

but it's because of the GTK version

that's exactly what should have been fixed in this beta. 😢

@ghost
Copy link

ghost commented Nov 16, 2020

I rechecked:
1.5.8 doesn't start giving "Desktop API not supported".
1.5.9-beta2 starts up fine!
So looks solved over here, thanks!

@purejava
Copy link
Contributor

I started it on Arch linux as well. It does run and work, but prints Debian specific log messages on start:

ralph@fusion Downloads % ./cryptomator-1.5.9-beta2-x86_64.AppImage 
which: no dpkg in (/usr/local/bin:/usr/local/sbin:/usr/bin:/home/ralph/.local/share/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
/tmp/.mount_cryptoKQ8Rec/AppRun: Zeile 8: dpkg: Kommando nicht gefunden.
/tmp/.mount_cryptoKQ8Rec/AppRun: Zeile 9: dpkg: Kommando nicht gefunden.
18:34:04.000 [main] DEBUG org.cryptomator.common.Environment - java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - user.language: de
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - user.region: null
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - logback.configurationFile: null
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.settingsPath: ~/.config/Cryptomator/settings.json:~/.Cryptomator/settings.json
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.ipcPortPath: ~/.config/Cryptomator/ipcPort.bin:~/.Cryptomator/ipcPort.bin
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.keychainPath: null
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.logDir: ~/.local/share/Cryptomator/logs
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.mountPointsDir: ~/.local/share/Cryptomator/mnt
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.minPwLength: null
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - cryptomator.buildNumber: appimage-1
18:34:04.002 [main] DEBUG org.cryptomator.common.Environment - fuse.experimental: false
18:34:04.033 [main] DEBUG org.cryptomator.common.ShutdownHook - Registered shutdown hook.
18:34:04.099 [main] DEBUG org.cryptomator.common.settings.SettingsProvider - Attempting to load settings from /home/ralph/.config/Cryptomator/settings.json
18:34:04.156 [main] INFO org.cryptomator.common.settings.SettingsProvider - Settings loaded from /home/ralph/.config/Cryptomator/settings.json
18:34:04.428 [main] INFO  org.cryptomator.launcher.Cryptomator - Starting Cryptomator 1.5.9-beta2 on Linux 5.9.4-arch1-1 (amd64)
18:34:04.658 [JavaFX Application Thread] INFO  o.c.ui.launcher.FxApplicationStarter - JavaFX Runtime started.
18:34:18.039 [App Background Thread 003] INFO  o.c.ui.unlock.UnlockWorkflow - Unlock of 'Test' succeeded.
18:34:18.063 [JavaFX Application Thread] INFO  o.cryptomator.ui.common.VaultService - Revealed Test
18:34:21.959 [JavaFX Application Thread] INFO  o.cryptomator.ui.common.VaultService - Locked Test
18:34:24.451 [main] INFO  org.cryptomator.launcher.Cryptomator - UI shut down

@infeo
Copy link
Member

infeo commented Nov 16, 2020

This alone should not happen.

We created a start script checking for the installed gtk version specific to different distros:
https://github.com/cryptomator/cryptomator-linux/blob/d1e2b8ae9ecd0c450f2ce30b371b72fcb561ea46/resources/appimage/AppDir/bin/cryptomator.sh#L5-#L18

On arch, which dpkg should return nothing.

@ghost
Copy link

ghost commented Nov 16, 2020

Running that code snippet from
https://github.com/cryptomator/cryptomator-linux/blob/d1e2b8ae9ecd0c450f2ce30b371b72fcb561ea46/resources/appimage/AppDir/bin/cryptomator.sh#L5-#L18
on Arch actually gives an output:

which: no dpkg in (/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
./test.sh: Zeile 4: dpkg: Kommando nicht gefunden.
./test.sh: Zeile 5: dpkg: Kommando nicht gefunden.

@purejava
Copy link
Contributor

On arch, which dpkg should return nothing.

I think this is due to the fact that I use zsh instead of bash.
which dpkg on zsh returns:


ralph@Mac ~ % which dpkg     
dpkg not found
ralph@Mac ~ % 

while running this on bash returns nothing as you expect it.

@overheadhunter
Copy link
Member

It is kind of ugly to check the stdout instead of the exit value anyway. We should avoid which and use command instead: https://stackoverflow.com/a/677212/4014509

command's exit status is well defined by POSIX, so that one is probably the safest to use.

@overheadhunter
Copy link
Member

Fixed in 1.5.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os:linux type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants