Bug 44318 - LibreOffice corrupting .ods files on save: multiple table:end-cell-address/table:end-x/table:end-y/draw:z-index attributes on table:table-cell
Summary: LibreOffice corrupting .ods files on save: multiple table:end-cell-address/ta...
Status: CLOSED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.4.4 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: odf odf_validation
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-30 06:12 UTC by Simon Collis
Modified: 2015-03-03 11:18 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
not able to open this file please help (175.67 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-10-24 15:42 UTC, Vaibhav
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Collis 2011-12-30 06:12:44 UTC
I keep some password protected spreadsheets with client details in for my work. I had to change some details, saved one, and on opening got "Read-Error. Format error discovered in the file in sub-document content.xml at 2,31914(row,col)"

I rolled back to an older version, changed it again, and got the same error.

This is really worrying me, I rely on LibreOffice for this and now I can't use it.

For obvious reasons, I cannot include the spreadsheet that has gone wrong. However it was 144K in size, and included three graphs.

Basically it consisted of dates, request count, delta, averages, etc. 

Using vim, I went to location 31914 on row 2. Here's the tag:

<table:table-cell table:end-cell-address="Data.N36" table:end-x="0.416cm" table:end-y="0.354cm" draw:z-index="0" table:end-cell-address="Data.N39" table:end-x="1.12cm" table:end-y="0.175cm" draw:z-index="0" table:end-cell-address="Data.N39" table:end-x="1.12cm" table:end-y="0.175cm" draw:z-index="0" table:style-name="ce5" office:value-type="string">

The exact point indicated by the error is the first table:end-cell-address="Data.N39".

Hope that helps, although I appreciate it's not very much to go on...
Comment 1 David Greaves 2012-01-26 14:49:36 UTC
I have encountered the same problem. My files are not password protected.

I'm running 1:3.4.4-0ubuntu1

The corrupt XML is at the bottom of this entry

Further investigation seems to show that every <table:table-cell />  or <table:covered-table-cell /> tag  with a table:end-cell-address attribute was affected and 'merged'

<draw:frame /> tags with the table:end-cell-address attribute were OK.



<table:covered-table-cell table:end-cell-address="&apos;Monthly Payments&apos;.B1" table:end-x="2.195cm" table:end-y="0.025cm" draw:z-index="0" table:end-cell-address="&apos;Monthly Payments&apos;.B2" table:end-x="2.195cm" table:end-y="0.319cm" draw:z-index="11" table:number-columns-repeated="3" table:style-name="ce99"/><table:covered-table-cell table:style-name="ce99"/><table:covered-table-cell table:end-cell-address="&apos;Monthly Payments&apos;.F1" table:end-x="0.081cm" table:end-y="0.391cm" draw:z-index="13" table:end-cell-address="&apos;Monthly Payments&apos;.F5" table:end-x="0.079cm" table:end-y="0.201cm" draw:z-index="14" table:number-columns-repeated="2" table:style-name="ce99"/><table:table-cell/><table:table-cell/><table:table-cell table:end-cell-address="&apos;Monthly Payments&apos;.J1" table:end-x="0.627cm" table:end-y="0.025cm" draw:z-index="1" table:number-columns-repeated="2"/><table:table-cell table:style-name="ce307" office:value-type="string"><text:p>Monthly</text:p></table:table-cell><table:table-cell table:end-cell-address="&apos;Monthly Payments&apos;.M2" table:end-x="0.625cm" table:end-y="0.318cm" draw:z-index="3" table:end-cell-address="&apos;Monthly Payments&apos;.M1" table:end-x="0.627cm" table:end-y="0.391cm" draw:z-index="6" table:end-cell-address="&apos;Monthly Payments&apos;.M5" table:end-x="0.625cm" table:end-y="0.201cm" draw:z-index="9" table:style-name="ce307" office:value-type="string"><text:p>Qtrly</text:p></table:table-cell><table:table-cell table:style-name="ce307" office:value-type="string"><text:p>xxxxxx</text:p></table:table-cell><table:table-cell table:style-name="ce310" office:value-type="string"><text:p>New xxxxxxx</text:p></table:table-cell><table:table-cell table:end-cell-address="&apos;Monthly Payments&apos;.P2" table:end-x="1.912cm" table:end-y="0.318cm" draw:z-index="4" table:end-cell-address="&apos;Monthly Payments&apos;.P1" table:end-x="1.914cm" table:end-y="0.391cm" draw:z-index="7" table:end-cell-address="&apos;Monthly Payments&apos;.P5" table:end-x="1.912cm" table:end-y="0.201cm" draw:z-index="10" table:style-name="ce307" office:value-type="string"><text:p>Until xxxxxxxxx</text:p></table:table-cell>
Comment 2 Shari 2012-03-16 10:17:32 UTC
I can also confirm this error. Win7 
OOO340m1 (build:302)

Password protected. 

"sub-document $(ARG1) at $(ARG2)(row,col)."

I can open the file in version 3.5.1.2
Comment 3 Bernard Gray 2012-03-25 18:27:17 UTC
I have a similar issue - we're testing libreoffice to replace openoffice onsite, To replicate:
1. Save a password protected file in libreoffice (3.5.0 or higher), 
2. then try and open it with OpenOffice (3.3.0) - error appears:
   "Read-error. Format error discovered in the file in sub-document Content.xml at 1,0(row,col) 
3. The file still opens fine in libreoffice v 3.5.0 or higher, I haven't tried libreoffice < 3.5.0

The workaround to save the file for the majority OOo users was to:
1. open in libreoffice >= 3.5.0
2. save it without password protection, and close it.
3. open it in Openoffice.org (3.3.0 or whatever)
4. save it with a password
Comment 4 Olivier Hallot 2012-03-25 18:34:05 UTC
(In reply to comment #3)
> I have a similar issue - we're testing libreoffice to replace openoffice
> onsite, To replicate:
> 1. Save a password protected file in libreoffice (3.5.0 or higher), 
> 2. then try and open it with OpenOffice (3.3.0) - error appears:
>    "Read-error. Format error discovered in the file in sub-document Content.xml
> at 1,0(row,col) 
> 3. The file still opens fine in libreoffice v 3.5.0 or higher, I haven't tried
> libreoffice < 3.5.0
> 
> The workaround to save the file for the majority OOo users was to:
> 1. open in libreoffice >= 3.5.0
> 2. save it without password protection, and close it.
> 3. open it in Openoffice.org (3.3.0 or whatever)
> 4. save it with a password

In http://tinyurl.com/7fmzlzn

Different Encryption Algorithm

In LibreOffice 3.5, a different, more often used encryption (AES) will be introduced to replace the previously used one (Blowfish).In consequence, files encrypted with LibreOffice 3.5 can not be opened by LibreOffice 3.4.4 and earlier. LibreOffice 3.4.5 enables you to open those files. However, on saving again in LibreOffice 3.4.5, the old encryption will be used. Files with the old encryption of course can be used in LibreOffice 3.5.0
Related issues: fdo#43868 and fdo#40006.
Comment 5 Bernard Gray 2012-03-25 19:08:35 UTC
I had a chat with some guys in the LibreOffice irc channel - and got an answer on the problem:

The crux of the issue is that from 3.4.6 onwards (ODF format 1.2), they are using an AES256 encryption algorithm for password protection, and previously (ODF format 1.1 and earlier) the blowfish algorithm was used.

You can workaround the issue by setting the default save settings to ODF 1.1, under Tools -> Options -> Load/Save -> General -> ODF Format Version -> "1.0/1.1"

Obviously the risk with this workaround is that the older ODF version may not support features in your document, but this could be used as a temporary workaround while transitioning clients to current LOo/OOo versions.

I guess this makes it invalid as a bug, but certainly a difficult situation that could potentially be handled differently/better - here's some suggestions:

1. ODF 1.2 to support blowfish AND AES256. If a document has already saved as Blowfish, continue to save it as blowfish, with a warning.
2. Add a more granular setting in the Load/Save options - instead of forcing the entire suite to use odf 1.1 or 1.2, allow a choice of encryption method instead. ie ODF 1.2, blowfish cipher
3. Update the error message so that it is informational, for dealing with future unsupported encryption methods.
Comment 6 Joel Madero 2012-06-17 13:48:39 UTC
I'm not going to mark this as WILLNOTFIX until a dev confirms this. I'm marking it as NEW and upgrading it to a CRITICAL-> Medium bug. I think this is a big problem and there are potential solutions to prevent a loss of data
Comment 7 Markus Mohrhard 2012-06-17 15:20:45 UTC
This is not a bug. As Olivier already mentioned we changed the encryption algorithm in Libreoffice 3.5 and new encrypted files can't be opened with versions older than LO 3.4.5 or AOO 3.4.
Comment 8 Simon Collis 2012-06-17 16:22:57 UTC
Sorry guys but the encryption thing is a red herring. It happens on unencrypted sheets too - as far as I can tell, anything larger than about 100K when saved and it happens every time. The tell-tale sign for me was a 145K spreadsheet shrinking to 136K, and it was 100% of the time, completely reliable.
Comment 9 Simon Collis 2012-06-17 16:25:06 UTC
Actually, come to think of it, my spreadsheets weren't password protected by LibreOffice, they were on a password protected file share I was accessing over VPN - I guess I should have made that clear.
Comment 10 Simon Collis 2012-08-11 16:49:35 UTC
"This is not a bug."
Yes, it is.

"As Olivier already mentioned we changed the encryption
algorithm in Libreoffice 3.5 and new encrypted files can't be opened with
versions older than LO 3.4.5 or AOO 3.4."
The bug was reported in UNENCRYPTED spreadsheets. Encryption has nothing to do with it.
Comment 11 Simon Collis 2012-08-11 16:51:50 UTC
Look, if you're not going to bother just delete this bug report. I'm sick of waiting nearly a year for you guys to fix this bug. I've gone back to Open Office and I'll stay there. At least that doesn't corrupt my spreadsheets and lose me data.
Comment 12 Michael Stahl (allotropia) 2012-09-13 12:23:00 UTC
ignoring the AES encryption red herring in the comments,
has anybody seen or fixed this well-formedness violation
of duplicate attributes on table cells in Calc?
Comment 13 Gabriel Gomiz 2013-05-14 15:19:20 UTC
We are experimenting this bug regularly in our Calc users with files that have 40+ sheets and several objects. Usually it is after copy/paste of entire sheets and trying to save.

XML content is corrupt with several duplicated attributes.
Comment 14 Michael Stahl (allotropia) 2013-05-14 15:25:51 UTC
can somebody please provide step-by-step instructions how
to reproduce the multiple attribute corruption?

this bug sounds really bad and was reported 18 months ago,
and without steps to reproduce it no developer can fix it.
Comment 15 Simon Collis 2013-05-14 16:35:40 UTC
I will try and come up with a scenario to replicate it.


On 14 May 2013 16:25, <bugzilla-daemon@freedesktop.org> wrote:

>   *Comment # 14 <https://bugs.freedesktop.org/show_bug.cgi?id=44318#c14>on bug
> 44318 <https://bugs.freedesktop.org/show_bug.cgi?id=44318> from Michael
> Stahl <mstahl@redhat.com> *
>
> can somebody please provide step-by-step instructions how
> to reproduce the multiple attribute corruption?
>
> this bug sounds really bad and was reported 18 months ago,
> and without steps to reproduce it no developer can fix it.
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 16 TimothyMB 2013-05-19 20:20:34 UTC
When I saved my LibreOffice Calc file: xxx.ods, on 2013m05d17t16:28, the next day I tried to open it. It gave me the message in a box: 

"Read-error
An unknown error has occurred"

I checked out one on this site and one had explained about putting an e-mail address in the first A1 of the new Calc file, and it automatically will be generated with the direct formatting to open up Kmail to send e-mail.

When I would remove that formatting, and then save the file, when trying to open the Calc file again, it would not open and would give the same message. So I tried it and it did just that.

So HOW DO I get into my 737.1 KiB, XXX.ods file, to get to all my addresses?

Hope to hear from you all soon,

Timothy M. Brennan
Comment 17 Michael Stahl (allotropia) 2013-08-15 19:24:42 UTC
this one was erroneously moved to NEW (if this were a common problem we'd have numerous duplicates anyway)
Comment 18 Vaibhav 2014-10-24 15:42:54 UTC
Created attachment 108357 [details]
not able to open this file please help
Comment 19 Michael Stahl (allotropia) 2014-12-03 13:27:55 UTC
the bugdoc from comment #18 is from LO 4.2 and is the similar but unrelated bug 85496

since this bug has only gotten comments about unrelated issues during the last year and a half, and it was originally reported against LO 3.4, i am assuming that this bug has been fixed meanwhile and resolve WFM.
Comment 20 Michael Stahl (allotropia) 2014-12-03 13:29:44 UTC
Comment on attachment 108357 [details]
not able to open this file please help

attachment is unrelated to this bug