[Solved] Read-Error

Discuss the word processor
Post Reply
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

[Solved] Read-Error

Post by Slavka »

Hi. I am looking for some help.

I have a saved document which is quite important and when I tried to open it today I have a read-error message with format error.
Would anyone be able to help to save the document please.

Thank you
Slavka
Attachments
Sammy Russel 1draft.odt
(34.29 KiB) Downloaded 771 times
Last edited by Slavka on Sun Apr 01, 2018 12:00 pm, edited 2 times in total.
OpenOffice 4.1.5
Windows 10 Home 64-bit
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Read-Error

Post by RoryOF »

Please try the attached. There were four or five comments all anchored at the one point - I deleted them and rebuilt the file. Please check formatting and content is as you require.
Attachments
Sammy Russel 1draft_repaired.odt
(34.2 KiB) Downloaded 914 times
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: Read-Error

Post by Slavka »

Thank you very much. Very helpful.
OpenOffice 4.1.5
Windows 10 Home 64-bit
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: [Solved] Read-Error

Post by Slavka »

Hi. I have downloaded the corrected file which opens fine but as soon as I save it in to the PC I cannot open it again showing the read error again. I have re-installed openoffice but that didnt help either. Any suggestions would be welcome.
OpenOffice 4.1.5
Windows 10 Home 64-bit
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: [Solved] Read-Error

Post by Slavka »

Can you please repost that message with attachment dissapeared. Thank you
OpenOffice 4.1.5
Windows 10 Home 64-bit
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

 Edit: Jump to
this last but one post in the thread
for the correct explanation - it is a bug in AOO 
I deleted the post after I checked the file and found it to be corrupted.

It happens to me too - the file looks fine when I fix it ... but as soon as I save it, it corrupts again.

This is just the text from your file - I will see if I can get back the actual file.

What is the history of the file? Has it ever been edited with MS Word? or with LibreOffice?
Attachments
text only.odt
(30.43 KiB) Downloaded 615 times
Last edited by John_Ha on Sat Sep 26, 2020 3:59 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: [Solved] Read-Error

Post by Slavka »

Ok thank you. Is there any explanation why is this happening with openoffice?
OpenOffice 4.1.5
Windows 10 Home 64-bit
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

Try this one.

I made the fix which Rory made and the file opened without problems. I switched off Record changes. I switched off Show changes so the document appears with all changes accepted. I selected everything and copied it, and pasted it into a new file and saved it. I opened the file, added some text and saved it.

All seems fine but all the changes have been applied. IF you work with this file, but download Rory's fix again and open it, you can see in Rory's file what the changes were.
Attachments
Sammy Russel 1draft jh.odt
(30.66 KiB) Downloaded 608 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

Slavka wrote:Ok thank you. Is there any explanation why is this happening with openoffice?
No. Can you please tell us the history of the file and, in particular:

1. Has this file always been saved as a .odt file? or has it ever been saved as a .doc? or .docx?

2. What program was used to apply the changes? Was it AOO? or LibreOffice? or Microsoft Word?
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: [Solved] Read-Error

Post by Slavka »

From my part it was always written up and saved in otd . I dont know for the comments from my supervisor I would believe she uses microsoft word but dont know for sure. Once she made tracked changes I have again corrected it in openoffice and save and had problems since
OpenOffice 4.1.5
Windows 10 Home 64-bit
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

Slavka wrote:From my part it was always written up and saved in otd . I don't know for the comments from my supervisor I would believe she uses microsoft word but dont know for sure. Once she made tracked changes I have again corrected it in openoffice and save and had problems since
What has almost certainly happened is that MS Word has corrupted the file ...

If you have access to someone who has MS Word then do the following test.

Send them a .odt file with some text in it and ask them to do some edits with Record Changes switched on. It would be sensible to do four or five changes each time.

Edit 1: add and delete some text. Save it as Edit 1.odt

Edit 2: now add some comments attached to a position. Save it as Edit 2.odt

Edit 3: now add some comments attached to a range of characters. Save it as Edit 3.odt

I believe you will find that the file Edit 3.odt is corrupted.

Now repeat the tests but saving as a .docx at each stage, and then saving as a .odt after saving as a .docx.

Edit 4: add and delete some text. Save it as Edit 4.docx. Open the .docx file and save it as Edit 4.odt.

Edit 5: now add some comments attached to a position. Save it as Edit 5.docx. Open the .docx file and save it as Edit 5.odt.

Edit 6: now add some comments attached to a range of characters. Save it as Edit 6.docx. Open the .docx file and save it as Edit 6.odt.

