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

Error when mounting with LinuxGioMounter: Message is already in session queue #45

Open
overheadhunter opened this issue Mar 3, 2023 · 1 comment

Comments

@overheadhunter
Copy link
Member

LinuxGioMounter fails to mount in some cases:

java.io.IOException: Command failed with exit code 2. Expected 0.
	at [email protected]/org.cryptomator.frontend.webdav.mount.ProcessUtil.assertExitValue(ProcessUtil.java:25)
	at [email protected]/org.cryptomator.frontend.webdav.mount.LinuxGioMounter$MountBuilderImpl.mount(LinuxGioMounter.java:97)
	... 13 more
Caused by: java.io.IOException: Stderr output: gio: dav://localhost:42427/lsLoxEBKL0GZ: Message is already in session queue
	at [email protected]/org.cryptomator.frontend.webdav.mount.ProcessUtil.assertExitValue(ProcessUtil.java:23)

@infeo found this possibly related upstream bug in gvfs: https://gitlab.gnome.org/GNOME/gvfs/-/issues/630. Looks like a trailing slash in the URL may make the difference. However I am not sure, this really changed:

With webdav-nio-adapter version 1.2.8 (Cryptomator 1.6.17) this was the implementation:

URI schemeCorrectedUri = new URI(mountParams.getOrDefault(MountParam.PREFERRED_GVFS_SCHEME, DEFAULT_GIO_SCHEME), uri.getSchemeSpecificPart(), null);
ProcessBuilder mountCmd = new ProcessBuilder("sh", "-c", "gio mount \"" + schemeCorrectedUri.toASCIIString() + "\"");

With webdav-nio-adapter version 2.0.0 (Cryptomator 1.7.0) it doesn't look any different:

URI schemeCorrectedUri = new URI(WEBDAV_URI_SCHEME, uri.getSchemeSpecificPart(), null);
// mount:
ProcessBuilder mountCmd = new ProcessBuilder("sh", "-c", "gio mount \"" + schemeCorrectedUri.toASCIIString() + "\"");

@overheadhunter
Copy link
Member Author

In 1.2.8, we constructed the URI with an injected @ContextPath String contextPath, from which we explicitly removed the trailing slash:

public WebDavServletModule(Path rootPath, String contextPath) {
String trimmedCtxPath = CharMatcher.is('/').trimTrailingFrom(contextPath);
this.rootPath = rootPath;
this.contextPath = trimmedCtxPath.startsWith("/") ? trimmedCtxPath : "/" + trimmedCtxPath;
}

In 2.0.0 there is no Dagger any longer. But the normalizedContextPath() that we pass to the servlet is still not having any trailing slash:

private String normalizedContextPath() {
return "/" + PATH_SEP_PATTERN.splitAsStream(getContextPath()).filter(Predicate.not(String::isBlank)).map(this::normalizedContextPathSegment).collect(Collectors.joining("/"));
}
private String normalizedContextPathSegment(String segment) {
return RESERVED_CHARS.matcher(segment).replaceAll("_");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant