Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 43,814
    • Issues 43,814
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,393
    • Merge requests 1,393
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #33552
Closed
Open
Created Oct 07, 2019 by Nourdin el Bacha@nelbachaDeveloper

Returning reason for failed job in API response

Release Notes

When you have setup your .gitlab-ci.yml to retry failed jobs and they exceed that number it can be hard to gather data about why those jobs are failing from the API.

Now you can see the failure_reason of a job in the Jobs API to more easily gather data about jobs that are failing.

Problem to solve

Currently you can specify in .gitlab-ci.yml when a job needs to be retried based on the condition of why the job failed, by specifying values for when.

When you look at a failed job via the API, it doesn't state why it failed, e.g. script_failure.

Thank you @albert.vacacintora for this contribution!

Further details

In the response from an API call to retrieve details from a failed job, it would be beneficial if the response includes the reason for failure, such as:

  • unknown_failure
  • script_failure
  • api_failure
  • stuck_or_timeout_failure
  • runner_system_failure
  • missing_dependency_failure
  • runner_unsupported

Links / references

ZD#134393(GitLab internal)

Edited Dec 03, 2021 by James Heimbuck
Assignee
Assign to
Time tracking