Were any of Edit 4.docx, Edit 4.odt, Edit 5.docx, Edit 5.odt, Edit 6.docx or Edit 6.odt corrupted?

See [Tutorial] Differences between Writer and MS Word files for an explanation.
Last edited by John_Ha on Sun Apr 01, 2018 2:00 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Slavka
Posts: 7
Joined: Sat Mar 31, 2018 6:57 pm

Re: [Solved] Read-Error

Post by Slavka »

Thank you guys very much. It s very helpful and much appreciated. I will try what you suggested once there is someone with MS. Once again thank you for saving my work.
OpenOffice 4.1.5
Windows 10 Home 64-bit
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

I am doing some debugging of this problem as we get quite a few reports of it.

It seems to occur when someone has Recording Changes activated, and they insert a comment which is attached to a span of several characters. I think, but have not yet proved, it only happens when they are editing the .odt file with MS Word.

A workaround is to ask any editor not to attach any comments to a range of characters and just add a comment at a location.

The repeated attribute is something like <office:annotation office:name="__Annotation__102_1424329316"> where there are multiple occurrences of "Annotation__102_1424329316" sometimes with different numbers.

The correct syntax in a properly written AOO file is as below. In the file, the sentence "This comment is attached to a block of characters" has the characters "block of characters" highlighted and Fred Bl attached a comment where the comment reads "block of chars".

Note that the first line is the opening tag and the closing tag in line 8 must match the opening tag. Similarly, though we never see the problem, the opening and closing tags for the change-id must also match.

Code: Select all

<text:p text:style-name="Standard">This comment is attached to a <office:annotation office:name="__Annotation__102_1424329316">
    <dc:creator>Fred Bl</dc:creator>
    <dc:date>2018-04-01T16:30:50.87</dc:date>
    <text:p text:style-name="P2">
      <text:span text:style-name="T2">block of chars</text:span>
    </text:p>
</office:annotation>block of characters<text:change-start text:change-id="ct182012904"/>
<office:annotation-end office:name="__Annotation__102_1424329316"/>
<text:change-end text:change-id="ct182012904"/>.</text:p>
extract from content.xml for comment attached to a block of characters
extract from content.xml for comment attached to a block of characters
test of recorded changes.odt
(12.56 KiB) Downloaded 583 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

I have found out what the precise problem in the file was.

The corruption appears at the beginning of the XML where the P1 style is defined. All that is required to fix the file is to delete everything underline in blue - it should not be there.
Attachments
Clipboard01.png
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Solved] Read-Error

Post by RoryOF »

I did not examine the file in that detail, John, but that is what I remember deleting. At the time I formed the impression that the group of corrupted annotation links was at the start of the text, but your analysis shows where it actually is. How that group might end up in the midst of a style definition is a puzzle.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

Another point. Both this thread, and Format error discovered, show the "multiple adding digit 1 to the name" problem which has been seen before when .odt files are edited with both MS Word and AOO.

Code: Select all

Annotation__153_24419901911111111
Annotation__248_244199019111111
Annotation__158_2441990191111
Annotation__401_244199019111
Annotation__414_24419901911
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

I have been doing some analysis and I can now cause AOO Writer to add the office:name corruption to a .odt file although it may only be doing so after the .odt file has been processed with MS Word. That being said, MS Word may not even be involved although I strongly suspect it is.

I extracted content.xml from the poster's Sammy Russel 1draft.odt file. Note that the P1 Style definition has been corrupted and redundant and incorrect office:name="__Annotation__153_24419901911111111" office:name="__Annotation__158_2441990191111" office:name="__Annotation__248_244199019111111" office:name="__Annotation__401_244199019111" office:name="__Annotation__414_24419901911" has been inserted into the P1 Style definition.

I deleted these redundant items and re-inserted content.XML to get the attached file Sammy Russel 1draft - CORRECTED.odt. At this stage I thought that the .odt file must be OK.

I opened Sammy Russel 1draft - CORRECTED.odt and the file opens without problem. I then made a trivial edit (add a space in front of Case Summary) and saved the file.

When I opened the saved file I got the Read Error message and, much to my surprise, Writer had corrupted the P1 Style definition by inserting one or more office:name definitions into the P1 Style definition.

I think the problem occurs:
- when Record Changes is being used;
- when changes are made using MS Word;
- where the MS Word changes include one or more comments attached to a range of characters;
- where the file is then edited by AOO;
- where the file is then saved by AOO.

I think it is when AOO saves the file at the final step that the corruption is inserted. Now, it could be that AOO has problems with something MS Word has written to the file, and it is this which causes AOO to write the corruption. Or it could be that MS Word does nothing untoward and that AOO just corrupts the file.

