Bug 104181 - FILEOPEN: File format error found at unsatisfied query for interface of type com.sun.star.embed.XRelationshipAccess!
Summary: FILEOPEN: File format error found at unsatisfied query for interface of type ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.1.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:5.4.0 target:5.3.1
Keywords: filter:docx
: 105392 (view as bug list)
Depends on:
Blocks: Track-Changes DOCX-SAXParse
  Show dependency treegraph
 
Reported: 2016-11-26 09:12 UTC by Ooker
Modified: 2022-01-27 12:41 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
The corrupted file (130.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-11-26 09:13 UTC, Ooker
Details
The bugdoc imported without proper fix (405.34 KB, application/pdf)
2017-01-17 20:08 UTC, Mike Kaganski
Details
Original bugdoc resaved with 5.4.0.0.alpha0+ (130.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-14 15:55 UTC, Mike Kaganski
Details
Another bugdoc (85.53 KB, application/zip)
2017-02-15 19:51 UTC, Ooker
Details
Another bugdoc - fixed (85.51 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-16 03:19 UTC, Mike Kaganski
Details
Fixed original document (125.04 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-21 17:07 UTC, Bartosz
Details
Openable bugdoc (110.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-21 19:45 UTC, Ooker
Details
Bugdoc with new error (98.35 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-02-21 19:46 UTC, Ooker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ooker 2016-11-26 09:12:43 UTC
Description:
The file was normally saved, but today I open it up and this error appears:

File format error found at unsatisfied query for interface of type com.sun.star.embed.XRelationshipAccess!
SAXParseException: '[word/footnotes.xml line 2]: unknown error', Stream 'word/footnotes.xml', Line 2, Column 116258
SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 29943(row,col).

I can open it with WordPad and save it in a different file, but this lose all my tracking changes and comments.

Version: 5.2.1.1
Build ID: 2d75cf29e6d05e44c404f0547047f1da6563d380
CPU Threads: 2; OS Version: Windows 6.2; UI Render: default; 
Locale: en-US (en_US); Calc: group

Steps to Reproduce:
Open it

Actual Results:  
File format error found at unsatisfied query for interface of type com.sun.star.embed.XRelationshipAccess!
SAXParseException: '[word/footnotes.xml line 2]: unknown error', Stream 'word/footnotes.xml', Line 2, Column 116258
SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 29943(row,col).

Expected Results:
The file should be opened properly


Reproducible: Always

User Profile Reset: Yes, but it doesn't fix the problem

Additional Info:
I usually doesn't close LibreOffice windows when shutting down the computer. Of course I have saved all the documents beforehand.


User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:50.0) Gecko/20100101 Firefox/50.0
Comment 1 Ooker 2016-11-26 09:13:53 UTC
Created attachment 129019 [details]
The corrupted file
Comment 2 Telesto 2016-11-28 21:39:43 UTC
Confirming with: 
Version: 5.4.0.0.alpha0+ (x64)
Build ID: 7aa2b5a041df8e71a435cccbc79ee13799ec9138
CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; Layout Engine: new; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2016-11-24_11:40:27
Locale: nl-NL (nl_NL); Calc: CL

but not with:
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 Mike Kaganski 2017-01-17 20:08:19 UTC
Created attachment 130504 [details]
The bugdoc imported without proper fix

The problem seems to be related to a footnote in a table. When using not-yet-merged fix for bug 104718, and avoiding errors caused by pOldBoss being nullptr in SwFlowFrame::MoveFwd(), (that latter problem is clearly consequence of the initial parse problem) I get document where the whole text after the footnote anchor (~53 pages in initial document) is moved into the footnote text.

The attachment demonstrates the result of this import. Interestingly, MS Word 2016 cannot export this file to PDF with an error "The export failed due to an unexpected error".
Comment 4 Xisco Faulí 2017-01-17 21:12:01 UTC
*** Bug 105392 has been marked as a duplicate of this bug. ***
Comment 5 Mike Kaganski 2017-01-18 06:24:23 UTC
A patch is submitted for review: https://gerrit.libreoffice.org/33244
Comment 6 Commit Notification 2017-01-18 09:18:26 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=13827ffa54268dc648e1b72ea574daea02598335

tdf#104181: don't throw on XRelationshipAccess query

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2017-01-18 13:05:38 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=1281bd5d87361fa516cdf247b055aeb4bb5e13fb

tdf#104181 related: don't throw on this document

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2017-01-20 20:26:22 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8098cdaca08abaf12a32bbebcd058a98c2af03bd&h=libreoffice-5-3

tdf#104181 related: don't throw on this document

It will be available in 5.3.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Ooker 2017-02-14 15:38:10 UTC
there is no way to rescue the origin bugdoc, that is the docx format, not the pdf one?
Comment 10 Mike Kaganski 2017-02-14 15:55:44 UTC
Created attachment 131209 [details]
Original bugdoc resaved with 5.4.0.0.alpha0+

Fix for bug 104718 allows to open such files (after accepting a warning); it will be available in 5.4.
Comment 11 Ooker 2017-02-15 19:51:23 UTC
Created attachment 131260 [details]
Another bugdoc

Help, this happens again. I have updated LO to 5.2.5.1

File format error found at unsatisfied query for interface of type com.sun.star.embed.XRelationshipAccess!
SAXParseException: '[word/footnotes.xml line 2]: unknown error', Stream 'word/footnotes.xml', Line 2, Column 59321
SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 29963(row,col).
Comment 12 Mike Kaganski 2017-02-16 03:19:14 UTC
Created attachment 131266 [details]
Another bugdoc - fixed

It is very important to find out the underlying problem in LO that causes *generation* of such corrupt files. Opening them is ~solved in master, but only if we stop producing them, can we tell this problem is fixed.

@Ooker: looks like you have ~reliable reproducer how the corruption happens. Is the new document the attachment 131209 [details] that you started to edit? Can you try to figure which of your edits trigger this problem? We need a *good* document and description of the steps required to make it *bad*, so we can fix that.

Also, you didn't tell if you produced attachment 131260 [details] with previous version (and updated later to try to open it), or if you updated first, and 5.2.5.1 produced corrupt file again.
Comment 13 Ooker 2017-02-16 09:38:41 UTC
The former bugdoc was created and corrupted in version 5.2.1.1, the latter was created and edited partly in 5.2.1.1, and is continued being edited a couple days ago, after updated to 5.2.5.1.

"Can you try to figure which of your edits trigger this problem?" 
All I do is open it, edit it with track change and comments, then save it. I view it in web view mode, and scale it to the left half of the screen. And yes, I have a lot of footnotes. Lately I have installed the Anaphraseus addon (http://anaphraseus.sourceforge.net/), but I suspect it's the cause.

Should I test the new patch?
Comment 14 Mike Kaganski 2017-02-16 09:51:13 UTC
The problem seems to have something about footnotes.

There was no new patch wrt this bug. However, I'd recommend you to give 5.3 a try, to see if this problem maybe fixed there.

I understand that this is a burden, but if you could save backups before starting work, and then test after saving, and in case you've get failure, then try to create a reproducer... that would be awesome. (Of course, if 5.3 doesn't solve that.)
Comment 15 Ooker 2017-02-19 09:25:29 UTC
The doc is bugged again without any modification! Since receiving your fixed doc, I haven't edited it. However, my disc is bad and I'm force to downgrade Windows from 8 to 7. I also install the 5.3 version. Word 2010 can read it without error.

File format error found at unsatisfied query for interface of type com.sun.star.embed.XRelationshipAccess!
SAXParseException: '[word/footnotes.xml line 2]: unknown error', Stream 'word/footnotes.xml', Line 2, Column 59321
SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 29963(row,col).
Comment 16 Bartosz 2017-02-21 16:57:17 UTC
The following code in footnotes.xml is causing this failure

  <w:footnote w:id="58">
        <w:p>
            <w:pPr>
                <w:pStyle w:val="Footnote1"/>
                <w:rPr></w:rPr>
            </w:pPr>
            <w:r>
                <w:rPr>
                    <w:rFonts w:eastAsia="Times New Roman" w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:footnoteRef/>
                <w:tab/>
            </w:r>
            <w:del w:id="2183" w:author="Ooker Human" w:date="2016-11-25T22:48:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:eastAsia="Times New Roman" w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText xml:space="preserve"></w:delText>
                </w:r>
            </w:del>
            <w:r>
                <w:rPr>
                    <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:t>Dù khẩu súng hơi sử dụng khí hy</w:t>
            </w:r>
            <w:del w:id="2184" w:author="Ooker Human" w:date="2016-11-25T22:32:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText>đrô</w:delText>
                </w:r>
            </w:del>
            <w:ins w:id="2185" w:author="Ooker Human" w:date="2016-11-25T22:32:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t>dro</w:t>
                </w:r>
            </w:ins>
            <w:r>
                <w:rPr>
                    <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:t xml:space="preserve"> thay vì không khí, và </w:t>
            </w:r>
            <w:del w:id="2186" w:author="Ooker Human" w:date="2016-11-25T22:58:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText xml:space="preserve">khi </w:delText>
                </w:r>
            </w:del>
            <w:ins w:id="2187" w:author="Ooker Human" w:date="2016-11-25T22:58:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t xml:space="preserve">dù </w:t>
                </w:r>
            </w:ins>
            <w:del w:id="2188" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText xml:space="preserve">bạn nói </w:delText>
                </w:r>
            </w:del>
            <w:ins w:id="2189" w:author="Ooker Human" w:date="2016-11-25T22:58:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t xml:space="preserve">bạn nghĩ là </w:t>
                </w:r>
            </w:ins>
            <w:commentRangeStart w:id="11"/>
            <w:r>
                <w:rPr>
                    <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:t xml:space="preserve">bắn </w:t>
            </w:r>
            <w:ins w:id="2190" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t xml:space="preserve">nó cùng lắm sẽ làm </w:t>
                </w:r>
            </w:ins>
            <w:r>
                <w:rPr>
                    <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:t>nổ đom đóm mắt</w:t>
            </w:r>
            <w:ins w:id="2191" w:author="Ooker Human" w:date="2016-11-25T22:58:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t xml:space="preserve"></w:t>
                </w:r>
            </w:ins>
            <w:ins w:id="2192" w:author="Ooker Human" w:date="2016-11-25T22:58:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t>thôi</w:t>
                </w:r>
            </w:ins>
            <w:r>
                <w:rPr>
                    <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                </w:rPr>
                <w:t xml:space="preserve">, thì </w:t>
            </w:r>
            <w:del w:id="2193" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText xml:space="preserve">đúng </w:delText>
                </w:r>
            </w:del>
            <w:del w:id="2194" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                        <w:i/>
                    </w:rPr>
                    <w:delText>thực sự</w:delText>
                </w:r>
            </w:del>
            <w:del w:id="2195" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:delText xml:space="preserve"> là thế.</w:delText>
                </w:r>
            </w:del>
            <w:ins w:id="2196" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                        <w:i/>
                        <w:iCs/>
                    </w:rPr>
                    <w:t xml:space="preserve">quả thật </w:t>
                </w:r>
            </w:ins>
            <w:ins w:id="2197" w:author="Ooker Human" w:date="2016-11-25T22:55:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t xml:space="preserve">là bắn nó sẽ làm bạn nổ đom đóm </w:t>
                </w:r>
            </w:ins>
            <w:ins w:id="2198" w:author="Ooker Human" w:date="2016-11-25T22:56:00Z">
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                    <w:t>mắt.</w:t>
                </w:r>
            </w:ins>
            <w:ins w:id="2199" w:author="Ooker Human" w:date="2016-11-25T22:56:00Z">
                <w:commentRangeEnd w:id="11"/>
                <w:r>
                    <w:commentReference w:id="11"/>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                </w:r>
            </w:ins>
        </w:p>
    </w:footnote>
Comment 17 Bartosz 2017-02-21 17:07:26 UTC
Created attachment 131388 [details]
Fixed original document

After removing following comment entry from "footnotes.xml":

            <w:ins w:id="2199" w:author="Ooker Human" w:date="2016-11-25T22:56:00Z">
                <w:commentRangeEnd w:id="11"/>
                <w:r>
                    <w:commentReference w:id="11"/>
                </w:r>
                <w:r>
                    <w:rPr>
                        <w:rFonts w:cs="Times New Roman" w:ascii="Times New Roman" w:hAnsi="Times New Roman"/>
                    </w:rPr>
                </w:r>
            </w:ins>

the document was fixed
Comment 18 Bartosz 2017-02-21 17:09:51 UTC
It looks like that <w:commentReference w:id="11"/> is causing such problems with import of docx document
Comment 19 Ooker 2017-02-21 19:45:03 UTC
Created attachment 131394 [details]
Openable bugdoc

New bug appears!

Below every line of footnote there is a strange, deletable sequence of number: 10^12 10^15 10^18 10^21. Word doesn't show them.

Also, the new bugdoc has different error too. This time, even Word cannot display it. Google Docs can only display the first page.

File format error found at 
SAXParseException: "No namespace defined for a"
SAXParseException: '[word/footnotes.xml line 2]: Namespace prefix a on noFill is not defined
', Stream 'word/footnotes.xml', Line 2, Column 28446
SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 29582(row,col).
Comment 20 Ooker 2017-02-21 19:46:03 UTC
Created attachment 131395 [details]
Bugdoc with new error
Comment 21 Ooker 2017-02-22 11:52:43 UTC
On another file, the strange line below every footnote is a formula block. It seems that it takes random box on the file to put into there. When I double click on it, this appears:

General OLE error.

Btw, now I save all the file on Google Drive. That way, I will always have earlier openable file when things fall down.
Comment 22 Ooker 2017-02-28 18:42:19 UTC
Hi, can you help me fix the bugdoc? Many thanks.
Comment 23 Xisco Faulí 2017-07-13 10:35:35 UTC
Setting Assignee back to default. Please assign it back to yourself if you're
still working on this issue
Comment 24 QA Administrators 2018-07-14 02:47:16 UTC Comment hidden (obsolete)
Comment 25 Xisco Faulí 2019-06-27 09:51:59 UTC
Still reproducible in

Version: 6.4.0.0.alpha0+
Build ID: ea19b0c0230fcc730245ecd445c03164cb6a1d18
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

with attachment 131395 [details]
Comment 26 Xisco Faulí 2019-06-27 09:52:45 UTC
@Miklos, i thought you might be interested in this issue...
Comment 27 Stéphane Guillou (stragu) 2021-06-22 13:41:23 UTC
Opening Attachment 131395 [details] with the current daily master on Ubuntu 18.04, I get:


####
An error occurred during opening the file. This may be caused by incorrect file contents.
The error details are:
SAXException: [word/footnotes.xml line 2]: Namespace prefix a on noFill is not defined
/tinderbox/buildslave/source/libo-master/sax/source/fastparser/fastparser.cxx:619
Proceeding with import may cause data loss or corruption, and application may become unstable or crash.

Do you want to ignore the error and attempt to continue loading the file?
####


I can say "Yes" to that, and Writer opens the file without a problem, I can edit it, save it again in the same format, and the error is not there once I reopen.
I can see tracked changes throughout the whole document.

No error with Attachment 131394 [details]

I can't see any of the issues mentioned with footnotes.
Comment 28 Timur 2022-01-27 12:41:07 UTC
I guess that MSO DOCX attachment 131394 [details] is saved in LO 5.3 and so created attachment 131395 [details], that MSO cannot open. 
Now, if saved in LO 7.4+, it opens in LO and MSO. Already OK with 7.2 and probably before.

No point in opening old and wrong attachment 131395 [details], comment 27 is wrong.

Since there were commits before, I'll mark as Fixed. I didn't read all though.

And: "New bug appears!" was wrong as well as deleting original attachments.