Bug 161489 - CSV convert to HTML from cli crash
Summary: CSV convert to HTML from cli crash
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.2.4.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-10 09:39 UTC by Daniele Mte90 Scasciafratte
Modified: 2024-06-10 10:38 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
the file generating the crash (5.49 KB, text/csv)
2024-06-10 09:39 UTC, Daniele Mte90 Scasciafratte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniele Mte90 Scasciafratte 2024-06-10 09:39:15 UTC
Description:
So I have a CSV with cells separated by a double semi-colon and if I try to convert it as HTML I get this:

soffice --headless --convert-to htm:HTML --outdir . LibriNuovi.csv

This is the output:

convert /path/LibriNuovi.csv as a Calc document -> /path/LibriNuovi.htm using filter : HTML
Error: Please verify input parameters... (SfxBaseModel::impl_store <file:///path/LibriNuovi.htm> failed: 0xc10(Error Area:Io Class:Write Code:16) at ./sfx2/source/doc/sfxbasemodel.cxx:3274 at ./sfx2/source/doc/sfxbasemodel.cxx:1822)

My guess is that as LibreOffice requires on opening a CSV some filter on how to load the file it is expecting the same in this way and somehow crashes.
In this case there should be a output informing that or some documentation (that I wasn't able to find).

Steps to Reproduce:
1. Try with the attached file and the same command


Actual Results:
That output

Expected Results:
The html file generated


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.2.4.2 (X86_64) / LibreOffice Community
Build ID: 420(Build:2)
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: it-IT (it_IT.UTF-8); UI: it-IT
Debian package version: 4:24.2.4-1
Calc: threaded
Comment 1 Daniele Mte90 Scasciafratte 2024-06-10 09:39:31 UTC
Created attachment 194622 [details]
the file generating the crash
Comment 2 Mike Kaganski 2024-06-10 10:20:11 UTC
This is not a bug. The command line that you used has this:

  --convert-to htm:HTML

Where that ":HTML" was taken from? In any case, not from the documentation [1], which tells, that the argument to --convert-to has, after the output file extension, an optional comma and OutputFilterName. Further, that --convert-to entry has a link to the list of document filters [2], where there is no entries named simply "HTML" in the "API Name (OutputFilterName / InputFilterName)" column.  In the "Filters for CALC" section (applicable because CSV are opened in Calc), there is a "HTML (StarCalc)" filter, which would allow e.g. this command line:

  soffice --headless --convert-to "htm:HTML (StarCalc)" --outdir . LibriNuovi.csv

But in fact, even that is unnecessary, because that is the default filter handling htm extension, so this would be the easier working command:

  soffice --headless --convert-to htm --outdir . LibriNuovi.csv

[1] https://help.libreoffice.org/latest/en-US/text/shared/guide/start_parameters.html?DbPAR=SHARED
[2] https://help.libreoffice.org/latest/en-US/text/shared/guide/convertfilters.html?&DbPAR=SHARED
Comment 3 Daniele Mte90 Scasciafratte 2024-06-10 10:23:13 UTC
I see, but the CLI version shouldn't add this kind of information?
Because showing the cpp files usually is a crash as behaviour.

The command is the same I am using for odt files like:

soffice --headless --convert-to htm:HTML --outdir . libri.odt

And works with no issue instead the CSV file crashes.

I think that the CLI should give some hints about what I did wrong instead of an error like this that is not helpful.
Comment 4 Mike Kaganski 2024-06-10 10:29:52 UTC
(In reply to Daniele Mte90 Scasciafratte from comment #3)

Before lately, we didn't provide additional information. In those versions, the error would simply be "Error: Please verify input parameters...". Well, adding more information, that would help if needed, makes users unhappy. It would be ideal to tell you specifically "you provided a wrong name", but I know how it's implemented, so I can tell you only "don't hold your breath" ;) - I would guess, that it would take no less than ten years, to find someone who is interested to untangle the whole complexity to deliver the information from layer to layer. The technical info was a simple-to-implement thing to help in cases where it is needed; and in general, no convenience output really substituted reading the documentation.
Comment 5 Daniele Mte90 Scasciafratte 2024-06-10 10:35:04 UTC
I understand but instead to show a crash, is helpful to show like "the parameter you provided is not supported" as there is a crash it is possible to detect and show a basic error and maybe a link to the documentation.

Doesn't seems very difficult, and I understand that require a contributor but it would improve as looking online I wasn't able to find how to use the CLI on libreoffice for converting files that weren't the odt/odp/ods etc.
Comment 6 Mike Kaganski 2024-06-10 10:38:16 UTC
(In reply to Daniele Mte90 Scasciafratte from comment #5)

We do *not* show a crash! We just show the point, at which the error of conversion appeared. And at that point, there was no information about the command line.

> Doesn't seems very difficult

We welcome anyone. Please read https://www.libreoffice.org/community/developers/, join #libreoffice-dev, and we will be glad to mentor you and provide with code pointers.