LGTM Enterprise 1.21.1

Fixing NO_SUITABLE_WORKER errors

Labeling worker daemons, and the jobs they analyze, provides a way of matching build/analysis jobs to suitable workers. For example, you can stipulate that jobs for one project are only processed by workers running on Windows, while jobs for Java must be processed by workers on which a specific build tool has been installed. A worker can only process a build/analysis job if it has been assigned all of the labels that have been assigned to the job. If a job is queued for processing but it has a set of labels that no currently running worker can match, then the job fails. It's removed from the job queue and a log entry is generated.

For more information about labeling, see Defining which workers can build and analyze a project.

Identifying jobs that failed due to labeling problems

When jobs fails due to labeling problems they are listed on the Logs page with the status "Returned From Queue (NO_SUITABLE_WORKER)":

A Labeling failures section is also added to the Worker management tab of the Infrastructure page.

Debugging labeling failures

  1. Go to the Jobs tab of the Logs page in the administration interface.
  2. Click the arrow button beside a job that failed because there was no suitable worker.
  3. If a job has been assigned any language-wide or project-level labels, these are listed in a Labels field in the Basic information section:

    This field is not displayed if the job has not been assigned any labels.

  4. Check that there are no mistakes in the labels.

    In the example above it's likely that dotnot4-7 should have been dotnet4-7 and windoows should have been windows.

  5. Review LGTM's cluster configuration file and check that the workers on at least one of the worker hosts are assigned all of the labels specified for each failing job.

    The cluster configuration file is <LGTM releases directory>/state/lgtm-cluster-config.yml—where <LGTM releases directory> is the directory into which the installation package for the current release was unpacked (for example, /home/adminuser/lgtm-releases/). For more information about the cluster configuration file, see lgtm-cluster-config.yml file.

  6. Go to the Infrastructure page in the administration interface and click the Worker management tab.
  7. Check that suitable workers for the failed jobs are currently running.

After you have corrected the problems that caused the jobs to fail, you can mark them as being available to be retried.

Retrying jobs that failed due to labeling problems

  1. Go to the Infrastructure page in the administration interface.
  2. Click the Worker management tab.
  3. Scroll down the page (if necessary) to the Labeling failures section.
  4. Click Retry.

    The failed jobs are scheduled for processing again.

    On a large LGTM Enterprise installation it may take several hours before the jobs are processed.

Related topicsRelated topics