software-layer icon indicating copy to clipboard operation
software-layer copied to clipboard

module avail always returns 0 for an existing module dir but non-existing module

Open bedroge opened this issue 4 years ago • 1 comments

While working on #86, I noticed that the module avail <whatever> command always returned 0 for me, even if a module for <whatever> does not exist:

[EESSI pilot 2021.03] $ module avail EasyBuild/4.5.0
No module(s) or extension(s) found!
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".


[EESSI pilot 2021.03] $ echo $?
0
[EESSI pilot 2021.03] $ module avail EasyBuild/4.3.4

 /cvmfs/pilot.eessi-hpc.org/2021.03/software/linux/x86_64/intel/haswell/modules/all 
   EasyBuild/4.3.4

Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".


[EESSI pilot 2021.03] $ echo $?
0
[EESSI pilot 2021.03] $ module avail ThisDoesNotExist
No module(s) or extension(s) found!
Use "module spider" to find all possible modules and extensions.
Use "module keyword key1 key2 ..." to search for all possible modules matching
any of the "keys".


[EESSI pilot 2021.03] $ echo $?
0

When building a new stack from scratch, you don't notice this, because the $MODULEPATH then still points to a non-existing directory, in which case module avail does return 1:

[EESSI pilot 2021.03] $ export MODULEPATH=/does/not/exist
[EESSI pilot 2021.03] $ module avail EasyBuild
Lmod has detected the following error:  module avail is not
possible. MODULEPATH is not set or not set with valid paths.



[EESSI pilot 2021.03] $ echo $?
1

But if you need to update EasyBuild, as was necessary for #86, this is annoying. A possible solution would be to use module spider or module is-avail.

bedroge avatar Apr 13 '21 11:04 bedroge

This should be fixed in #100 where I make a switch to using module show and am more explicit about which EB module to load

ocaisa avatar May 06 '21 09:05 ocaisa

This is stale

ocaisa avatar Sep 19 '25 13:09 ocaisa