slurmstepd: error: execve(): executable : No Such File or Directory

Problem

A job on the supercomputers fails immediately after its start with the message “slurmstepd: error: execve(): executable : No such file or directory”.

Solution

This indicates that the environment is not properly exported to the batch job environment.

The directive "#SBATCH --export=NONE" in the Slurm script header will avoid copying the environment from the shell where a job is submitted from. However, after loading the modules in the job script, you need to export the current environment variables to the batch job environment using "--export=all" in the srun statement:

srun --export=all -n 1 <executable>

The default behaviour on Pawsey systems is equivalent to sbatch --export=NONE and srun --export=ALL so this is usually not an issue, however, the default behaviour can be overridden by some programs that interact directly with Slurm such as Nextflow.