Environment module not loading default module

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 6.4
  • environment-modules-3.2.9c-4.el6

Issue

If there is a module beginning with the same name as the default module it is loaded instead.

Consider following module files in ~modules:

~/modules$ ls -aR
.:
.  ..  test

./test:
.  ..  version  .version  version1

./test/version:
.  ..  1

$ cat .version
#%Module1.0
##
set ModulesVersion "version/1"

$ echo $MODULEPATH
/home/user/modules
$ module avail
----------------------------------------------------------------- /home/user/modules -----------------------------------------------------------------
test/version/1(default) test/version1
$ module list
No Modulefiles Currently Loaded.
$ module load test
$ module list
Currently Loaded Modulefiles:
  1) test/version1 <=== This is not the default module

but if version1 is renamed:

$ mv version1 1version
$ module avail
----------------------------------------------------------------- /home/user/modules -----------------------------------------------------------------
test/1version           test/version/1(default)
$ module purge
$ module load test
$ module list
Currently Loaded Modulefiles:
  1) test/version/1

Resolution

The ModulesVersion should be set either to a directory or to a file in the current directory. It is not the case in the above reproducer, so module load test ignores the ModulesVersion setting in .version, which is expected behaviour.

On the contrary, output of module avail is misleading when diplaying (default) at modulefile which is not treated as default by other commands. This bug has been addressed by update environment-modules-3.2.10-2.el6 released with Advisory RHBA-2015:0670-1.

Root Cause

Previously, misleading information about available modules in nested module
directories was displayed to the user. To fix this bug, the code detecting
module versions has been amended, and correct information is now displayed.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.