Skip to content

No error messages from .modulerc execution #581

Open
@smprather

Description

@smprather

Describe the bug

When I make an error in .modulerc (reference non-existent variable, etc), the execution of .modulerc just stops. Everything else goes on as is nothing happened.

To Reproduce

Create a .modulerc file in a leaf modules directory (foo/bar/.modulerc). Insert an error into it (like puts stderr $foo).
Do a module show foo/bar.
You won't see the error message like you will with tclsh .../foo/bar/.modulerc.

Expected behavior

Give an error message similar to what happens when a regular module file is being sourced.

Error and debugging information

$ module --debug <command1> <arguments>
$ module --debug <command2> <arguments>
...

Modules version and configuration

$ module --version
Modules Release 5.4.0 (2024-02-20)
$ module config --dump-state
Modules Release 5.4.0 (2024-02-20)

- Config. name ---------.- Value (set by if default overridden) ---------------
abort_on_error            ml:reload:switch_unload
advanced_version_spec     1
auto_handling             1
avail_indepth             1
avail_output              modulepath:alias:dirwsym:sym:tag:variantifspec:key
avail_terse_output        modulepath:alias:dirwsym:sym:tag:variantifspec
cache_buffer_bytes        32768
cache_expiry_secs         0
collection_pin_tag        0
collection_pin_version    0
collection_target         <undef>
color                     auto
colors                    hi=1:db=2:tr=2:se=2:er=91:wa=93:me=95:in=94:mp=1;94:di=94:al=96:va=93:sy=95:de=4:cm=92:aL=100:L=90;47:H=2:F=41:nF=43:S=46:sS=44:kL=30;48;5;109
contact                   root@localhost
csh_limit                 4000
editor                    nvim
extended_default          1
extra_siteconfig          <undef>
home                      /usr/share/Modules (env-var)
icase                     search
ignore_cache              0
ignore_user_rc            0
ignored_dirs              CVS RCS SCCS .svn .git .SYNC .sos
implicit_default          1
implicit_requirement      1
list_output               header:idx:variant:sym:tag:key
list_terse_output         header
locked_configs
mcookie_check             always
mcookie_version_check     1
ml                        1
nearly_forbidden_days     14
pager                     /usr/bin/less -eFKRX
protected_envvars         <undef>
quarantine_support        0
rcfile                    <undef>
redirect_output           1
reset_target_state        __init__
run_quarantine            LD_LIBRARY_PATH LD_PRELOAD (env-var)
search_match              starts_with
set_shell_startup         0
shells_with_ksh_fpath
silent_shell_debug        0
siteconfig                /grid/common/pkgs/modules/v5.4.0/etc/siteconfig.tcl
source_cache              0
sticky_purge              error
tag_abbrev                auto-loaded=aL:loaded=L:hidden=H:hidden-loaded=H:forbidden=F:nearly-forbidden=nF:sticky=S:super-sticky=sS:keep-loaded=kL
tag_color_name
tcl_ext_lib               /grid/common/pkgs/modules/v5.4.0/lib/libtclenvmodules.so
tcl_linter                nagelfar.tcl
term_background           dark
term_width                0
unique_name_loaded        0
unload_match_order        returnlast
variant_shortcut
verbosity                 normal
wa_277                    0

- State name -----------.- Value ----------------------------------------------
always_read_full_file     1
autoinit                  0
clock_seconds             1752252586
cmdline                   /grid/common/pkgs/modules/v5.4.0/libexec/modulecmd.tcl bash config --dump-state
commandname               config
domainname                cadence.com
error_count               0
extra_siteconfig_loaded   0
false_rendered            0
force                     0
hiding_threshold          0
inhibit_errreport         0
inhibit_interp            0
init_error_report         1
is_stderr_tty             1
cmdline                   /grid/common/pkgs/modules/v5.4.0/libexec/modulecmd.tcl bash config --dump-state
commandname               config
domainname                cadence.com
error_count               0
extra_siteconfig_loaded   0
false_rendered            0
force                     0
hiding_threshold          0
inhibit_errreport         0
inhibit_interp            0
init_error_report         1
is_stderr_tty             1
is_win                    0
kernelversion             #1 SMP PREEMPT_DYNAMIC Fri Jul 19 14:40:47 EDT 2024
lm_info_cached            0
machine                   x86_64
nodename                  sjcvl1-mylesp
os                        Linux
osversion                 5.14.0-427.28.1.el9_4.x86_64
paginate                  1
path_separator            :
report_format             regular
reportfd                  file4
return_false              0
shell                     bash
shelltype                 sh
siteconfig_loaded         1
sub1_separator            &
sub2_separator            |
subcmd                    config
subcmd_args               --dump-state
supported_shells          sh bash ksh zsh csh tcsh fish cmd tcl perl python ruby lisp cmake r
tcl_ext_lib_loaded        1
tcl_version               8.6.10
term_columns              282
timer                     0
usergroups                cadence1
username                  mylesp

- Env. variable --------.- Value ----------------------------------------------
BASH_FUNC__module_raw%%   () {  eval "$(/usr/bin/tclsh '/grid/common/pkgs/modules/v5.4.0/libexec/modulecmd.tcl' bash "$@")";
 _mlstatus=$?;
 return $_mlstatus
}
BASH_FUNC_module%%        () {  local _mlredir=1;
 if [ -n "${MODULES_REDIRECT_OUTPUT+x}" ]; then
 if [ "$MODULES_REDIRECT_OUTPUT" = '0' ]; then
 _mlredir=0;
 else
 if [ "$MODULES_REDIRECT_OUTPUT" = '1' ]; then
 _mlredir=1;
 fi;
 fi;
 fi;
 case " $@ " in
 *' --no-redirect '*)
 _mlredir=0
 ;;
 *' --redirect '*)
 _mlredir=1
 ;;
 esac;
 if [ $_mlredir -eq 0 ]; then
 _module_raw "$@";
 else
 _module_raw "$@" 2>&1;
 fi
}
LOADEDMODULES             fast/shims/1.0.0:foss/python_venv/3.13.4:farm/sjlsf01/10.1.14
MODULEPATH                /vols/fast_digital_scratch/users/mylesp/dev/fast_cad/modules
MODULESHOME               /usr/share/Modules
MODULES_CMD               /grid/common/pkgs/modules/v5.4.0/libexec/modulecmd.tcl
MODULES_RUN_QUARANTINE    LD_LIBRARY_PATH LD_PRELOAD
_LMFILES_                 /vols/anvil_release/fast_cad/modules/fast/shims/1.0.0:/vols/anvil_release/fast_cad/modules/foss/python_venv/3.13.4:/vols/anvil_release/fast_cad/modules/farm/sjlsf01/10.1.14
__MODULES_LMALTNAME       fast/shims/1.0.0&as|fast/default&as|fast/latest&as|fast/shims/default&as|fast/shims/latest:foss/python_venv/3.13.4&as|foss/python_venv/default&as|foss/python_venv/latest:farm/sjlsf01/10.1.14&as|farm/sjlsf01/default&as|farm/sjlsf01/latest
__MODULES_LMINIT          module use --append /usr/share/Modules/modulefiles:module use --append /etc/modulefiles:module use --append /usr/share/modulefiles
__MODULES_SHARE_MANPATH   :1:/grid/sfi/farm/sjlsf01/10.1/man:2

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions