BOM -> I/O error : Invalid argument

Hello!

I’m trying to generate a BOM from my schematic and get the following error:

Command error. Return code 11
Error messages:
I/O error : Invalid argument
I/O error : Invalid argument

I’m using the following command: xsltproc -o “%O.csv” “C:\Program Files (x86)\KiCad\bin\scripting\plugins\bom_cvs.xsl” “%I”

What am I doing wrong?

Thanks !

PS:
Application: kicad
Version: (2015-09-12 BZR 6186, Git 72e50b4)-product release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.2.0,wx containers,compatible with 2.8)
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW (I’m actually running Windows 10 64bit)
Boost version: 1.57.0
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
USE_FP_LIB_TABLE=HARD_CODED_ON
BUILD_GITHUB_PLUGIN=ON

Dear pivic,

The xsltproc included in the latest KiCad package(RC1) does not work as you mentioned. This is RC and, I think, will be fixed shortly.

The workaround for this problem is to use another XSL engine. Please refer the post “BOM generation in “new” Kicad (Windows)”. This is my choice.

If you want to use xsltproc, please refer “Installing an XSLT processor”. There is a nice Web page for this(written in Japanese), but I excluded that because I am new here and can include only two URLs.

Thank you.

Thanks a lot for your reply! I installed the SaxonHE9-5 for now and it works.

This command line works for me …
C:\Program Files\KiCad\bin\xsltproc.exe -o “%O.csv” C:\PATHTOFOLDER\Documents\Kicad\bom2csv.xsl “%I”

Win10 64 bit, Kicad 4.0.0.RC1

Hi, I tried your command line but it generates the same error as before…

Hi pivic,

“Generate a BOM” cannot seems to handle spaces in path names. Would you move your project to the path of a folder without space in it’s name?

2 Likes

It seems that you spotted the problem ! Even the name of the schematic must not have any spaces…

Can that be fixed in the next version please?

I noticed the same issue. It is caused by spaces in the output file (path)name.

xsltproc is not able to handle this. I didn’t try yet but probably saxonHE9-5 is a good solution. Another option is to change the “%O.csv” parameter to fixed file in a path without spaces and then copy this manually.

Some more discussion can be found at https://bugs.launchpad.net/kicad/+bug/1473373

1 Like

This is still an issue, and I don’t see a bug report on the Launchpad site, but that site seems to be limited Linux and this is a Windows issue.

What’s the proper way to file this?

1 Like

Bugs for all platforms can be reported at https://bugs.launchpad.net/kicad, not just Linux.

For me this error occured when there were non ASCII characters (like é, á) in the folder name of the project. Other parts of KiCad worked fine with this name, only the BOM generation not. Changing the folder name solved this issue for me.

1 Like

By default is Kicad not installed to “C:\Program Files\KiCad” ?

Which has a space. My project directory does not have a space, but my KiCad installation does, must I uninstall and re-setup KiCad?

Yes it is on x64 PCs and 686 PCs. It looks like the OP was using a 32 bit build on a 64 bit Windows as the install was in
“C:\Program Files (x86)\KiCad”, which introduces a second space and brackets.

The actual project directory should be under C:\Users\Yourname…
Several programs don’t like nonascii(7bit) characters in the Username
The actual project name should also stick to ascii(7bit)

1 Like

I don’t think so, at least not for xsltproc. The problem there is to do with spaces in the project name, or the path to the project.

Hi, I have same issue with you.
After i try clear space character in file name & file path, the issue was still there.
So, I met some issue similar with argument before. One of them is file parth too long. So I tried to move project to shorter folder path.
It is success now.
One thing is not professional is output of plugin is file name without sub-fix, as expecting .csv, I need to change extension file name from binary type to .csv to onpen in Excel.

Making a small edit in the command line section part “%O” as “%O.csv” or “%O_BoM.csv” will resolve the file extension renaming issue.

How cab we generate the BOM in kicad 5.1.5?

1 Like

The problem is on the output path, so to fix this error just use this next command and it will work fine, after that you can just convert file, importing data from CSV to a XLSX file if you want:

xsltproc -o BOM.csv “C:\Program Files\KiCad\bin\scripting\plugins\bom2grouped_csv.xsl” “%I”

This thread started in 2015.
I think that the BOM functions have changed several times since then