Notes:

1. It appears that the file was created by poster, author SN, using AOO Writer. The file was sent to reviewer SD who used MS Word and recorded changes on 20 Mar 2018. Some changes were "Comments attached to a range of characters" and it is these Comments which use the office:name definitions.

2. Author SN then recorded more changes to the file using AOO on 22 Mar. In fact, Record Changes is still ON in the poster's file.

3. At some stage, the poster's file became corrupted. I think this probably happened when author SN edited and saved the file after it had been edited with MS Word.

4. Analysis of the time stamps of the edits shows that each change is timed at nn:nn:00.0n seconds. It seems strange to me that the time is always set to 00.0n seconds. The times are shown below where 20 = date 20th.

The first five office:name ... appear in the file, and also corrupt the P1 Style definition. The sixth, seventh and eight appear in the file but do NOT corrupt the P1 Style definition. The sixth was the first, recorded at 09:51:00.02.

The other twenty times are recorded changes which were not Comments added to a range of characters. Note that the same 12:18:00.06 time is recorded for two different changes.

Note the multiple adding of digits "111...".

Note how the decimal component of the seconds increments throughout - I would expect it to be more random.

The times below are in the order in which they appear, from start to end, in content.xml.

Code: Select all

office:name="__Annotation__153_24419901911111111" line  200  20  9:56:00.04  SD
office:name="__Annotation__158_2441990191111"     line  220  20  9:57:00.04  SD
office:name="__Annotation__248_244199019111111"   line  351  20 10:39:00.04  SD  
office:name="__Annotation__401_244199019111"      line  859  20 12:18:00.06  SD 
office:name="__Annotation__414_24419901911"       line  958  20 12:20:00.06  SD

office:name="__Annotation__3_244199019"           line 1260  20  9:51:00.02  SD
office:name="__Annotation__396_244199019"         line 1522  20 12:18:00.06  SD 
office:name="__Annotation__551_244199019"         line 1636  20 12:50:00.08  SD 

09:54:00:04
11:50:00.04 
10:43:00.05 
10:41:00.05
12:21:00.05 
11:40:00.05 
11:52:00.05
11:56:00.06
12:43:00.06 
12:18:00.06  line 816 
12:27:00.06 
12:29:00.07 
12:28:00.07  
12:39:00.07 
12:40:00.07 
12:42:00.08
12:42:00.08 
12:44:00.08 
12:46:00.08
12:50:00.08
I have updated the bug report with these findings. Unfortunately I do not have MS Word to do any more diagnosis.

I have attached content.odt which is content.xml - it is too big to be brought in as text in the post.
Attachments
Sammy Russel 1draft - CORRECTED.odt
(35.53 KiB) Downloaded 580 times
content.odt
contains the XML from content.xml
(29.93 KiB) Downloaded 592 times
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Solved] Read-Error

Post by John_Ha »

This is now thought to be a bug in AOO, but not in LO, when track changes is ON and a user deletes two comments each of which is attached to a range of characters.

See Issue 128356 - Track Changes and Annotations on text range can cause corruption. Applies to 4.x (all versions?)

The bug appears to be fixed in LO. See See Bug 89615 - ODF export: Writer saves invalid XML when there are multiple annotation ranges (style tag has two office:name attributes) where LO 4.4 fixed it.
a regression from the AOO imported range annotation feature,
commit 0761f81643a6890457e9ef7d913ab5c88c2593a4

this was fixed in LO 4.4.4 by

commit 804ec2289115a65c74ddff478b7469801debf7e4
Author: Caolán McNamara <caolanm@redhat.com>
AuthorDate: Wed Apr 22 14:10:38 2015 +0100

fix assert on export of ooo63141-1.doc to odt

if bAutoStyles is true then the mbDoSomething of the SvXMLElementExport is
false, and the ctor/dtor doesn't do anything so any attributes added to the
exporter are not cleared by the SvXMLElementExport dtor

so only add the attribute if bAutoStyles if false and might as well extend the
block to cover the use of SvXMLElementExport and use the other ctor which
defaults mbDoSomething on
Last edited by John_Ha on Sat Sep 26, 2020 3:53 pm, edited 1 time in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Lfaber
Posts: 1
Joined: Mon May 11, 2020 8:56 pm

Re: [Solved] Read-Error

Post by Lfaber »

Hello, i have the same problem with a file, would it be possible to send it to someone or post it to try to get it fixed? Thanks in advance!! Regards lot
Open office 4.1.7 on windows X
Post Reply