FODT Write Error. The file could not be written.

classic Classic list List threaded Threaded
10 messages Options
Francesco Ongaro Francesco Ongaro
Reply | Threaded
Open this post in threaded view
|

FODT Write Error. The file could not be written.

Dear LibreOffice Community,

I programmatically generate a FODT that opens without any problem and
can be edited.

When saving such FODT document I get "Write Error. The file could not be
written.".

BTW the document is valid XML, is there a method to debug such issue?

I tried -DXSLTransformer.statsfile=/tmp/xslt_debug.txt as a Java startup
parameter but the file is not created and I'm not sure that Java's XSLT
is called when saving a document.

Thanks a lot,
ascii

https://ask.libreoffice.org/en/question/190226/fodt-write-error-the-file-could-not-be-written/

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Francesco Ongaro Francesco Ongaro
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

Dear LibreOffice Community,

sorry to bother, do you think there is a better place to ask such
question?

I'm available to rebuild Libreoffice with symbols and debug it with
a little guidance (c++ sources are huge!).

Thanks,
Francesco

On 12/04/19 21:05, Francesco Ongaro wrote:

> Dear LibreOffice Community,
>
> I programmatically generate a FODT that opens without any problem and
> can be edited.
>
> When saving such FODT document I get "Write Error. The file could not be
> written.".
>
> BTW the document is valid XML, is there a method to debug such issue?
>
> I tried -DXSLTransformer.statsfile=/tmp/xslt_debug.txt as a Java startup
> parameter but the file is not created and I'm not sure that Java's XSLT
> is called when saving a document.
>
> Thanks a lot,
> ascii
>
> https://ask.libreoffice.org/en/question/190226/fodt-write-error-the-file-could-not-be-written/
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Regina Henschel Regina Henschel
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

Hi Francesco,

Can it be saved to any of the other formats, eg odt or docx?

Can you provide such generated fodt-file?

Do you have compared, that a version without content is the same if
saved from LibreOffice as if generated by your application?

Which OS? Correct rights?

Kind regards
Regina

Francesco Ongaro schrieb am 26-Apr-19 um 12:02:

> Dear LibreOffice Community,
>
> sorry to bother, do you think there is a better place to ask such
> question?
>
> I'm available to rebuild Libreoffice with symbols and debug it with
> a little guidance (c++ sources are huge!).
>
> Thanks,
> Francesco
>
> On 12/04/19 21:05, Francesco Ongaro wrote:
>> Dear LibreOffice Community,
>>
>> I programmatically generate a FODT that opens without any problem and
>> can be edited.
>>
>> When saving such FODT document I get "Write Error. The file could not be
>> written.".
>>
>> BTW the document is valid XML, is there a method to debug such issue?
>>
>> I tried -DXSLTransformer.statsfile=/tmp/xslt_debug.txt as a Java startup
>> parameter but the file is not created and I'm not sure that Java's XSLT
>> is called when saving a document.
>>
>> Thanks a lot,
>> ascii
>>
>> https://ask.libreoffice.org/en/question/190226/fodt-write-error-the-file-could-not-be-written/
>>
>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Wade Smart Wade Smart
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

In reply to this post by Francesco Ongaro
With the info provided - sounds like a permission problem.
Which folder are you writing too?
Right click and see what the permissions are.
--
Registered Linux User: #480675
Registered Linux Machine: #408606
Linux since June 2005

On Fri, Apr 12, 2019 at 2:07 PM Francesco Ongaro <[hidden email]> wrote:

>
> Dear LibreOffice Community,
>
> I programmatically generate a FODT that opens without any problem and
> can be edited.
>
> When saving such FODT document I get "Write Error. The file could not be
> written.".
>
> BTW the document is valid XML, is there a method to debug such issue?
>
> I tried -DXSLTransformer.statsfile=/tmp/xslt_debug.txt as a Java startup
> parameter but the file is not created and I'm not sure that Java's XSLT
> is called when saving a document.
>
> Thanks a lot,
> ascii
>
> https://ask.libreoffice.org/en/question/190226/fodt-write-error-the-file-could-not-be-written/
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
> List archive: https://listarchives.libreoffice.org/global/users/
> Privacy Policy: https://www.documentfoundation.org/privacy

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Mike Scott-2 Mike Scott-2
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

In reply to this post by Francesco Ongaro
On 26/04/2019 11:02, Francesco Ongaro wrote:
> Dear LibreOffice Community,
>
> sorry to bother, do you think there is a better place to ask such
> question?
>
> I'm available to rebuild Libreoffice with symbols and debug it with
> a little guidance (c++ sources are huge!).

You really do /not/ want to go there :-} :-}

>
> Thanks,
> Francesco
>
> On 12/04/19 21:05, Francesco Ongaro wrote:
>> Dear LibreOffice Community,
>>
>> I programmatically generate a FODT that opens without any problem and
>> can be edited.
>>
>> When saving such FODT document I get "Write Error. The file could not be
>> written.".


You might get more help if you included information such as your OS and
the LO version.

There are a couple of very obvious things to check meanwhile - are the
file and directory permissions set to allow you to do the save?

As it's flat xml, try opening it in your choice of ordinary text editor
and seeing if you can do the equivalent save operation from there (you
don't say why you think it's an LO issue).



--
Mike Scott (unet2 <at> [deletethis] scottsonline.org.uk)
Harlow Essex England
"The only way is Brexit" -- anon.

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
Francesco Ongaro Francesco Ongaro
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

In reply to this post by Regina Henschel
Hi Regina, Wade and Mike,

thanks for your time.

The problem is common to multiple workstations (various Ubuntu LTS), on
my system the version is 6.0.7.3 (Build ID: 1:6.0.7-0ubuntu0.18.04.5).

As a side note the document was working till an unspecified update, so
I think it has to do with the XML itself and it's not a permission
error ("strace -ff -e open,openat,fstat,read" does not show anything
related to that).

It does succeed to save in DOCX format but fails in ODT and FODT (that
are the formats we prefer).

When saving in ODT:
        Error saving the document report_233:
        Write Error.
        Error in writing sub-document styles.xml.

When saving in FODT:
        Error saving the document report_233:
        Write Error.
        The file could not be written.

Other times I get a generic I/O error.

The smallest file that gives that error is:

http://paste.arn-fai.net/?2873952

By removing the whole 'FooterTable_Row' it successfully saves an FODT.

By removing 'style:family="table-cell"' it successfully saves an FODT.

How can I debug such issues in the future without going trial and error?

Thanks and have a great day,
Francesco

On 26/04/19 12:36, Regina Henschel wrote:

> Hi Francesco,
>
> Can it be saved to any of the other formats, eg odt or docx?
>
> Can you provide such generated fodt-file?
>
> Do you have compared, that a version without content is the same if
> saved from LibreOffice as if generated by your application?
>
> Which OS? Correct rights?
>
> Kind regards
> Regina
>
> Francesco Ongaro schrieb am 26-Apr-19 um 12:02:
>> Dear LibreOffice Community,
>>
>> sorry to bother, do you think there is a better place to ask such
>> question?
>>
>> I'm available to rebuild Libreoffice with symbols and debug it with
>> a little guidance (c++ sources are huge!).
>>
>> Thanks,
>> Francesco
>>
>> On 12/04/19 21:05, Francesco Ongaro wrote:
>>> Dear LibreOffice Community,
>>>
>>> I programmatically generate a FODT that opens without any problem and
>>> can be edited.
>>>
>>> When saving such FODT document I get "Write Error. The file could not be
>>> written.".
>>>
>>> BTW the document is valid XML, is there a method to debug such issue?
>>>
>>> I tried -DXSLTransformer.statsfile=/tmp/xslt_debug.txt as a Java startup
>>> parameter but the file is not created and I'm not sure that Java's XSLT
>>> is called when saving a document.
>>>
>>> Thanks a lot,
>>> ascii
>>>
>>> https://ask.libreoffice.org/en/question/190226/fodt-write-error-the-file-could-not-be-written/
>>>
>>>
>>
>>
>
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
pietvo pietvo
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

