CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Bugs (https://www.cfd-online.com/Forums/openfoam-bugs/)
-   -   reconstructPar --> fileName::stripInvalid() called for invalid fileName commandtouse (https://www.cfd-online.com/Forums/openfoam-bugs/66040-reconstructpar-filename-stripinvalid-called-invalid-filename-commandtouse.html)

adona058 July 3, 2009 11:15

reconstructPar --> fileName::stripInvalid() called for invalid fileName commandtouse
 
I am attempting to set up my dual-core computer to use MPIRUN with a case that I am running.

I decomposed the file, ran MPIRUN without a problem, and the results are distributed within the Processor0 and Processor1 directories as expected. Note that I have run MANY parallel cases on a larger network cluster in the past, so I am familiar with the general process.

The problem I am encountering occurs when I attempt to use reconstructPar to reconstruct the results. The terminal output is as follows:

reconstructPar
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5.x |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Exec : reconstructPar
Date : Jul 03 2009
Time : 11:02:57
Host : adona058-laptop
PID : 27442
Case : /home/adona058/OpenFOAM/adona058-1.5.x/run/taylorBubbleParallel
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

fileName::stripInvalid() called for invalid fileName commandtouse
For debug level (= 2) > 1 this is considered fatal
Aborted



I would appreciate it if someone could get back to me on why this is occuring. I can set the debug level to 0 to avoid it, but I would rather know that the program is executing correctly.

Thanks,

Adam

mattijs July 3, 2009 12:53

you have an invalid named file somewhere. After stripping out the invalid characters it is 'commandtouse'.

hansel November 19, 2009 11:46

Quote:

Originally Posted by mattijs (Post 221417)
you have an invalid named file somewhere. After stripping out the invalid characters it is 'commandtouse'.

I have the same problem and my file names aren't using any strange characters. Is there a length limit for the entire path and file name?

olesen November 20, 2009 02:21

Quote:

Originally Posted by hansel (Post 236935)
I have the same problem and my file names aren't using any strange characters. Is there a length limit for the entire path and file name?

The only real length limit would be INT_MAX, which likely isn't a problem (your filesystem will likely have problems first).

Could you post which file name is getting stripped, so we can reproduce the problem. For reference, here is what src/OpenFOAM/primitives/strings/fileName/fileNameI.H states:

Code:

inline bool Foam::fileName::valid(char c)
{
    return
    (
        !isspace(c)
    && c != '"'  // string quote
    && c != '\''  // string quote
    );
}

Thus whitespace and quotes are the only things it could (should) be complaining about.

hansel November 20, 2009 10:32

The filename it was working on was:
/storage/OpenFOAM_cases/lenz2_size_exp/len2_18in_tsr06_halftail

The error message would report the name but leave off the _halftail part.

Changing the name to /storage/OpenFOAM_cases/lenz2_size_exp/len2_18inht_tsr06 made the problem go away.

I'm pretty sure I didn't have any spaces in the name, but since I changed it I can't be 100% sure.

This happened with 1.5dev, so you may not want to bother with it.

flowris April 14, 2010 10:35

Too long path name
 
Hansel, Olesen,


I also tried to run blockMesh on a very deeply nested set of files, and it got the same error. When i copied the folder to my desktop, I could run it.

mattijs April 14, 2010 15:48

Is this 16x on linux? We have not been able to reproduce the problem - do you have an example?

flowris April 15, 2010 03:26

deeply nested
 
Goeiemorgen Mattijs,

I tried to run the interFoam tutorial by Hassan Hemida. The files can be downloaded from http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/. I nested everything very deeply in my file structure , namely in:

Documents/OpenFOAM\ info/Chalmers/interFoam/fillBottle/lamFillBottle/

However, some other minor difficulties occurred with these files. I had to change some names of parameters like gamma to alpha and pd to p in the system files. I also had to add files like constant/turbulenceProperties and constant/g. Is this because the tutorial was written for an older version of interFoam? I am using OpenFOAM-1.6.


Joris

olesen April 15, 2010 04:01

Quote:

Originally Posted by flowris (Post 254706)
I tried to run the interFoam tutorial by Hassan Hemida. The files can be downloaded from http://www.tfd.chalmers.se/~hani/kurser/OS_CFD_2007/. I nested everything very deeply in my file structure , namely in:

Documents/OpenFOAM\ info/Chalmers/interFoam/fillBottle/lamFillBottle/

Spaces in directory and file names are pure poison for OpenFOAM (and several other bits of Unix software). Try renaming to something without space/tab etc and see if that does the trick.

taheri.atp December 23, 2013 10:40

hi
I have this problem too!
I can run blockMesh but when I want too see my mesh in ParaFOAM I get this answer:

fileName::stripInvalid() called for invalid fileName /home/ahmad/Desktop/tpfoch/system/fvSolution::solvers::(U|k|epsilon)
For debug level (= 2) > 1 this is considered fatal

can you help me to solve this problem?

nimasam December 25, 2013 01:55

Dear Ahmad

it return to files names usually, check that you have no extra space or unusual file name, another suggestion can be that you can copy your blockMeshDict into icoFoam/cavity , then run blockMesh and see whether it works or not :D

taheri.atp December 25, 2013 02:11

Quote:

Originally Posted by nimasam (Post 467581)
Dear Ahmad

it return to files names usually, check that you have no extra space or unusual file name, another suggestion can be that you can copy your blockMeshDict into icoFoam/cavity , then run blockMesh and see whether it works or not :D

wow!
I copied blockMeshDict to cavity and it worked!!!!
what does it mean?!?!?!

nimasam December 25, 2013 02:18

it means nothing, means you should create a new test case or find where the typo is,
as i said it usually returns to bad file name

wyldckat December 25, 2013 05:37

Greetings to all!

Since this is a frequently asked question, I've added to the FAQ: http://openfoamwiki.net/index.php/FA..._invalid.22.3F

Best regards,
Bruno

Yeru June 7, 2014 12:06

stripInvalid() with patch names
 
Hi foamers,

in order to get familiar with OF and especially groovyBC, I'm currently trying to get a case of 2 cyclically linked patches to work (according to this example in the wiki).

Here's where the relation to this thread comes in:
simpleFoam stops after having calculated u in the first timestep (after startTime) with this:
Code:

word::stripInvalid() called for word p_Rect0front
    For debug level (= 2) > 1 this is considered fatal

What's p_Rect0front?
There are <PatchName>_front and <PatchName>_back for every patch in the inlet and outlet.
In my 0/p-file, in order to use groovyBC, I defined:
Code:

boundaryField{
[...]
innerRect0_front
{
    type        groovyBC;
    variables      "p_Rect0back{innerRect0_back}=sum(p*mag(Sf()))/sum(mag(Sf()));    p_Rect0front=sum(p*mag(Sf()))/sum(mag(Sf()));    f_relax=0.5;";
    valueExpression "(p_Rect0front + f_relax*(p_Rect0back - p_Rect0front))";
    value        $internalField;
    }
    innerRect0_back
    {
        type            zeroGradient;
    }

The problem will not be any special characters or length of the variables, since the wiki example uses
Code:

p_int22
, so including numbers and an underscore.

Any ideas?

wyldckat June 7, 2014 17:42

Greetings Dominik,

I've Googled just now for:
Code:

site:www.cfd-online.com stripInvalid groovyBC
and found this post by Bernhard from 2012: http://www.cfd-online.com/Forums/ope...tml#post371428 post #2

Essentially you cannot have spaces inside the variables expressions, otherwise they'll count as part of the variable names. This is essentially exemplified in the wiki page section you indicated, where not a single space is present in the variables expressions! ;)

And if you're wondering why this is still a problem since 2012, it's probably because no one has taken the time to report this on the bug tracker for swak4Foam/groovyBC :rolleyes:.

Best regards,
Bruno

Yeru June 8, 2014 05:24

stripInvalid() with patch names - SOLVED
 
Dear Bruno,

thanks a lot! It's sufficiently working now.
I'm sorry for stirring this up when a simple "google it" is the answer.
Anyway, thanks again,

Dominik

bmayurm June 2, 2015 02:29

Problem while converting .msh to openFoam
 
I am using command fluentMeshToFoam to convert .msh fluent mesh (from ICEM) to openfoam format.
The error is same above
for debug level (= 2) 1 this is considered fatal aborted (core dumped).
Please help. I'm New in this

wyldckat June 12, 2015 18:47

Quote:

Originally Posted by bmayurm (Post 548501)
Please help. I'm New in this

Not enough information. Please follow the instructions given on this thread: http://www.cfd-online.com/Forums/ope...-get-help.html

AJAY BHANDARI December 23, 2015 12:47

fileName::stripInvalid() called for invalid fileName 0
 
HI all,

I think my post fits best here . I am getting the same error as above. First my case ran correctly without any mistake and then when i compiled it again its giving error..

fileName::stripInvalid() called for invalid fileName 0
For debug level (= 2) > 1 this is considered fatal
Aborted (core dumped)

Please suggest what should i do?? Any help will be appreciated..

Regards
Ajay

wyldckat December 24, 2015 15:46

Quote:

Originally Posted by AJAY BHANDARI (Post 578566)
Please suggest what should i do?? Any help will be appreciated..

Quick answer: Quoting myself from two previous posts:
  1. Quote:

    Originally Posted by wyldckat (Post 550182)
    Not enough information. Please follow the instructions given on this thread: http://www.cfd-online.com/Forums/ope...-get-help.html

  2. Quote:

    Originally Posted by wyldckat (Post 467606)
    [...] this is a frequently asked question, I've added to the FAQ: http://openfoamwiki.net/index.php/FA..._invalid.22.3F

And please do keep in mind that we cannot see what you do not show us, nor can we see what you do not share with us. Because that error message alone can mean several things, depending on the exact context.

LuckyTran May 18, 2016 14:29

I ran into this error today and have been tinkering with it. None of my OF utilities were working and all threw the same error so I thought I had a messed up build. But eventually I found it was just a space in a folder name.

VIJAYA KUMAR July 1, 2016 10:00

As mentioned in the above threads, Directory and Mesh file names which are irregular (contains underscore, other symbols) are poisonous. I too was down with this problem. Changed all my file names and case directory names as simple Numbers and Characters

gned October 3, 2016 11:13

dear mark,
I'm quite out of space in my ssd disk of my laptop by now. So I would often have the need to try/run/visualize some cases on an external USB I have, but which unfortunately is recognized as TOSHIBA EXT by the system, with a whitespace in the name! Is this possible modifying some files as fileName.H to make OF digest these names strings?

wyldckat October 6, 2016 15:39

Quote:

Originally Posted by gned (Post 620137)
dear mark,
I'm quite out of space in my ssd disk of my laptop by now. So I would often have the need to try/run/visualize some cases on an external USB I have, but which unfortunately is recognized as TOSHIBA EXT by the system, with a whitespace in the name! Is this possible modifying some files as fileName.H to make OF digest these names strings?

Quick answer: You can try using symbolic links. For example, if you run:
Code:

mkdir -p $FOAM_RUN
cd $FOAM_RUN
ln -s "/media/username/TOSHIBA EXT"  usbdisk

it will:
  1. Create
  2. and go into the default folder that OpenFOAM assigns to the user for running cases inside;
  3. and then creates a symbolic link path to the USB disk.
I'm assuming you are using Ubuntu, therefore you need to change the "username" word with your own user-name.

Using quotes for the path with spaces is necessary. The alternative would be to use the backslash:
Code:

ln -s /media/username/TOSHIBA\ EXT  usbdisk
Once the symbolic link is created, you can now go into the symbolic folder:
Code:

cd usbdisk
and then navigate to the folder where you have the cases from there onwards.

Note: You don't need to delete the symbolic link when you safely eject the USB disk.

RK_Token January 11, 2017 16:08

Just in case, it may help someone.
I had the same problem but in my case I had a jupyter notebook file saved at the simulation case folder, with a space in its name "notebook name.ipynb". This was enough to break the reconstructPar command.

wyldckat January 11, 2017 16:50

Quick question @RK_Token: Which OpenFOAM version were/are you using?

I ask this because if it's one of the more recent versions, we can still have this fixed much sooner than later.

And I am very glad that Python based Jupyter Notebooks are being used along with OpenFOAM!

RK_Token January 11, 2017 17:13

Hey @wyldckat I'm using OpenFOAM-4.1 64bit

Quote:

#+TITLE: README for [[http://openfoam.org/version/4-1][OpenFOAM-4.1]]
#+AUTHOR: The OpenFOAM Foundation
#+DATE: 28th June 2016
If you need more information let me know.

john zhu February 8, 2017 06:26

You may want to make a backup and copied some file then renamed it. and there is a space in the name of your execution file.

Jingxue Wang October 10, 2017 06:18

I also meet this problem just now.

I make a new folder and then copy all the inner files into this. And it worked.

olesen December 15, 2017 02:49

Quote:

Originally Posted by olesen (Post 254713)
Spaces in directory and file names are pure poison for OpenFOAM (and several other bits of Unix software). Try renaming to something without space/tab etc and see if that does the trick.


FWIW this longstanding problem has now been fixed in the upcoming OpenFOAM-v1712 release. Now the POSIX readDir will silently (or noisily) drop file and directory names with weird characters that would cause OpenFOAM problems.

purnp2 December 25, 2018 00:39

Hello!
I faced a similar issue and solved it successfully.
>>
Create databases as time
fileName::stripInvalid() called for invalid fileName 02vectorvelmag.png
For debug level (= 2) > 1 this is considered fatal
Aborted (core dumped)
>>
Solution>>>>>
the file name "02vectorvelmag.png" is actually a .png file saved in my caseDirectory which is actually named as "02 vector vel mag.png" which I saved during post-processing of another case.
So, I removed this file to another location and run the intended command once again. it worked.

sia23 July 19, 2020 15:32

Quote:

Originally Posted by olesen (Post 254713)
Spaces in directory and file names are pure poison for OpenFOAM (and several other bits of Unix software). Try renaming to something without space/tab etc and see if that does the trick.

That solved my problem. Thank you!
I had one space in my directory name.

Woo37830 January 11, 2021 17:18

Quote:

Originally Posted by mattijs (Post 221417)
you have an invalid named file somewhere. After stripping out the invalid characters it is 'commandtouse'.

I had this mistake and found that I had made a backup copy of system and called it system.copy. That gave the error invalidFileName systemcopy

Perhaps it's something as simple as an extra file or directory in you setup folders.

hogglife December 8, 2022 21:27

Maybe useful for someone. I met the similar error, i.e.

for time = 0LUID_inner
fileName::stripInvalid() called for invalid fileName FLUID_inner
For debug level (= 2) > 1 this is considered fatal

when I run the case from Allrun script. But it run without this error if I input the same command in terminal. Finally I find there are two blank lines after the command which the above error emit. After delete these two blank lines, it runs successfully.

I am new and not sure if you have already know this.


All times are GMT -4. The time now is 20:47.