cryptomator / webdav-nio-adapter

Jackrabbit-based servlets running on embedded Jetty to serve a directory specified by a java.nio.file.Path
GNU Affero General Public License v3.0
12 stars 8 forks source link

ERROR [Vault:144] Unable to mount filesystem #7

Closed swiesend closed 7 years ago

swiesend commented 7 years ago

I have encountered the following problem with the release candidate Cryptomator 1.3.0-rc3 on Linux 4.8.0-49-generic (amd64) under Ubuntu 16.04 (64 Bit) with using the webdav schema option instead of dav.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

The Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy is installed/enabled.

The problem seems to be reproducible on my machine also with a new session.

$ cat ~/.Cryptomator/cryptomator.log
2017-04-27 12:13:53,970 INFO  [Cryptomator:21] Starting Cryptomator 1.3.0-rc3 on Linux 4.8.0-49-generic (amd64)
2017-04-27 12:13:54,228 INFO  [MainApplication:19] JavaFX application started.
2017-04-27 12:13:54,315 INFO  [SettingsProvider:100] Settings loaded from /home/sebastian/.Cryptomator/settings.json
2017-04-27 12:13:54,317 DEBUG [DebugMode:46] Debug mode initialized
2017-04-27 12:13:54,320 DEBUG [Localization:45] Loaded localization default file: /localization/en.txt
2017-04-27 12:13:54,320 INFO  [Localization:49] Detected language "de" and region "DE"
2017-04-27 12:13:54,320 INFO  [Localization:54] Attempting to load localization from: /localization/de_DE.txt
2017-04-27 12:13:54,321 INFO  [Localization:59] Attempting to load localization from: /localization/de.txt
2017-04-27 12:13:54,812 DEBUG [WelcomeController:127] Checking for updates...
2017-04-27 12:13:55,186 INFO  [log:192] Logging initialized @1735ms to org.eclipse.jetty.util.log.Slf4jLog
2017-04-27 12:13:55,267 INFO  [WebDavServer:70] Binding server socket to localhost:42427
2017-04-27 12:13:55,278 INFO  [AbstractConnector:280] Started ServerConnector@6afe53e2{HTTP/1.1,[http/1.1]}{localhost:42427}
2017-04-27 12:13:55,328 INFO  [SettingsProvider:129] Settings saved to /home/sebastian/.Cryptomator/settings.json
2017-04-27 12:13:56,063 INFO  [WelcomeController:163] Current version: 1.3.0-rc3, lastest version: 1.2.3
2017-04-27 12:14:22,135 INFO  [Server:372] jetty-9.4.4.v20170414
2017-04-27 12:14:22,180 INFO  [ContextHandler:788] Started o.e.j.s.ServletContextHandler@4f3fb79b{/,null,AVAILABLE}
2017-04-27 12:14:22,182 INFO  [Server:444] Started @28732ms
2017-04-27 12:14:22,182 INFO  [WebDavServer:94] WebDavServer started.
2017-04-27 12:14:22,252 INFO  [session:364] DefaultSessionIdManager workerName=node0
2017-04-27 12:14:22,253 INFO  [session:369] No SessionScavenger set, using defaults
2017-04-27 12:14:22,254 INFO  [session:149] Scavenging every 660000ms
2017-04-27 12:14:22,262 INFO  [AbstractWebdavServlet:170] authenticate-header = Basic realm="Jackrabbit Webdav Server"
2017-04-27 12:14:22,264 INFO  [AbstractWebdavServlet:175] csrf-protection = null
2017-04-27 12:14:22,264 INFO  [AbstractWebdavServlet:182] createAbsoluteURI = true
2017-04-27 12:14:22,264 INFO  [ContextHandler:788] Started o.e.j.s.ServletContextHandler@442b1a88{/teGOsrDbSc59/vault,null,AVAILABLE}
2017-04-27 12:14:22,265 INFO  [WebDavServletController:51] WebDavServlet started: /teGOsrDbSc59/vault
2017-04-27 12:14:22,267 INFO  [WebDavServletController:94] Mounting http://localhost:42427/teGOsrDbSc59/vault using org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter
2017-04-27 12:14:22,295 ERROR [Vault:144] Unable to mount filesystem
org.cryptomator.frontend.webdav.mount.Mounter$CommandFailedException: Command failed with exit code 2. Expected 0. Stderr: Fehler beim Einhängen des Ortes: Ort kann nicht eingehängt werden

    at org.cryptomator.frontend.webdav.mount.ProcessUtil.assertExitValue(ProcessUtil.java:28) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter.mount(LinuxGvfsMounter.java:44) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.frontend.webdav.servlet.WebDavServletController.mount(WebDavServletController.java:95) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.ui.model.Vault.mount(Vault.java:139) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.controllers.UnlockController.unlock(UnlockController.java:342) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.controllers.UnlockController.lambda$didClickUnlockButton$0(UnlockController.java:335) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.lambda$asyncTaskOf$0(AsyncTaskService.java:37) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$null$6(AsyncTaskService.java:94) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.logExceptions(AsyncTaskService.java:123) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.access$100(AsyncTaskService.java:24) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$run$7(AsyncTaskService.java:92) ~[ui-1.3.0-rc3.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
2017-04-27 12:14:48,440 INFO  [ContextHandler:957] Stopped o.e.j.s.ServletContextHandler@442b1a88{/teGOsrDbSc59/vault,null,UNAVAILABLE}
2017-04-27 12:14:48,440 INFO  [WebDavServletController:65] WebDavServlet stopped: /teGOsrDbSc59/vault
2017-04-27 12:15:01,770 INFO  [MainApplication:40] JavaFX application stopped.
2017-04-27 12:15:01,787 DEBUG [InterProcessCommunicator:158] Server shut down.
2017-04-27 12:15:01,791 DEBUG [CleanShutdownPerformer:16] Running graceful shutdown tasks...
$ cat ~/.Cryptomator/cryptomator.log
2017-04-27 12:35:28,978 INFO  [Cryptomator:21] Starting Cryptomator 1.3.0-rc3 on Linux 4.8.0-49-generic (amd64)
2017-04-27 12:35:29,376 INFO  [MainApplication:19] JavaFX application started.
2017-04-27 12:35:29,450 INFO  [SettingsProvider:100] Settings loaded from /home/sebastian/.Cryptomator/settings.json
2017-04-27 12:35:29,451 DEBUG [DebugMode:46] Debug mode initialized
2017-04-27 12:35:29,454 DEBUG [Localization:45] Loaded localization default file: /localization/en.txt
2017-04-27 12:35:29,454 INFO  [Localization:49] Detected language "de" and region "DE"
2017-04-27 12:35:29,454 INFO  [Localization:54] Attempting to load localization from: /localization/de_DE.txt
2017-04-27 12:35:29,455 INFO  [Localization:59] Attempting to load localization from: /localization/de.txt
2017-04-27 12:35:29,949 DEBUG [WelcomeController:127] Checking for updates...
2017-04-27 12:35:30,360 INFO  [log:192] Logging initialized @1877ms to org.eclipse.jetty.util.log.Slf4jLog
2017-04-27 12:35:30,413 INFO  [WebDavServer:70] Binding server socket to localhost:42427
2017-04-27 12:35:30,423 INFO  [AbstractConnector:280] Started ServerConnector@62eb71a5{HTTP/1.1,[http/1.1]}{localhost:42427}
2017-04-27 12:35:30,433 INFO  [WelcomeController:163] Current version: 1.3.0-rc3, lastest version: 1.2.3
2017-04-27 12:35:30,458 INFO  [SettingsProvider:129] Settings saved to /home/sebastian/.Cryptomator/settings.json
2017-04-27 12:35:39,962 INFO  [Server:372] jetty-9.4.4.v20170414
2017-04-27 12:35:40,007 INFO  [ContextHandler:788] Started o.e.j.s.ServletContextHandler@6355c522{/,null,AVAILABLE}
2017-04-27 12:35:40,008 INFO  [Server:444] Started @11526ms
2017-04-27 12:35:40,008 INFO  [WebDavServer:94] WebDavServer started.
2017-04-27 12:35:40,103 INFO  [session:364] DefaultSessionIdManager workerName=node0
2017-04-27 12:35:40,103 INFO  [session:369] No SessionScavenger set, using defaults
2017-04-27 12:35:40,106 INFO  [session:149] Scavenging every 660000ms
2017-04-27 12:35:40,114 INFO  [AbstractWebdavServlet:170] authenticate-header = Basic realm="Jackrabbit Webdav Server"
2017-04-27 12:35:40,116 INFO  [AbstractWebdavServlet:175] csrf-protection = null
2017-04-27 12:35:40,117 INFO  [AbstractWebdavServlet:182] createAbsoluteURI = true
2017-04-27 12:35:40,117 INFO  [ContextHandler:788] Started o.e.j.s.ServletContextHandler@4a4970f8{/teGOsrDbSc59/vault,null,AVAILABLE}
2017-04-27 12:35:40,118 INFO  [WebDavServletController:51] WebDavServlet started: /teGOsrDbSc59/vault
2017-04-27 12:35:40,120 INFO  [WebDavServletController:94] Mounting http://localhost:42427/teGOsrDbSc59/vault using org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter
2017-04-27 12:35:40,158 ERROR [Vault:144] Unable to mount filesystem
org.cryptomator.frontend.webdav.mount.Mounter$CommandFailedException: Command failed with exit code 2. Expected 0. Stderr: Fehler beim Einhängen des Ortes: Ort kann nicht eingehängt werden

    at org.cryptomator.frontend.webdav.mount.ProcessUtil.assertExitValue(ProcessUtil.java:28) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter.mount(LinuxGvfsMounter.java:44) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.frontend.webdav.servlet.WebDavServletController.mount(WebDavServletController.java:95) ~[webdav-nio-adapter-0.5.1.jar:?]
    at org.cryptomator.ui.model.Vault.mount(Vault.java:139) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.controllers.UnlockController.unlock(UnlockController.java:342) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.controllers.UnlockController.lambda$didClickUnlockButton$0(UnlockController.java:335) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.lambda$asyncTaskOf$0(AsyncTaskService.java:37) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$null$6(AsyncTaskService.java:94) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.logExceptions(AsyncTaskService.java:123) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService.access$100(AsyncTaskService.java:24) ~[ui-1.3.0-rc3.jar:?]
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$run$7(AsyncTaskService.java:92) ~[ui-1.3.0-rc3.jar:?]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_112]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_112]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
2017-04-27 12:36:38,109 INFO  [ContextHandler:957] Stopped o.e.j.s.ServletContextHandler@4a4970f8{/teGOsrDbSc59/vault,null,UNAVAILABLE}
2017-04-27 12:36:38,110 INFO  [WebDavServletController:65] WebDavServlet stopped: /teGOsrDbSc59/vault
2017-04-27 12:36:39,849 INFO  [MainApplication:40] JavaFX application stopped.
2017-04-27 12:36:39,859 DEBUG [InterProcessCommunicator:158] Server shut down.
overheadhunter commented 7 years ago

