...
Jobs which use the JobScheduler API Interface may implement more sophisticated methods to choose whether an error is blamed on the job or on the order and how to handle errors that occur in orders.
Logging and Handling of Errors
Behavior up to and including Version 1.9
Display feature availability |
---|
|
When a shell script is executed within a job and when this script writes messages to the standard output and error channels (stdout and stderr) then the JobScheduler treats these as info messages.
- Logging:
- the JobScheduler writes these messages to the task's log with severity "info", e.g.
2015-03-18 07:57:38.991+0100 [info] This message goes to stdout
2015-03-18 07:57:38.993+0100 [info] This message goes to stderr
- The user cannot decide from the log if output from the shell script has been written to stdout or to stderr.
- Error Handling:
- the JobScheduler handles the script execution as being successful if the exit code returned by the script is 0.
Behavior with Version 1.10 and newer
Display feature availability |
---|
|
Job error handling can optionally be extended to detect errors from output that is created by shell scripts.
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JS-1393 |
---|
|
Jira |
---|
server | SOS JIRA |
---|
columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
key | JS-1329 |
---|
|
Behavior
- Logging:
- Error Handling:
- The JobScheduler raises an error for any output to stderr from the shell script. This behavior extents JS-1393 that identfies the output channel that has been used.
- Depending on the job settings and the job node settings the usual behavior for failed execution would apply, e.g. the job could be stopped, the order could be suspended, setback, etc.
Note that:
- This option applies to shell jobs, not to API jobs.
- It applies to jobs executed by JobScheduler instances, including clustered instances, and to JobScheduler Agents. An Agent forwards errors to the JobScheduler Master.
Configuration
- Error handling for shell jobs is configured with the
<job stderr_log_level="error|info">
job attribute.- A value
error
causes shell job output to stderr to be considered by JobScheduler as errors. - The default value is
info
and causes the JobScheduler not to raise an error.
Change Management References
Jira |
---|
server | SOS JIRA |
---|
columns | type,key,issuelinks,fixversions,status,priority,summary,updated |
---|
maximumIssues | 20 |
---|
jqlQuery | labels in (error-handling) and labels in (shell-script) |
---|
serverId | 6dc67751-9d67-34cd-985b-194a8cdc9602 |
---|
|