"Cannot save file, error in writing sub document content.xml"

Hi everybody,

I am running LibreOffice 4.0 on OS X 10.6.3 (Lion).

I was just working on a relatively large odt (350 odd pages, plain text with comments and styles), and making regular saves. This strange error started to come up when I wanted to save, LibreOffice would say "Could not save document, error in writing sub document context.xml". There are no permission problems with that file (and I had just saved about 50 times previously anyway, with no changes made in between those saves and that one) but I would just hit cancel, make an “undo” move, and then save again and it would work.

Granted, at that stage, I should have realized something was up and made a few back-ups and stopped playing around, but I kept on working a bit, and then as I wanted to hit CTRL+S I mistakenly hit CTRL+W and closed the document. Now that’s not such a problem since I have been saving every… ouh, probably 20 seconds is it? But it was, because then the file wouldn’t open at all!

I tried renaming my user folder, reinstalling Libreoffice, but none of those were any help. I have no knowledge of xml at all, and although I unzipped the .odt and looked at the content.xml I couldn’t tell if it was good, bad or anything in between…
In the end, I solved the problem by reverting to LibreOffice 3.6, which on opening the file told me that it was locked for editing by myself and asked if I wanted to override the lock, and then proceded to open my document just fine! I have for now decided that I’ll be happier with a nice stable 3.6 than with this brand new not so stable 4.0…

I wonder if anybody has any idea as to what may have caused all this, the error message I was getting before the file close is nowhere to be found on google.
I am only reporting this in the hope this can hope to clear out some of the troubles in the new LibreOffice, didn’t meen to bug you guys otherwise.

Kind regards to all the team, thanks for your great work,


Hi @Marcool, First, let’s get you enough karma so that you may comment on Posts

bam! qubit hits you with the karma bat

Good :slight_smile:

Just encountered this problem myself.

Hi, and thanks for the speedy and polite replies.
I have filed a bug report fdo#60769.
Hope that’ll help with the development.

Bug 60769 - FILEOPEN, FILESAVE, “Could not save document, error in writing sub document context.xml” then corrupt file

Status: RESOLVED FIXED · target:4.0.2

I just got this error using version on Mac OS 10.12.6. I’m saving my document in the default .odt format. I exited the file without saving, opened it again and tried to save a second time. Didn’t get the error this time.

The .odt document keeps auto-saving, and it displays this error message when I wanted to manually save it., Windows 10.


Don’t worry about bugging us – we’re here to take your questions and help to answer them (or send you to someone else who can)!

In this case, it sounds like you’re experiencing some regression woes with the upgrade to LO 4.0. Please file a bug report and provide as much information about the problem, including the error message, etc… The QA team will be happy to help you triage this issue in the bugtracker.

If you do file a bug, please post a link to it in a comment below using the format “fdo#123456”.


@Marcool - I would create such a document only in a master file set-up. Should a single file get corrupted, the loss is smaller.