locked
Azure Batch Job application exit code -2146232576 (no std outputs) RRS feed

  • Question

  • Hello,

    I'm having many troubles trying to port my distributed application to Azure Batch. Certainly the lack of documentation is killing me, and this forum is my only path to success :)

    This is a hard one: My JobManager (and all tasks) work perfectly when I launch it locally on my machine with this shell command (running over a previous created WorkItem):

    MyCloudApp.exe -JobManagerTask

    But it doesn't work when I create the WorkItem from the desktop app I'm developing with the purpose of launching the jobs.

    Using the "Batch Explorer" app I can see that in both cases the JobManagerTasks have been submitted, but on the case that doesn't work (newly created WorkItem) the JobManagerTask ends with the exit code -2146232576.

    Being said that, I cannot see neither the stdout nor the stderr of any of my azure batch jobs. In both cases, stderr.txt and stdout.txt files shown on the Outputs tab are blank (0 bytes). That makes it extremely hard to debug.

    Thank you!

    Wednesday, December 10, 2014 4:45 PM

Answers

  • Some thoughts when debugging tasks and JobManagers:

    If ICloudTask.TaskExecutionInformation is not null and TaskExecutionInformation.ExitCode is not null then we know that the system actually attempted to run the task/jm.

    If the task/jm runs in other contexts (i.e.: locally) then areas to look include:

    1: Does the ResourceFile collection actually include a mapping for the task/jm executable image

    2: List files on the VM to confirm that the executable image exists and is where it should be

    If the executable image is observed correctly on the VM then it is time to log on to the instance by creating a user account and fetching the RDP file.

    From the "Batch Explorer" creating users and getting RDP files is done via context menu on the VM.

    From the object model use

        IVM/IPoolManager: CreateUser(), User.Commit(), GetRDPFile    

    Once logged on to the VM the executable image can be run manually and any failures diagnosed.

    It is important to note that Azure Batch sets a bunch of environment variables when it launches the task/jm.  If these are important they may need to be set by hand.

    When the task/jm is run by hand it is common to discover missing assemblies and/or versions of the .net framework.  The Azure Batch object model currently requires at least .net version 4.5.


    daryl

    • Marked as answer by tmotion Friday, December 12, 2014 4:05 PM
    Wednesday, December 10, 2014 8:59 PM

All replies

  • Some thoughts when debugging tasks and JobManagers:

    If ICloudTask.TaskExecutionInformation is not null and TaskExecutionInformation.ExitCode is not null then we know that the system actually attempted to run the task/jm.

    If the task/jm runs in other contexts (i.e.: locally) then areas to look include:

    1: Does the ResourceFile collection actually include a mapping for the task/jm executable image

    2: List files on the VM to confirm that the executable image exists and is where it should be

    If the executable image is observed correctly on the VM then it is time to log on to the instance by creating a user account and fetching the RDP file.

    From the "Batch Explorer" creating users and getting RDP files is done via context menu on the VM.

    From the object model use

        IVM/IPoolManager: CreateUser(), User.Commit(), GetRDPFile    

    Once logged on to the VM the executable image can be run manually and any failures diagnosed.

    It is important to note that Azure Batch sets a bunch of environment variables when it launches the task/jm.  If these are important they may need to be set by hand.

    When the task/jm is run by hand it is common to discover missing assemblies and/or versions of the .net framework.  The Azure Batch object model currently requires at least .net version 4.5.


    daryl

    • Marked as answer by tmotion Friday, December 12, 2014 4:05 PM
    Wednesday, December 10, 2014 8:59 PM
  • Hi TMotion,

    You said:

    Hello,

    I'm having many troubles trying to port my distributed application to Azure Batch. Certainly the lack of documentation is killing me, and this forum is my only path to success :)


    Have you looked at:

    http://azure.microsoft.com/en-us/documentation/services/batch/

    Or more specifically:

    Azure Batch API Documentation

    Azure Batch API Basics

    We are continually working on improving our documentation experience, so if you have looked at the above for documentation and it is still lacking, what areas have you had trouble with and we can work to add documentation in those areas.

    Thanks,

    -Matt

    Wednesday, December 10, 2014 10:23 PM
  • Thank you Daryl,

    Finally I figured it out connecting to the VM using GetRDPFile. Launching the application using a command shell I saw that the app was compiled for .NET Framework 4.5.1, which wasn't installed on the VM.

    After a couple of extra tweaks now my batch app runs perfectly, which I'm very proud of :)

    Best,

    Victor

    Friday, December 12, 2014 4:03 PM
  • Hi Matt,

    The documentation is pretty good, but the things that I missed the most are all debug-related.

    For example I didn't know that you guys had the "Batch Explorer" application which certainly made my life way easier. And I didn't know as well that I could log in to the virtual machine using RDP, so certainly a couple of blog posts describing this two debug tricks would make a lot of people happy :)

    My two cents,

    Victor

    Friday, December 12, 2014 4:05 PM