Bug 150846 - Converting txt files to pdf fails with a ERRCODE_IO_CANTWRITE error code
Summary: Converting txt files to pdf fails with a ERRCODE_IO_CANTWRITE error code
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:7.5.0 target:7.4.2 target:7.4.1
Keywords: bibisected, bisected, regression
: 150860 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-07 15:21 UTC by paraleh
Modified: 2024-08-20 09:56 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paraleh 2022-09-07 15:21:33 UTC
Description:
[LibreOffice 7.4.1.1
When running the CLI command to convert a text file to a pdf file, it fails to convert the txt file and gives out the error
```
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///home/myuser/converte/docx/test.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:3207 at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:1783)

```

Steps to Reproduce:
1.download tarfile from https://downloadarchive.documentfoundation.org/libreoffice/old/7.4.1.1/ and install it
2. create a txt file
echo "hello" > example.txt
3. convert txt file to pdf
libreoffice7.4 --headless --convert-to "pdf:writer_pdf_Export" "/home/someuser/docs/example.txt"

Actual Results:
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///home/someuser/docs/example.pdf> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:3207 at /home/buildslave/source/libo-core/sfx2/source/doc/sfxbasemodel.cxx:1783)


Expected Results:
PDF file created at current working directory


Reproducible: Always


User Profile Reset: No



Additional Info:
Failed on LibreOffice versions 7.4.1.1 and 7.4.0.2
Works on LibreOffice version 7.3.5.2
ask.libreoffice.org thread
https://ask.libreoffice.org/t/libreoffice-7-4-convert-docx-txt-to-pdf-error/81532/2
Comment 1 Mike Kaganski 2022-09-07 15:45:29 UTC
Regression after commit 0c3b8792b712e939d2ad524d554f96616b4844be.
Comment 2 Julien Nabet 2022-09-07 17:51:29 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.

(gdb) p aFilterOptions
$1 = "UTF8,LF,,,true,true,"
Comment 3 Julien Nabet 2022-09-07 18:06:14 UTC
perhaps we should change:
if (!aFilterData.hasElements() && !aFilterOptions.isEmpty())

into this:
if (!aFilterData.hasElements() && !aFilterOptions.isEmpty() && aFilterOptions.startsWith("{"))

?
Comment 4 Mike Kaganski 2022-09-07 18:55:15 UTC
https://gerrit.libreoffice.org/c/core/+/139613
Comment 5 Commit Notification 2022-09-08 06:25:52 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/467308d679a3f2b4bbdd117fcc73636d57d66c09

tdf#150846: FilterOptions in descriptor could come from import filter

It will be available in 7.5.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2022-09-08 11:09:09 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/807ae248ade0b0c6465e752fc800e34ef1664d59

tdf#150846: FilterOptions in descriptor could come from import filter

It will be available in 7.4.2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Mike Kaganski 2022-09-08 15:23:59 UTC
*** Bug 150860 has been marked as a duplicate of this bug. ***
Comment 8 Commit Notification 2022-09-08 18:01:29 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7578842634e007d096ed146f494939bd315b78e4

tdf#150846: vcl_pdfexport: Add unittest

It will be available in 7.5.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2022-09-09 17:15:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-7-4-1":

https://git.libreoffice.org/core/commit/6e5b05302081b3cd5d046671ce5b1d340c880b30

tdf#150846: FilterOptions in descriptor could come from import filter

It will be available in 7.4.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 10 dm 2022-09-15 09:09:51 UTC
Testing the fix and reporting back (15-Sep-2022 build)

$ libreoffice7.4 --version
LibreOfficeDev 7.4.2.0.0 ec447be0adc32a16af02732fab4af22bc17e02cd

$ echo "hello there people" > test

$ libreoffice7.4 --headless --invisible --convert-to pdf test
warn:oox.storage:6120:6120:oox/source/helper/zipstorage.cxx:68: ZipStorage::ZipStorage exception opening input storage com.sun.star.io.IOException message: "package signature check failed, probably not a package file at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_libreoffice-7-4/package/source/xstor/xfactory.cxx:241"

... [repeated a total of 18 times]

warn:legacy.tools:6120:6120:sfx2/source/appl/appuno.cxx:454: invalid type for Stream
convert [redacted]/test -> [redacted]/test.pdf using filter : writer_pdf_Export
Overwriting: [redacted]/test.pdf
Comment 11 Mike Kaganski 2022-09-15 09:38:10 UTC
(In reply to dm from comment #10)
> Testing the fix and reporting back

I'm afraid, you didn't report any results, or how did that fit / not fit your expectations - only copy-pasted a console output, which didn't clearly tell if the files were generated. The warnings are warnings; the "Overwriting:" line suggests it likely succeeded - but only you can tell for sure.
Comment 12 dm 2022-09-15 09:54:21 UTC
(In reply to Mike Kaganski from comment #11)
> (In reply to dm from comment #10)
> > Testing the fix and reporting back
> 
> I'm afraid, you didn't report any results, or how did that fit / not fit
> your expectations - only copy-pasted a console output, which didn't clearly
> tell if the files were generated. The warnings are warnings; the
> "Overwriting:" line suggests it likely succeeded - but only you can tell for
> sure.

The program succeeded in creating a pdf file. I am just reporting on the warnings generated, which could indicate an issue with the handler.  And another one, below, with a quasi-html file grabbed from a mail message.  Again, the file was generated exactly like with LO 7.3 but the development build includes warning which could point to a direction for better handling such cases.

-------------------------------------

Copy and paste this into test.html

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">Hello,<div>just heard that LO7.4 has an issue with convert.</div><div>Probably a regression.</div><div>...</div><div>Let's try to get it back</div><div>regards</div><div><br></div><div>PS This is an html file from an email message<br><br><div id="ymail_android_signature"><a id="ymail_android_signature_link" href="https://localhost">Sent from Yoohoo Mail on Android</a></div></div>

$ libreoffice7.4 --headless --invisible --convert-to pdf 'test.html'
warn:legacy.osl:10869:10869:xmloff/source/transform/OOo2Oasis.cxx:1944: duplicate doc handler
warn:legacy.osl:10869:10869:xmloff/source/transform/OOo2Oasis.cxx:1944: duplicate doc handler
warn:xmloff.style:10869:10869:xmloff/source/style/xmlstyle.cxx:267: Here is a duplicate Style
warn:sw.core:10869:10869:sw/source/core/docnode/node.cxx:1982: Wrong cond collection, skipping check of Cond Colls.
warn:sw.core:10869:10869:sw/source/core/docnode/node.cxx:1982: Wrong cond collection, skipping check of Cond Colls.
warn:unotools.config:10869:10869:unotools/source/config/configitem.cxx:423: ignoring XHierarchicalNameAccess Display/ShowContentTips com.sun.star.container.NoSuchElementException message: "Display/ShowContentTips at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_libreoffice-7-4/configmgr/source/access.cxx:438"
warn:unotools.config:10869:10869:unotools/source/config/configitem.cxx:423: ignoring XHierarchicalNameAccess Display/ShowContentTips com.sun.star.container.NoSuchElementException message: "Display/ShowContentTips at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_libreoffice-7-4/configmgr/source/access.cxx:438"
warn:sw.core:10869:10869:sw/source/core/docnode/node.cxx:1982: Wrong cond collection, skipping check of Cond Colls.

... [repeated a total of 18 times]

warn:legacy.tools:10869:10869:sfx2/source/doc/objmisc.cxx:1133: Don't close the medium when loading documents!
convert [redacted]/test.html -> [redacted]/test.pdf using filter : writer_web_pdf_Export
Overwriting: [redacted]/test.pdf [Yes, it was there from a previous test]