Some Bits: Nelson's log

6 posts about joplin-obsidian

Obsidian Sync

I’m really liking Obsidian as my note taking app. I just paid $10/mo for Obsidian Sync, their syncing solution, and had some thoughts. This was originally an email to their support team.

Obsidian Sync mostly worked great. The docs are good. It feels like a solid product.

I previously was syncing with Syncthing. It worked mostly fine but was a little awkward. The thing that got me to buy the service was not having a great way to run Syncthing + Obsidian on a Chromebook.

I really balked at the $10/month or $98/year price. I’m sure they’ve heard a lot of complaints about the price and have their reasons. But if it were half the price or less I would never have set up SyncThing in the first place. FWIW I think 1Password is a good comparable at $3/mo for a single person.

Migrating to Obsidian Sync was a bit tricky; a lot of juggling of vaults, passwords, state. The extra steps to sync Obsidian settings and plugins were particularly confusing. This is the primary customer acquisition pathway, some streamlining here would help. None of the steps were technically wrong! Just awkward and given how easy it is to screw everything up with sync, a little nail-biting.

That reminds me they totally undersell one of the best features of Obsidian: the vaults are just simple text files and some JSON data! It’s so easy to make a backup of a vault or move a copy. So many systems (like 1Password) are opaque; Obsidian is refreshingly transparent. Ironic, given the product name ;-)

Migrating Joplin to Obsidian, metadata

I’m migrating from Joplin to Obsidian for my little personal notebook. Some notes on doing that with metadata for each note.

Migrating note text is easy. Joplin has an export-to-Markdown option that creates simple .md files that can just be dropped into the Obsidian vault directory. Done. However, that doesn’t preserve any metadata the note may have.

You can get Joplin to export the metadata as well by choosing “Markdown with Front Matter” as the format. That will add tags for each note, here’s an example:

---
title: My Note
updated: 2023-03-21 17:32:36Z
created: 2021-11-08 16:12:48Z
latitude: 37.30000000
longitude: -121.80000000
altitude: 0.0000
---

It’s the dates I care about most; Obsidian’s default UI shows these when you hover over a note as “Last Modified” and “Created”.

Last Modified is pretty easy; Obsidian seems to be using the file mtime timestamp. I wrote a little Python program that parses that date and sets the mtime on each file accordingly.

Created is harder or impossible. Unix and Posix have no way to store the creation time of a file. (There’s ctime, but that’s actually the creation time of the inode and can be demolished in various ways. Also there’s no clean way to set that on a file.) I’m not sure what Obsidian is showing; NTFS on Windows does store creation time so maybe that’s what it’s using? There’s reports of people saying it gets broken when you use Obsidian Sync, so it’s apparently not reliable. I just gave up on it. I’m honestly not sure why Obsidian even shows this in the UI if it’s not correct.

The other metadata folks often care about are tags. I never set tags in Joplin so I didn’t look at it. But I think it’s as simple as reading the tags from the Joplin export and then sticking them in the note as #hashtag style tags in the body of the note. Or alternately...

Obsidian does have a way to put arbitrary metadata in a note; frontmatter, just like the Joplin export. You can use that for tags as well. For now I’m not using those. Note as near as I can tell there are no standard metadata keys for note creation time, that’d be a solution to that problem. I think some parts of the plugin ecosystem have a standard set of metadata keys they use, maybe including creation.

Thoughts on Obsidian

Obsidian’s nice! Every single time the Joplin UI bugged me I realized I should try this obviously better thing.

Obsidian also has a very active user community. I’m leery of getting deep into a complex note taking tool; I’d prefer mostly just simple text files. But it’s kinda neat to see what complex things folks are doing with it, also all the plugins.

For syncing.. this is still an experiment, but my plan for now with Obsidian syncing is to use SyncThing. Now that I understand how SyncThing deals with conflicts I’m not worried it’s going to fail in some inscrutable manner. If that doesn’t work well I’ll buy Obsidian Sync. I confess I’m balking at the price; $100/year seems like an awful lot. Maybe I should think of it as paying for Obsidian itself plus the extra network feature.

I’ve installed it on Android too and synced following these notes. Seems to work so far.

I need a good HTML export option, I like to write blog posts in Markdown and then post them to my blog, which needs HTML fragments. There’s several plugins that do it, need to pick one. I’ve tried 3-4; the two “copy as HTML” result in nothing useful in my clipboard. One of the “save to file” ones does sorta work but sure generates a lot of extra CSS, etc to make the HTML look fancy. I just want a simple HTML fragment conversion.

