Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment passing still fails when variables contain spaces #43

Open
lwilson opened this issue Aug 8, 2017 · 0 comments
Open

Environment passing still fails when variables contain spaces #43

lwilson opened this issue Aug 8, 2017 · 0 comments
Labels
Milestone

Comments

@lwilson
Copy link
Contributor

lwilson commented Aug 8, 2017

From TACC support ticket 39538:

Hello,

I was getting a strange error when submitting my jobs:

env: 02: No such file or directory

I tracked it down to /opt/apps/launcher/3.0.1/pass_env, which (to my understanding) assembles a string of variable declarations that is passed to the ssh call on line 204 of /opt/apps/launcher/3.0.1/paramrun.

The problem is when the environment contains variables with values containing blanks, e.g.:

export MONTH_LIST="01 02 03 04 05 06 07 08 09 10 11 12"

This will cause the variable MONTH_LIST to be expanded by /opt/apps/launcher/3.0.1/pass_env to (in bold):

... TACC_ICC_LIB=/opt/apps/intel/16.0.1.150/compilers_and_libraries_2016.1.150/linux/compiler/lib/intel64 MONTH_LIST=01 02 03 04 05 06 07 08 09 10 11 12 SLURM_CPUS_ON_NODE=48 ...

Note the missing quotes in the declaration of the MONTH_LIST variable. It gets the value "01" assigned and then "02 03..." is left dangling, causing the error reported above.

In case the AcceptEnv option in sshd_config has not been considered, I suggest that as a possible solution. Even more convoluted solutions such as replacing line 204 of /opt/apps/launcher/3.0.1/paramrun with:

SSHENV=/tmp/$RANDOM
env > $SSHENV
echo "LAUNCHER_NHOSTS=$np" >> $SSHENV
echo "LAUNCHER_HOST_ID=$i" >> $SSHENV
scp $SSHENV $host:~/.ssh/environment
ssh $host "cd $LAUNCHER_WORKDIR; $LAUNCHER_DIR/init_launcher" &
rm -f $SSHENV

seem a more robust option in comparison to fondling with multiple grep calls pipped from env.

On my side, I explicitly nullify these problematic variables in the env at the time the job is submitted, avoiding the problem, but I would assume this sort of issue might pop up eventually to someone else.

Best regards.

João Encarnação

@lwilson lwilson added this to the v3.2 milestone Aug 8, 2017
@lwilson lwilson added the bug label Aug 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant