When debugging scripts you need to consider the process used to submit the job. First a script is accessed and expanded to create the job file. This job file is then submitted to the relevant system where it is run, possibly via a queuing system. Errors can occur at any of these steps.