Mac users, bundles, and OneDrive

In a recent spasm of optimism, I decided to start keeping, and sticking to, a budget.

(brief editorial interruption: yes, I know, I know. Just like my reaction when people say “yeah, I know, I should exercise but…” and I’m all like BUT EXERCISE IS THE GREATEST WHY WOULDN’T YOU JUST… that’s me with budgeting.)

I used to use Quicken back in the day, but in an attempt to avoid anything having to do with Intuit, I decided to find an alternate app and quickly settled on Banktivity after seeing it mentioned on Daring Fireball. I set it up to ingest my key banking and credit card accounts, let it gather some data, and started sketching out a budget. Life was good.

As I do with all my other important documents, I stored the Banktivity data in a folder in my personal OneDrive. OneDrive has been unfailingly reliable for me since before it was called Windows Live Mesh. I can’t remember any time when I ever lost data from it, and as Microsoft has added better support for version history and better sync robustness, there have been any number of times where a buggy app or stupidity on my part would have caused data loss if not for the ability to snatch a file back from the jaws of death.

Earlier this week, I upgraded my Mac mini to macOS Monterey. This seemed to go flawlessly and, as far as I could tell, all my OneDrive data was present.

This morning, I tried to open Banktivity. Instead of its normal behavior of opening the last-accessed file, I got a dialog asking me if I wanted to create a new file… never a good sign. Interestingly, the dialog didn’t offer to let me open a previous file (this appears to be a bug, btw). I used File > Open Recent, picked my Banktivity file, and saw… this.

A blank budget? That’s worse than no budget at all

On the plus side, Banktivity opened the file; on the minus side, it appeared to be empty. This was no bueno.

I verified that the file was present in my local OneDrive folder and tried opening it again, with the same result.

When that didn’t work, I reached out to Banktivity support. One of the things I appreciate about IGG, makers of the app, is that they have really good live chat-based support. Tim, my support rep, ran me through a couple of tests to see if we could figure out what might be wrong. In that process, I saw this horrifying sight:

Of course, the file shouldn’t be zero bytes.

“No worries,” I told Tim. “I’ve got a backup in OneDrive.” So I went to look in the OneDrive web client, where I saw this…

Uh oh. That’s not a great sign either… but at least now I knew what was going on.

See, when Apple introduced macOS way back when, the file system natively supported having two “forks” (what we’d now refer to as “streams”) in a file: the resource fork and the data fork. When they switched to the file system used in NeXTSTEP, that mutated into the concept of a file bundle. A file bundle looks like a file (it’s one icon on the desktop, its components are moved, copied, or deleted as a unit, etc), but it’s really a directory tree. (“Document package” is apparently the current preferred term for this mechanism but because I’m old-school, I’ll keep calling them “bundles.”)

As many macOS applications do, Banktivity uses a bundle instead of a flat file.

At some point, somehow, either macOS or OneDrive had lost the flag indicating that this directory should be a bundle. Since the OneDrive web viewer correctly shows the directory structure, my money is on the OneDrive sync mechanism having some kind of bad interaction with macOS Monterey.

The fix turned out to be pretty simple (but honestly I’m lucky it worked). In the OneDrive web client, I selected the folder and clicked “download.” Since OneDrive knew I was asking for multiple folders in a single download, it bundled them into a zip file, which I downloaded. When I extracted it, macOS recognized the bundle flag and displayed only a single document icon, which then opened properly in Banktivity.

I later confirmed with Banktivity that they don’t support using cloud file sync tools for live Banktivity documents, which is nice to know now. Thankfully I didn’t lose any data. Meanwhile, I’m following up on this issue with the OneDrive team to see if they know about it and/or have a fix for it.

(editor’s note: I wrote this post specifically to procrastinate updating my budget for the month. Time to get back to it…)

Leave a comment

Filed under General Stuff, Office 365, OS X

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.