Thanks for reporting! This command fails:

sh -c gvfs-mount "webdav://localhost:42427/teGOsrDbSc59/vault"

Could you try invoking it manually (with alternate schemes like http: or dav:) after attempting to unlock the vault?

swiesend commented 7 years ago

I have tried several things:

dav, sh + gvfs-mount fails silently, does not appear mounted in nautilus, but is accessible by manually putting the uri into the bar. The location is even after unmounting available (maybe nautilus mounts it again).

# mount
$ sh -c gvfs-mount "dav://localhost:42427/teGOsrDbSc59/vault"
$ echo $?
0
# unmount
$ sh -c gvfs-mount -u "dav://localhost:42427/teGOsrDbSc59/vault"
$ echo $?
0

dav, success (behaves as expected and appears and disappears in the file explorer)

# mount
$ gvfs-mount "dav://localhost:42427/teGOsrDbSc59/vault"
$ echo $?
0
# unmount
$ gvfs-mount -u "dav://localhost:42427/teGOsrDbSc59/vault"
$ echo $?
0

http, fails

# mount
$ gvfs-mount "http://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Einhängen des Ortes: Ort ist bereits eingehängt
$ echo $?
2
# unmount
$ gvfs-mount -u "http://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Suchen nach dem einschließenden Einhängepunkt: Es wurde kein gültiger Speicherort gefunden
$ echo $?
2