Update

After a couple of weeks I really like Obsidian. I’ve switched entirely over to it. Mostly I just liked the UI; say what you will about Electron bloat but the web UI + command palette paradigm makes for some nice apps. (See also: VS.Code). I still feel a bit strange about how powerful and complex Obsidian can be. Folks on Reddit are sharing their 10,000 document knowledge bases full of interlinking. But it works fine also for just a few simple text notes.

SyncThing on the folder is working fine for me to sync between two desktops, a laptop, and two Android devices. I’d rather be using Obsidian Sync but can’t quite get myself to pay the price for it.

For HTML export I’m using Obsidian Enhancing Export, the consensus choice. It uses pandoc. Honestly it’s overkill but the HTML it produces is nice. In particular it does “smart quotes” in the output, something most of the other HTML exports don’t do.

Syncthing and conflicts (also Joplin)

I’ve been using Syncthing for several years now to sync several gigabytes of files, mostly various kinds of user-generated documents. Like my entire personal source code repository. Also my Joplin notes. Across 3-5 systems: Windows, Linux, and an Android device. It works great. I’ve never had to think about it much. But something went wrong with Joplin recently and I learned something...

Syncthing has no conflict resolution tool.

Seriously. Syncthing detects conflicts and does something sensible with conflicted files but does not offer any sort of merge tool or UI to help you know about conflicts and deal with them. I got confused because SyncTrazor, the Windows UI for SyncThing I use, does have a simple GUI Conflict Resolver. But there’s nothing like that in the main SyncThing web-based GUI.

All the core SyncThing does if it detects a conflict is try to guess which version of the file should be canonical. It has some heuristics based on modification dates and will prefer a modified file to a deleted one. It then renames the discarded version as <filename>.sync-conflict-<date>-<time>-<modifiedBy>.<ext>. That gets kept forever as a regular file also in your syncthing store and gets synced just like any other file. It’s up to you to notice these conflicts and do something about them; syncthing will not tell you about them. (Hilariously, you can have conflicts on conflicts and end up with files named ...sync-conflict-…sync-conflict -…-sync-conflict...)

I’m not complaining about Syncthing; what it does is very simple and understandable. Conflict resolution is hard and subtle, better not to do anything than do a bad job. Automated merge strategies are possible but fraught with dangers, and manually requiring users to merge is not in keeping with SyncThing’s background nature. OTOH I’m a little spooked that these potential errors have crept in without any visibility. It’d be nice if the Web GUI at least showed a count of conflicts, but maybe that’d just cause anxiety?

I’ve got about 50,000 files in my Windows Documents folder (synced between two PCs) and just today learned I have 27 conflicts. Mostly saved game files; it’s possible Steam Sync was also involved which no doubt causes all sorts of confusion. FWIW none of these conflicts have caused any problems, so maybe I don’t really need to care about them. I just deleted them; nothing was going to be reading those conflict files anyway. The 3 conflicts in my source tree worry me a bit more, they’re all in git repo metadata. But those git repos are working fine and git fsck isn’t complaining, so going to just delete those too.

How do conflicts happen? When two separate syncthing instances update the same file before they sync them to each other. This happens surprisingly seldom for me, I think because I have an always-on hub that everything syncs to and Syncthing seems to be watching the file system for changes and uploading them quickly. Conflicts seem more likely to happen on my Android phone where running in the background is a challenge and it may not sync at all when I’m not on WiFi.

Which brings me to Joplin. I’m looking at all this because I’d had a lot of problems with Joplin/Android and file sync. I recently encrypted my Joplin notes and something weird happened on the phone when it synced to it. Not sure what was really wrong but I just deleted all the conflicts my phone generated and I seem to still have all my notes. Joplin itself only syncs to local files every few minutes, then Syncthing itself only syncs those files to the hub every few minutes. Seems a little delicate.

ChromeOS, Flatpak, and Obsidian

Bad experience with ChromeOS trying to install Obsidian following these instructions. I did eventually get it working but only with a bunch of ugly hacks as root.

Note the install instructions have you making bwrap setuid root. Ugh! I did not do that, because other things online say it isn’t necessary. I did try enabling setuid a few times and it didn’t fix anything.

