Ticket 3508

Summary: sbatch --output expands path options (%) in cwd leading to job failure
Product: Slurm Reporter: Jens Svalgaard Kohrt, SDU <svalgaard>
Component: slurmdAssignee: Jacob Jenson <jacob>
Status: RESOLVED TIMEDOUT QA Contact:
Severity: 6 - No support contract    
Priority: ---    
Version: 15.08.12   
Hardware: Linux   
OS: Linux   
Site: -Other- Slinky Site: ---
Alineos Sites: --- Atos/Eviden Sites: ---
Confidential Site: --- Coreweave sites: ---
Cray Sites: --- DS9 clusters: ---
Google sites: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- NoveTech Sites: ---
Nvidia HWinf-CS Sites: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Tzag Elita Sites: ---
Linux Distro: --- Machine Name:
CLE Version: Version Fixed:
Target Release: --- DevPrio: ---
Emory-Cloud Sites: ---

Description Jens Svalgaard Kohrt, SDU 2017-02-27 08:16:47 MST
If a job is submitted in a directory name with %, e.g., %u, --output expands this leading to a job that does not start (except if the diretory named with the path expansion happen to be there).

Test case:
sysop@fe1:~/test/percent-issue/test-%u$ find .. -type f
../test-%u/test.sh
sysop@fe1:~/test/percent-issue/test-%u$ cat test.sh
#! /bin/bash
#SBATCH --output out.out
date
sysop@fe1:~/test/percent-issue/test-%u$ sbatch -t 5 test.sh
Submitted batch job 702039

Expected result:
The output ends up in the file out.out in the current directory (test-%u).

Actual result:
The output ends up in the file out.out in the %-expanded directory (test-sysop).
If the path option expanded directory does not exist, the job fails immediately.

sysop@fe1:~/test/percent-issue/test-%u$ find .. -type f
../test-%u/test.sh
../test-sysop/out.out


Fix:
As far as I can see, this can be fixed by simply prepending cwd *after* expanding the path options in fname_create in
/src/slurmd/common/fname.c
Comment 1 Jacob Jenson 2017-11-09 13:53:11 MST
15.08 is no longer a supported version. If this is in an issue in 17.02 or 17.11 please let me know and we can discuss support contract options which will enable you to work with the support team to resolve this issue.

Jacob