webdav, fails

# mount
$ gvfs-mount "webdav://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Einhängen des Ortes: Ort kann nicht eingehängt werden
$ echo $?
2
# unmount
$ gvfs-mount -u "webdav://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Suchen nach dem einschließenden Einhängepunkt: Der angegebene Ort wird nicht unterstützt
$ echo $?
2

davs, fails, triggers an ubuntu error report

# mount
$ gvfs-mount "davs://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Einhängen des Ortes: Message recipient disconnected from message bus without replying
$ echo $?
2
# unmount
gvfs-mount -u "davs://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Suchen nach dem einschließenden Einhängepunkt: Der angegebene Ort ist nicht eingehängt
$ echo $?
2

https, fails

$ gvfs-mount "https://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Einhängen des Ortes: Ort ist bereits eingehängt
$ echo $?
2
$ gvfs-mount -u "https://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Suchen nach dem einschließenden Einhängepunkt: Es wurde kein gültiger Speicherort gefunden
$ echo $?
2

webdavs, fails

$ gvfs-mount "webdavs://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Einhängen des Ortes: Ort kann nicht eingehängt werden
$ echo $?
2
$ gvfs-mount -u "webdavs://localhost:42427/teGOsrDbSc59/vault"
Fehler beim Suchen nach dem einschließenden Einhängepunkt: Der angegebene Ort wird nicht unterstützt
$ echo $?
2
overheadhunter commented 7 years ago

davs, https, webdavs is not yet supported, see issue #5. problem is that we can only get self-signed certs for localhost, as no trustworthy CA will issue a certificate for localhost.

As dav works, you should change your settings from webdav to dav. We haven't found any clue, what schema gvfs wants us to use in the URIs, thats why we added an option to configure it manually. If you know of any command to find out what URI schemes are recognized, we could remove this setting and determine it automatically.

Can you confirm, that dav also works inside Cryptomator? Then I would close this issue.

swiesend commented 7 years ago

Yes, dav works with Cryptomator.

overheadhunter commented 7 years ago

I'll close this in favour of #8.

JanEbbing commented 6 years ago

Hello, I'm having a similar issue on an up-to-date arch linux installation and Cryptomator 1.3.2 In principle everything works, however the automatic mounting fails and I have to mount the WebDAV file system manually with something like sudo mount -t davfs http://localhost... /some/place which is quite annoying. I checked (and ran relevant parts of) the code and it should recognize my system as eligible for the LinuxGvfsMounter. (gvfs-mount and xdg-open are provided, os.name is linux and the subprocess finishes in time). However, when I run the above command manually in a terminal, I am told

This tool has been deprecated, use 'gio mount' instead. See 'gio help mount' for more info.

Is the code using a deprecated tool to mount? Any way I can fix this, or automate the mounting at least? Here is the relevant output from the log file.

15:38:26.410 [pool-3-thread-1] INFO  o.c.f.w.s.WebDavServletController - WebDavServlet started: /YH-Jik05SZqe/Cryptomator_vault
15:38:26.510 [pool-3-thread-1] INFO  o.c.f.w.s.WebDavServletController - Mounting http://localhost:42427/YH-Jik05SZqe/Cryptomator_vault using org.cryptomator.frontend.webdav.mount.FallbackMounter
15:38:26.510 [pool-3-thread-1] WARN  o.c.f.webdav.mount.FallbackMounter - No applicable strategy has been found for your system. Please use a WebDAV client of your choice to mount: http://localhost:42427/YH-Jik05SZqe/Cryptomator_vault
15:38:26.559 [JavaFX Application Thread] ERROR o.c.u.controllers.UnlockedController - Mount failed.
org.cryptomator.frontend.webdav.mount.Mounter$CommandFailedException: No mounting strategy found.
    at org.cryptomator.frontend.webdav.mount.FallbackMounter.mount(FallbackMounter.java:15)
    at org.cryptomator.frontend.webdav.servlet.WebDavServletController.mount(WebDavServletController.java:102)
    at org.cryptomator.ui.model.Vault.mount(Vault.java:140)
    at org.cryptomator.ui.controllers.UnlockedController.lambda$mountVault$1(UnlockedController.java:164)
    at org.cryptomator.ui.util.AsyncTaskService.lambda$asyncTaskOf$0(AsyncTaskService.java:43)
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$null$6(AsyncTaskService.java:106)
    at org.cryptomator.ui.util.AsyncTaskService.logExceptions(AsyncTaskService.java:135)
    at org.cryptomator.ui.util.AsyncTaskService.access$100(AsyncTaskService.java:24)
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$run$7(AsyncTaskService.java:104)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

