Home / GitHub Page

Joplin fails to sync to a FUSE filesystem

I have recently installed keybase, and tried syncing to the keybase directory. Keybase uses a User-filesystem (FUSE), and it seems as though joplin does not support it well, or at all. No errors are reported when viewed through developer tools or otherwise in the app, synchronization simply appears to have no effect.


Platform Information

Joplin 1.0.245 (prod, linux)

Sync Version: 2
Profile Version: 33

Revision: 2aa7eaa1 (master)


Ubuntu 18.04 64-bit

CAVEAT: I don't use Joplin in this configuration. I am just trying to help troubleshoot this.

How do you have Joplin configured to sync to KBFS? Did you go into Tools > Options > Synchronization and choose a Synchronization target of Filesystem and have it a directory that looks something like, /keybase/private/yourusername/joplin?

Or did you just symlink ~/.config/joplin-desktop to a directory in the /keybase/... tree?

Cuz, that second method should work for one instance of keybase (on that desktop) but it would not work reliably as a sync method.

Keybase used to have kind of a laggy synchronization behavior. I don't really see that anymore on normal networks, but if you are on a high latency network (like I am) sometimes synchronization is slow and I have had kbfs get in weird states.

What would be nice is if Joplin could sync to a git target and then you'd use keybase's git. That would be cool. And certainly more robust.

I tried both actually. Also, I find keybase to be very fast, especially since I have it store a local copies of my files but propagate changes to the server.

Git could work, but it confuses me as to why this fails. Should I create an issue?

I'd let Laurent or one of the devs look at this first. I don't have multiple desktops, so I can't replicate it very easily myself.

I'm only using one device

If you're using Ubuntu, you're possibly using my Snap package if you installed it from the store. Default snapd policy is that apps can access $HOME, but other directories and in this case presumably the location of the FUSE system are off limits.

If it is the snap, you can try running the following to see if it helps.

sudo snap connect joplin-james-carroll.joplin:removable-media :removable-media
Alternatively the Ubuntu App store GUI would have permissions controlable there too. This would allow the snap to access /mnt /media /run/media and if the FUSE mount point is in there, it might fix your problem.

Unfortunately neither the GUI or the command helped. The filesystem is mounted in /run/user/1000/keybase so it seems like that is out of the scope for joplin. I've been looking into solutions with syncing two directories with little success. Now that I know that snap is blocking it though, I may try to install joplin through some other source (after a thorough backup).

Could the sync operation fail with an error though? It seems silly to fail silently.

/run/media isn't covered by removable-interfaces, you can see the exact directories here:

I'm not sure if the Joplin GUI itself has any feedback on the permissions being blocked, but they'd appear in the systems logs, so something like sudo journalctl --since=yesterday | grep audit | grep joplin would show the kernel itself enforcing the sandbox which would be blocking the sync.

As far as I'm aware, you can use a bind mount to get around this but not a symbolic link. Apparmor can tell a symbolic link is pointing at a prohibited file but it can't in the case of a bind mount. You can set up a bindmind to automount in /etc/fstab, and then you could feasibly have a folder such as $HOME/joplin-sync and have it bind mounted to the FUSE folder, set the target in the Joplin snap to $HOME/joplin-sync and the Sandboxing would allow it. This would be the best approach if you really wanted to keep using the Snap version. If you're interested this stack overflow question has some good information in the "Linux bind mount" section. https://unix.stackexchange.com/questions/198590/what-is-a-bind-mount

If you're not willing to set the bind mount up or can't otherwise change the mount point, then realistically, the best option is probably just abandon the snap and use the official AppImage method. You could compile it yourself without the sandboxing or manually edit the sandbox policies but both of these are maintenance effort you'd have to do overtime and they're not particularly worth that effort.

Bound mounts are impossible because the FUSE filesystem is mounted with the "nodev" option. https://man7.org/linux/man-pages/man2/mount.2.html.

The logs show no such errors for accessing.

I am looking at remounting the filesystem in a place that the system could access purely as an exercise. I intend to download the AppImage to circumvent this. Thanks for all your help!

As I look into remounting the filesystem, I get permission errors on attempting to open the directory.

Keybase is a bind mount to the original keybase filesystem. I cannot export to that filesystem, or access it from within Joplin, even though it is a bind mount.

The logs give:

Sep 24 17:05:52 ThinkPad-X1-Carbon-7th audit[4492]: AVC apparmor="DENIED" operation="open" profile="snap.joplin-james-carroll.joplin" name="~/Keybase/" pid=4492 comm="pool" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

However, when trying to sync to such a directory, I get no errors in the logs.

Now when I try to sync to the directory, Joplin gives appropriate errors in the bottom left corner. However before, it was silent.

I'm quite finished fiddling with this. If I have any problems with the AppImage, I will open a new issue.