Skip to main content

MacOS: This document could not be autosaved.

Every now and then TextEdit.app complains that it cannot autosave a document:

The document "foo.txt" could not be autosaved.
Your changes will not be saved until the problem is resolved.
You can also duplicate the document or discard your changes to close it.
I don't make use of Auto Save and Versions and I'm not using Time Machine either, so this whole autosaving business is kinda annoying. The usual way to remediate this particular error message (no, it's not a permission issue) is to quit TextEdit.app (and possibly discarding the latest modifications) and try again. Sometimes it takes a few iterations of this :-\

Syslog has a few more details:
[0x0-0x74074].com.apple.TextEdit[19479]: [ERROR] GSLibrary.c:_AddGenerationInternal:393 \
Failed to consume sandbox extension; error 12 (Cannot allocate memory)

TextEdit[19479]: NSFileVersion tried to tried to add a new generation and failed. \
 Versioned file URL: file://localhost/Users/bob/Documents/foo.txt, \
 contents URL: file://localhost/Users/bob/Documents/foo.txt, error: \
 Error Domain=GSLibraryErrorDomain Code=1 "The operation couldn’t be completed. \
 (GSLibraryErrorDomain error 1.)" UserInfo=0x7fe3e8652c10 {}

TextEdit[19479]: NSDocument failed to preserve the old version of a document.\
 Here's the error: Error Domain=GSLibraryErrorDomain Code=1 \
 "The operation couldn’t be completed. (GSLibraryErrorDomain error 1.)" \
 UserInfo=0x7fe3e8652c10 {}
Very annoying. Here's how to disable "Auto Save and Versions". Apparently, revisiond(8) ("storage manager for document revisions") is responsible for this task:
$ launchctl list | grep revisiond
73      -       com.apple.revisiond

$ locate revisiond | grep plist
/System/Library/LaunchDaemons/com.apple.revisiond.plist

$ launchctl unload -w /System/Library/LaunchDaemons/com.apple.revisiond.plist

$ rm -rf /.DocumentRevisions-V100 && touch /.DocumentRevisions-V100 
The next time TextEdit.app wanted to save a document, the following was displayed:
The document "foo.txt" is on a volume that does not support permanent version storage. 
You will not be able to access older versions of this document once you close it.

[x] Do not show this message again
Perfect! Be sure to tick that "Do not show this message again" box :-)