P.S: Thanks for building this amazing product!

overheadhunter commented 6 years ago

Is the code using a deprecated tool to mount?

It is possible that some distributions prefer gio over gvfs-mount. It is very hard to find a common standard that works for all linux distributions.

As we're currently working on FUSE instead of WebDAV, mounting WebDAV should no longer be necessary on Linux from Cryptomator 1.4.0 onwards. That said, webdav-nio-adapter can still be improved by implementing a new (preferred) mounting strategy that checks for gio.

sbrems commented 6 years ago

Hello, I'm not sure whether this is the right place to post, but the issue seems similar. So here what I did: I installed the ppa. As it didn't work I googled and found that I shoud install the oracle java9 from webupd8, which I did. Afterwards it starts fine (only the symbol in the dock is missing). However, I cannot create a vault. It fails stating "Verbinden des Laufwerks fehlgeschlagen" (failed to mount drive). The shell displays this:

11:39:48.719 [pool-3-thread-3] INFO org.cryptomator.frontend.webdav.servlet.WebDavServletController - WebDavServlet started: /7nsR4GnRQHBm/bla
11:39:58.806 [pool-3-thread-3] INFO org.cryptomator.frontend.webdav.servlet.WebDavServletController - Mounting http://localhost:42427/7nsR4GnRQHBm/bla using org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter
11:39:58.822 [JavaFX Application Thread] ERROR org.cryptomator.ui.controllers.UnlockedController - Mount failed.
org.cryptomator.frontend.webdav.mount.Mounter$CommandFailedException: Command failed with exit code 2. Expected 0. Stderr: This tool has been deprecated, use 'gio mount' instead.
See 'gio help mount' for more info.
gio: dav://localhost:42427/7nsR4GnRQHBm/bla: Datenträger unterstützt Einhängen nicht
    at org.cryptomator.frontend.webdav.mount.ProcessUtil.assertExitValue(ProcessUtil.java:28)
    at org.cryptomator.frontend.webdav.mount.LinuxGvfsMounter.mount(LinuxGvfsMounter.java:39)
    at org.cryptomator.frontend.webdav.servlet.WebDavServletController.mount(WebDavServletController.java:102)
    at org.cryptomator.ui.model.Vault.mount(Vault.java:140)
    at org.cryptomator.ui.controllers.UnlockedController.lambda$mountVault$1(UnlockedController.java:164)
    at org.cryptomator.ui.util.AsyncTaskService.lambda$asyncTaskOf$0(AsyncTaskService.java:43)
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$null$6(AsyncTaskService.java:106)
    at org.cryptomator.ui.util.AsyncTaskService.logExceptions(AsyncTaskService.java:135)
    at org.cryptomator.ui.util.AsyncTaskService.access$100(AsyncTaskService.java:24)
    at org.cryptomator.ui.util.AsyncTaskService$AsyncTaskImpl.lambda$run$7(AsyncTaskService.java:104)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.base/java.lang.Thread.run(Thread.java:844)

Due to the things discussed here, I installed gvfs2 via apt get (gvfs is not in the repos). However, if I run sh -c gvfs-mount "webdav://localhost:42427/teGOsrDbSc59/vault" I only get a notification This tool has been deprecated, use 'gio mount' instead. See 'gio help mount' for more info. Is there any way I can get the tool running? This would be awesome. So thanks in advance for your great tool!

PS: I am running Ubuntu 17.10