In reply to this post by Francesco Ongaro
For a start, there are XML errors in your document:

Line 122:
<style:paragraph-properties fo:margin-top="3.9402in" fo:margin-bottom="0.0799in" style:contextual-spacing="false" fo:break-before="page"/>
  </style:style>

style:contextual-spacing is not an allowed attribute.

Line 133:
  <style:style style:name="FooterTable_Right" style:family="4.1354inn">
   <style:table-column-properties style:column-width="4.425in" style:rel-column-width="6372*"/>
  </style:style>

style:family="4.1354inn" is wrong. It seems the style:family is mixed up with some measurement.

Line 153:
There is a second   <office:master-styles> element. There should be only one of these.

Line 162:
 <office:body>
 </office:body>

The <office:body> element must not be empty. Add an <office:text> element.


--
Piet van Oostrum <[hidden email]>
WWW: http://piet.vanoostrum.org/
PGP key: [8DAE142BE17999C4]


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

pietvo pietvo
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

In reply to this post by Francesco Ongaro
Francesco Ongaro <[hidden email]> writes:

>
> By removing the whole 'FooterTable_Row' it successfully saves an FODT.
>
> By removing 'style:family="table-cell"' it successfully saves an FODT.
>
You should put the table-related styled (style:family="table*") inside the <office:automatic-styles> rather than the <office:styles>.

<office:styles> is meant to be used for named styles that the user can select through the user interface, for example the Styles and Formatting side bar, or the Styles menu. The user interface doesn't have named table column, row or cell styles. On the other hand <office:automatic-styles> is for styles that are directly set in an object.

With these changes (and the corrections to the XML in my previous message), it works.)
--
Piet van Oostrum <[hidden email]>
WWW: http://piet.vanoostrum.org/
PGP key: [8DAE142BE17999C4]

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy

Francesco Ongaro Francesco Ongaro
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

Thanks Piet,

your knowledge on the matter is really helpful!

Seeing your advice I can only imagine how many errors my templates
contains.

Just two questions:

- How do you validate your FODT files?

- Do you have a preferred documentation reference for generating FODT
files?

I think that the error UI is not correctly describing what is an XML
error and it should prompt a more specific error message (for example
"Cannot save malformed XML") and maybe a technical detail could be
outputted to in the console.

I submitted the following bug report:

https://bugs.documentfoundation.org/show_bug.cgi?id=125019

Maybe this issue is impacting even other users.

Thanks,
Francesco

On 27/04/19 17:49, Piet van Oostrum wrote:

> Francesco Ongaro <[hidden email]> writes:
>
>>
>> By removing the whole 'FooterTable_Row' it successfully saves an FODT.
>>
>> By removing 'style:family="table-cell"' it successfully saves an FODT.
>>
> You should put the table-related styled (style:family="table*") inside the <office:automatic-styles> rather than the <office:styles>.
>
> <office:styles> is meant to be used for named styles that the user can select through the user interface, for example the Styles and Formatting side bar, or the Styles menu. The user interface doesn't have named table column, row or cell styles. On the other hand <office:automatic-styles> is for styles that are directly set in an object.
>
> With these changes (and the corrections to the XML in my previous message), it works.)
>


--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy
pietvo pietvo
Reply | Threaded
Open this post in threaded view
|

Re: FODT Write Error. The file could not be written.

Francesco Ongaro <[hidden email]> writes:

> Thanks Piet,
>
> your knowledge on the matter is really helpful!
>
> Seeing your advice I can only imagine how many errors my templates
> contains.
>
> Just two questions:
>
> - How do you validate your FODT files?

I just loaded the FODT file in Emacs, and it indicated some errors.

>
> - Do you have a preferred documentation reference for generating FODT
> files?

You may look at http://opendocumentformat.org/developers/

I did check the file against the OpenDocument documentation.
http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.pdf and related documents.

--
Piet van Oostrum <[hidden email]>
WWW: http://piet.vanoostrum.org/
PGP key: [8DAE142BE17999C4]

--
To unsubscribe e-mail to: [hidden email]
Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Privacy Policy: https://www.documentfoundation.org/privacy