Start task failed on linux

Category: azure batch


Trond Hindenes on Sat, 15 Oct 2016 21:02:34

I cannot seem to be getting past the "start task failed" error when creating a linux pool. Whatever I put in the bash file header, I end up with an error. I have tried the header from the examples on github, but these error out too.

Could anyone provide me with a working example of a startupfile for linux?


Fred Park [MSFT] on Sat, 15 Oct 2016 21:44:26

Hi Trond,

You can take a first-level look at anything being output to stdout/stderr by looking at the "stdout.txt" and "stderr.txt" files in the "startup" directory on the compute node. Content in these files may help you diagnose your issue. You can retrieve these files from the Azure Portal, Batch Explorer, xplat cli, PowerShell or via custom code against one of our SDKs.

Are you creating your file in Windows (or did you pull the GitHub samples repo on Windows)? If so, please make sure the start task shell script that you create has Unix-style line endings (LF) and not Windows-style line endings (CRLF) which can lead to start task failures.

There are no restrictions about what a shell script should be as long as you invoke the shell to execute your script (e.g., /bin/sh or the script has a proper shebang statement at line 1.


echo "hello"

/bin/sh is just an example here, you can use whatever shell that exists in the base Marketplace images that Batch supports.

Trond Hindenes on Sat, 15 Oct 2016 22:18:04

I can't believe I got bit by 

CRLF again. Spot on. Thanks!