DUO and LD_LIBRARY_PATH

This KB Article References: High Performance Computing
This Information is Intended for: Instructors, Researchers, Staff, Students
Created: 04/27/2020 Last Updated: 06/19/2024

If you have module load statements in your ~/.bashrc file, you may have noticed the following error show up:

WARNING: LD_LIBRARY_PATH_modshare exists ( /cm/shared/apps/slurm/17.11.12/lib64/slurm:1:/cm/shared/apps/slurm/17.11.12/lib64:1:/gpfs/software/htop-2.2.0/lib:1 ), but LD_LIBRARY_PATH doesn't. Environment is corrupted.

This is due to an issue with the DUO two factor authentication system. For some reason, DUO's authentication script prevents module load statements in your .bashrc from modifying the LD_LIBRARY_PATH environment variable. Luckily, the issue can be solved by adding this line to the top of your .bashrc:

[[ $- != *i* ]] && return

This line will prevent your .bashrc from being run if you're starting a non-interactive session. The initial DUO login script runs non-interactively and then starts an interactive shell session after you've authenticated, so this way it no longer interferes with things loaded in your .bashrc. This does come with a caveat: if you are setting the DUO_PASSCODE environment variable in your .bashrc, it will need to be declared above the line to implement this fix. So your entire .bashrc should look something like this:

# .bashrc
export DUO_PASSCODE=push
[[ $- != *i* ]] && return

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions
module load slurm

More information about the DUO_PASSCODE environment variable can be found on our Logging In FAQ page.

 

You may occasionally notice similar looking errors when loading or unloading modules. For example, a common one looks like this:

WARNING: $PATH does not agree with $PATH_modshare counter. The following directories' usage counters were adjusted to match. Note that this may mean that module unloading may not work correctly.
/cm/local/apps/environment-modules/4.0.0//bin

These kinds of errors could be due to small incompatibilities between Anaconda and the modulefile system or minor typos in our modulefiles. 99% of the time this warning is benign and can be ignored.

For More Information Contact


IACS Support System

Still Need Help? The best way to report your issue or make a request is by submitting a ticket.

Request Access or Report an Issue