Ticket 9236

Summary: sbatch fails if --output/--error are specified and submitted under a directory that contains percent "%"
Product: Slurm Reporter: Eisuke Kawashima <e.kawaschima+slurm>
Component: User CommandsAssignee: Jacob Jenson <jacob>
Status: RESOLVED INVALID QA Contact:
Severity: 6 - No support contract    
Priority: --- CC: e.kawaschima+slurm, mattc
Version: 20.02.2   
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 Eisuke Kawashima 2020-06-14 23:40:25 MDT
Hi,

If a job is submitted under a directory whose path contains one or more percent `%` characters, sbatch without `--output` and `--error` options is successful and `slurm-%j.out` is created:

$ mkdir foo%%bar
$ cd foo%%bar
$ sbatch << EOF
#!/bin/bash
EOF
Submitted batch job 1
$ ls
slurm-1.out

However, a batch job immediately exits and stdout and stderr vanish if the options are specified:

$ sbatch --output=stdout --error=stderr << EOF
#!/bin/bash
sleep 10m
EOF
Submitted batch job 2
$ squeue | awk '$1 == 2'; : the job has ended
$ ls
slurm-1.out


Best
Comment 1 Eisuke Kawashima 2020-06-15 17:37:32 MDT
So, `%%` in the SLURM_SUBMIT_DIR is converted to `%`:

$ mkdir foo%bar foo%%bar
$ cd foo%%bar
$ sbatch --output=stdout.%j --error=stderr.%j << EOF
#!/bin/bash
EOF
Submitted batch job 3
$ ls
$ ls ../foo%bar
stderr.3 stdout.3

Best