Uploaded image for project: 'JS - JobScheduler'
  1. JS - JobScheduler
  2. JS-1734

Error handling for jobs with job chains on Agents should work

    XMLWordPrintable

Details

    Description

      Current Situation

      • When using a PowerShell job in a job chain then error handling does not work if the job is configured to fail in case of output being written to stderr by <job stderr_log_level="error"/>. The same behavior applies to shell jobs that are executed with Agents.
      • Consider the attached sample job chain from the JS-1734.zip archive
        • the job in the first node will raise an error
          • the job is configured for stderr_log_level="error"
      • When running the attached sample job chain then
        • an order will not leave the job chain with the "error" node but with the "success" node.
        • the order log shows the following output:
          2017-10-12 09:53:35.489+0200 [info]   
          2017-10-12 09:53:35.489+0200 [info]   Order powershell_order - Protocol starts in C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/order.JS-1734,powershell_chain.powershell_order.log
          2017-10-12 09:53:13.792+0200 [info]   SCHEDULER-893  Standing_order is 'active' now
          2017-10-12 09:53:35.505+0200 [info]   (Task JS-1734/powershell_job1:431) SCHEDULER-842  Task is going to process Order JS-1734/powershell_chain:powershell_order, state=run1, on JobScheduler 'http://apmacwin:40444'
          2017-10-12 09:53:35.505+0200 [info]   (Task JS-1734/powershell_job1:431) 
          2017-10-12 09:53:35.505+0200 [info]   (Task JS-1734/powershell_job1:431) Task JS-1734/powershell_job1:431 - Protocol starts in C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/task.JS-1734,powershell_job1.log
          2017-10-12 09:53:35.651+0200 [info]   (Task JS-1734/powershell_job1:431) SCHEDULER-726  Task runs on remote scheduler http://localhost:4445
          2017-10-12 09:53:35.651+0200 [info]   (Task JS-1734/powershell_job1:431) SCHEDULER-918  state=starting (at=never)
          2017-10-12 09:53:41.264+0200 [info]   (Task JS-1734/powershell_job1:431) hello world
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431) 
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431) echo "hello world"
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431) 
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431) write-error "an error occurred"
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431)          : an error occurred
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431)     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431)     + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
          2017-10-12 09:53:41.583+0200 [ERROR]  (Task JS-1734/powershell_job1:431)  
          2017-10-12 09:53:41.590+0200 [info]   (Task JS-1734/powershell_job1:431) SCHEDULER-843  Task has ended processing of Order JS-1734/powershell_chain:powershell_order, state=run1, on JobScheduler 'http://apmacwin:40444'
          2017-10-12 09:53:41.590+0200 [info]   set_state success
          2017-10-12 09:53:41.598+0200 [info]   SCHEDULER-944  End state reached - order will be repeated at 2038-01-19 03:14:07.000Z with state=run1
          2017-10-12 09:53:41.598+0200 [info]   SCHEDULER-962  Protocol ends in C:/ProgramData/sos-berlin.com/jobscheduler/apmacwin_4444/logs/order.JS-1734,powershell_chain.powershell_order.log
          

      Desired Behavior

      • Error handling should work for jobs with Agents that use <job stderr_log_level="error"/> in the same way as for jobs with a Master.

      Attachments

        Activity

          People

            jz Joacim Zschimmer
            ap Andreas Püschel
            Robert Ehrlich Robert Ehrlich
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: