Mavericks: "Zero Length Data" Binder Corruption

Seven developer previews in, Mavericks seemed stable enough to use daily and I installed it on my main machine (I know, I know :wink: ).

The only compatibility issue I’ve discovered so far is with Scrivener… I can get projects to open initially, and they will save. But after an indeterminable amount of time they get corrupted, which I can discern by the document icon going from a binder-preview list icon to the generic SCRIV icon with logo.

It also seems as if my past Time Machine backups are being corrupted, as not all of them work once restored (again noted by the icon difference).

The exact messages: “zero length data” followed by “The document “name” could not be opened. Scrivener attempted to restore the binder structure for this project but failed. Try restoring from a backup, or create a new project……”.

I know this is developer software. But this is extremely disconcerting. I have a collection of novel projects I’m petrified to touch. :neutral_face:

EDIT: I forgot to ask anything! Does anyone have any idea where to begin with this? Does Scrivener just need an update? Could it be a 10.9 thing? Zero-length seems like filesystem stuff but I’m not knowledgeable enough about all that.

I’ve been using Scrivener on Mavericks for a while now and have run in to no issues. The current version of Scrivener is fully compatible with Mavericks (although the next update will be optimised for it). I don’t use Time Machine, though. The problem you are encountering sounds like the underlying .scriv file package is getting corrupted. Scrivener itself can’t do this, so the problem must be coming from Time Machine - it may just be that Time Machine isn’t fully operational in Mavericks yet (it’s not a good idea to use a beta OS without serious backups). Take a look at Console.app and see if there are any errors reported there.

Also, please Ctrl-click on a corrupts project in the Finder, select “Show Package Contents”, take a screenshot of the contents shown in the Finder, and post the screenshot here - that might give me a hint as to the sort of corruption that has occurred.

I’ve gotten the same error for all Scapple documents also =/ , and gotten this error for both apps on two machines (2009 iMac 27, 2012 MBP Retina) running DP7.

Both machines backup with Time Machine, but another common denominator was my use of the new Bittorrent Sync, which works like DropBox but without the cloud aspect. I read that it paused when apps were open, so I didn’t hesitate to open Scrivener/Scapple files from the synched directory. I also just uninstalled XtraFinder that I used for cut/paste, but I don’t think it’s involved.

However, a Scapple document stored and opened previously in a DropBox folder just came up with a zero-length window. “The XML data could not be read from disk.” Both apps had been used before DP7 with no problems. However I can’t duplicate the error totally on demand; there’s a short delay where I can keep re-opening the project then … no more.

The package folder hierarchy is the same between working and corrupted projects ( Name.scrivx, Files, (Name.scrivx), Quicklook, Settings). Note that some of my projects’ names have a space in the beginning (to move them to the top of a folder), but only the first Name.scrivx has the space. Also, not all projects have two .scrivx within them, but this doesn’t seem pertinent to my errors…

What I’m observing is that documents are diminishing in size within the .scriv file after opening. I have one working document that I have not touched at all — duplicated it, opened it successfully, closed it, then it won’t open.

Specifically, the first (not second) .scrivx diminishes drastically: 75Kb to 8Kb for example. The corrupted one even gets a new creation date of right now, not when I made the file.

In the Quicklook folder, the Preview.html and Thumnail.jpg get smaller to reflect the icon change.

In Settings, the ui.plist went from 77KB to 3KB, again with a new creation date.

One project has gone from 1.1 MB to 508 KB.

I don’t see any general errors in Console or a Scrivener-specific log.

So it’s isolated to the XML files, which seem to be wiped out? The only other Mavericks/DP7 problem is with my Money.app database going empty. Didn’t happen with DP6.

On the plus side!!! I have gotten a corrupted project to re-open by copying the untouched-project’s 1st Name.scrivx and Settings folders. The zero-length error still pops up, but it opens. If I don’t copy the Settings folder then it opens with all folders in the binder closed.

Here’s an image of the project folder and the main .scrivx files.

https://www.dropbox.com/s/9xtljp4uzbchxjk/Projects%20Comparison.png

On the plus-plus side, thank the world for the backups folder. It looks like my projects are safe. But there are no backups of .scaps, are there? Here’s praying for Time Machine.

EDIT: Scapple files restored and locked from changes. (I don’t know how else to keep this corruption from happening. :neutral_face: )

I last edited a Scapple file successfully on September 3rd. On the 4th I updated the MacBook from DP6 to DP7 and installed Mavericks over my ML install up to DP7 on the iMac.

Quick update.

I had made a few new documents in each app and saved them to the desktop on each system. One Scapple document got corrupted on the iMac, but otherwise things seem fine. I haven’t yet tested all the .scrivs that had got originally corrupted, though.

Could it have been a bizarre permissions problem? I noticed while trying to save a PDF from Preview to a folder synced with Bittorrent Sync that a file was created but it had no actual size. I re-applied my account’s permissions to the account directory from Get Info and the PDF saved like normal. I’ve done this on both computers and have yet to get the error again.

This is my bet so far. The days of perfect cloud/internet syncing are not quite here yet…