First problem: flatpak just won’t work other than root. Even flatpak list gives me a “Permission denied” error (unhelpfully not telling me what permission is denied.) This happens even with bwrap setuid. I don’t know if that’s a general flatpak thing or is a problem specific to ChromeOS. Docs I’ve read online suggest that at least parts of flatpak shouldn’t require root but that installing software probably will. Whatever, I’ll just do everything as root. (At least part of the problem is /home/nelson/.local/share/flatpak ended up being owned by root and permissions 0700; this happened on Ubuntu too, so a Flatpak bug? But even fixing that, still couldn’t flatpak list on the Chromebox.)

Installing with Flatpak went smoothly. There’s now an Obsidian app icon in the ChromeOS GUI. But when I launch it either nothing happens, or the logo for Obsidian shows up but with an infinite spinning circle on top of it. No feedback on what’s wrong. The online advice for access to ChromeOS system logs is all out of date. I finally found my way to a log viewer at chrome://device-log/ but there’s nothing there about the app not working. The log dump generated from chrome://network/ does seem to have useful info but I could not understand what was failing.

OK, so let’s launch from a command line instead. An hour later, here’s a short transcript of all the breakage I encountered.

~ ⬢ [Systemd] ❯ flatpak run md.obsidian.Obsidian
error: Permission denied

~ ⬢ [Systemd] ❯ sudo !!
sudo flatpak run md.obsidian.Obsidian
error: "flatpak run" is not intended to be ran with sudo

~ ⬢ [Systemd] ❯ sudo bash
root ~ ⬢ [Systemd] ❯ flatpak run md.obsidian.Obsidian
Debug: Will run Obsidian with the following arguments: 
Debug: Additionally, user gave: 
[13 zypak-helper] Failed to connect to session bus: [org.freedesktop.DBus.Error.NoReply] Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[13 zypak-helper] src/helper/main.cc:40(DetermineZygoteStrategy): Assertion failed: bus
/app/bin/obsidian.sh: line 40:    13 Aborted                 (core dumped) zypak-wrapper /app/obsidian $@ ${EXTRA_ARGS[@nelsonminar

root ~ ⬢ [Systemd] ❯ dbus-run-session flatpak run md.obsidian.Obsidian
... 
[0319/141600.942543:FATAL:electron_main_delegate.cc(299)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

root ~ ⬢ [Systemd] ❯ dbus-run-session flatpak run md.obsidian.Obsidian --no-sandbox
it worked!

So.. it has to run as root. Then it turns out it doesn’t want to run as root, at least via sudo. And then it needs access to the system’s DBus, which for some reason the Flatpak hasn’t set up. Then Electrno complains about root needing --no-sandbox so if I provide that option it works! Lololo.

Just a total mess of complex systems stuff that’s standing between me and my application. DBus, the Crostini container, the Flatpak container, the Chrome/Electron sandbox. Layers and layers of stuff and some of it is broken.

So a failed experiment, even if in the end I did get the thing running. To be fair to ChromeOS: this is really not what that product is designed for. A Linux program, Flatpak, a separate Chrome/Electron instance. Yeah, don’t do that. I suspect if I need to do this for real I’ll just end up using the Android app running on the Chromebook and put up with the less-than-optimal mobile UI.

Joplin works again on Android

I’ve been using Joplin for a few years now as my note taking app. It’s mostly good but has some rough edges. But there was one ugly thing; Android file system sync was broken for most of a year, without acknowledgement. I used this to sync my machines (via SyncThing for the files). This got fixed a few months ago with Joplin 2.9 but then that release was never pushed to the Google Play Store, making it much less accessible to users.

Happy to report that my phone currently has Joplin 2.10 from Google Play and filesystem sync is now working. The UI is still a little awkward but it seems to be functioning. (With some delay; Joplin is not super swift in re-syncing.)

The whole experience has left me with a sour feeling about Joplin. Maybe that’s not fair; it’s a free open source project. And it’s remarkably complex, supporting a bunch of platforms and sync methods. The underlying technical issue (Android file system permissions) was genuinely complicated. OTOH the developer didn’t handle the bug very well and between that and the Google Play release problem I get the impression he doesn’t much care about the Android platform. Also the UI really is clumsy in a lot of ways.

Another bug / UI problem: I just enabled encryption on my Windows desktop. It re-encrypted the notes and synced them. Then I went to my phone and tried to synchronize and got some generic error (“TypeError”) that suggested data was bad. So I manually turned encryption on in the phone app (it should have turned itself on) and now my phone is very slowly encrypting and re-uploading all its notes again. This is bad! In general the encryption implementation seems wonky.

Alternatives

So maybe I need an alternate notetaking product again. It seems like a simple product but then it needs to be really well designed and reliable, so that it becomes a piece of your memory and not some hated complex app. The main things I need are syncing between Windows and Android (and/or ChromeOS) and good Markdown support. And a good UI for displaying and editing markup.

There’s a lot of note apps out there; here’s a recent roundup of 7. Simplenote was the first I used and loved. I stopped using it because notes aren’t encrypted. Although ironically I never turned encryption on with Joplin because of my sync problems. I switched to Standard Notes for awhile but the price went to $50/year and it had so many UI problems I didn’t want to pay that. So I switched to Joplin.

I’d try Google Keep but the UI is like a clown circus. Evernote is way, way, way too complicated. So I’m sticking with Joplin or now. Maybe I should just pay for Joplin Cloud, that would have solved my Android sync problem.

1Password has a pretty functional little notes app in it, btw, but it doesn’t have the Markdown UI stuff I want, not its intended purpose.

Anyway, Joplin seems to be working for now. If I see something better I’ll try it. If Joplin breaks again I’m going to consider going back to Simplenote. I love how Automattic supports this little product.

Update: thanks to a comment from reader Gina I tried Obsidian, a closed-source Electron app. I like it! The UI is very nice, I particularly like the default Markdown editing mode where the markup syntax is hidden except for the line you’re editing. Also despite all the fancy features it has the basic data model is “text files in a folder” which is refreshingly transparent. The app has a well-used plugin architecture with a lot of third party plugins. It supports advanced things like a canvas, a graph view, and links between notes, but the basic stuff is pretty solid. I hope they aren’t going down the Evernote road of increasing complexity.

I was able to import from Joplin by exporting markdown from it, although I couldn’t get the updated/created metadata to come over (this might be fixable; joplin does export the dates). Obsidian doesn’t encrypt data files on local disk but supports end-to-end encryption in their $96/year cloud sync product. It also looks plausible to sync yourself via SyncThing, but you won’t have the fancy extra layer of conflict resolution that Joplin sync provides. All in all it looks like a very promising product.

Joplin notes

I switched note-taking apps to Joplin. It’s total overkill for what I do, all I really want is a markdown editor that doesn’t require me to remember to press “save”. Joplin has a zillion more features than that. Also it’s a 200MB Electron download, so that’s a bit much. But it seems to work well and simply.

Originally I was using SimpleNote. It’s really nice! The only reason I switched away is because it doesn’t support encrypting notes on their cloud storage and I was doing things like pasting passwords into my notebook.

Then I used Standard Notes for a few years. And paid for it. But they hiked the price to $50/year and that seems like a lot of money for something so simple that I use occasionally. It also reminded me just how bad and klunky so much of Standard Notes is. Its reliable on Markdown plugins for the editor, none of which quite work right. Mediocre cross-note search and no in-note search at all (except with one plugin). It often feels slow. Just overall not excited to be paying so much for it. (Base Standard Notes is free but you need to pay to use even the most simple advanced features like a decent Markdown plugin.)

Joplin is free software and free to use, including a variety of self-hosted syncing options. (Which are encrypted). They do offer a cloud sync service at 24€/year but they also have a robust set of free sync options you can set up yourself. You’re mostly paying for convenience. And they don’t lock other basic features behind the price.

I’m using SyncThing for sync. Joplin will sync via files in a directory; it is then the user’s problem how to sync those files. SyncThings works great for that. The sync is a little delayed (5 minutes?) and getting it set up on Android was awkward because of the opaqueness of the file system. But it all worked.

There’s a zillion note-taking apps out there. Unfortunately most of them seem to be too complex and offering too many features, just like Joplin does. Everyone’s like “Evernote is bad and too complex” and then is going down the road to becoming Evernote. To Standard Notes credit they are not doing that; neither is SimpleNote. Anyway some of the other options I didn’t try are QOwnNotes, Cryptee, and SilentNotes. Joplin seems to be the nerdy consensus for the best so I didn’t even try the rest.

Migration wasn’t too bad btw, thanks to Standard Notes for having an export feature. (Which reminds me; data portability matters, don’t ever use an app that traps your data.) There’s a way to convert Standard Notes exports into Evernote format, which Joplin can then ingest. Lost a bunch of metadata, most importantly which notes had been archived. So I had to go in and re-sort my notes. It was time well spent actually, but if I had thousands of notes that would have been a problem.