'The scheduler failed to assign job to the runner, please try again or contact system administrator

I'm trying to deploy a gitlab instance and two runners in a different host. When I execute a pipeline from the GUI I have the message "The scheduler failed to assign job to the runner, please try again or contact system administrator" I have probed with two runners: a shell runner and a docker runner. The runner is well selected using the tags in yml file, but jobs are never executed Thanks for your support



Solution 1:[1]

in my case, our gitlab upgraded, this error only occur in one repository, I think this is a bug of gitlab, or when upgrading, the data of that repository is corrputed somehow.

Solution 2:[2]

In my case, I had these 2 variables in my CI yaml file

  # TF_VAR_task_cpu: 256
  # TF_VAR_task_memory: 512

removing them solved the issue Runner version: gitlab-runner 14.0.1

Solution 3:[3]

The issue seems to be due to variables used within rules. Below is the error case observed:

rules :
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
  variables:
    PROJECT_ID: 26

Fix - updated the variable assignment with quotes (for PROJECT_ID)

rules :
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
  variables:
    PROJECT_ID: "26"

Solution 4:[4]

You can do that with a simple str_replace() in a loop over $api_path_templates

$user =
  [
      'id'        => 20,
      'name'      => 'John Dow',
      'role'      => 'QA',
      'salary'    => 100
  ];

$api_path_templates =
  [
      "/api/items/%id%/%name%",
      "/api/items/%id%/%role%",
      "/api/items/%id%/%salary%"
  ];

foreach ( $api_path_templates as $k=>&$a){
    $a = str_replace('%id%', $user['id'], $a);
    $a = str_replace('%name%', $user['name'], $a);
    $a = str_replace('%role%', $user['role'], $a);
    $a = str_replace('%salary%', $user['salary'], $a);
}
print_r($api_path_templates);

RESULT

Array
(
    [0] => /api/items/20/John Dow
    [1] => /api/items/20/QA
    [2] => /api/items/20/100
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Slava Rozhnev
Solution 3 Rama Krishna
Solution 4 RiggsFolly