Skip to content

Retrying jobs tries to check out tag, resulting in a failure

Summary

When retrying a job, the checkout steps attempts to checkout a tag rather than checking out the hash, causing the retry to fail.

Steps to reproduce

Retry a job. It can be a passed or failed job

Example Project

Example repo: https://gitlab.com/Tysmith17/retry-bug-repo/-/tree/task/repo_bug

Job passing the first time: https://gitlab.com/Tysmith17/retry-bug-repo/-/jobs/1570660403

Job failed when retrying and attempts to check out tag https://gitlab.com/Tysmith17/retry-bug-repo/-/jobs/1570661373

What is the current bug behavior?

Job tries to check out a tag that doesnt exist

What is the expected correct behavior?

Job should check out in the same fashion as the first attempt and run.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

N/A

Results of GitLab application Check

N/A

Possible fixes

checking the graphql endpoint for the pipeline with the following:

  project(fullPath: "Tysmith17/retry-bug-repo") {
    pipeline(iid: 3){
      jobs(first: 2, after: $after) {
        edges{
          node {
            triggered
            manualJob
            schedulingType
            name
            tags
            retryable
            createdByTag
            refName
            refPath
            playable
            startedAt
          }
        }
      }
    }
  }
}

gives:

  "data": {
    "project": {
      "pipeline": {
        "jobs": {
          "edges": [
            {
              "node": {
                "triggered": null,
                "manualJob": false,
                "schedulingType": "stage",
                "name": "Sleep 20",
                "tags": [],
                "retryable": true,
                "createdByTag": true,
                "refName": "refs/merge-requests/1/head",
                "refPath": "/Tysmith17/retry-bug-repo/-/commits/refs/merge-requests/1/head",
                "playable": false
              }
            },
            {
              "node": {
                "triggered": null,
                "manualJob": false,
                "schedulingType": "stage",
                "name": "Sleep 20",
                "tags": [],
                "retryable": false,
                "createdByTag": false,
                "refName": "refs/merge-requests/1/head",
                "refPath": "/Tysmith17/retry-bug-repo/-/commits/refs/merge-requests/1/head",
                "playable": false
              }
            }
          ]
        }
      }
    }
  }
}

it seems the re-run of the job has "createdByTag": true where the first one doesnt which could be the problem.

Edited by Tyler Winters