Skip to content

PackageMetadataMalwareAdvisorySyncStalled

This playbook covers both alerts on the v3 package metadata sync:

AlertFires when
PackageMetadataMalwareAdvisorySyncStalledNo malware advisory registry has synced successfully in the last hour (12 runs)
SidekiqServicePackageMetadataV3SyncErrorSLOViolationToo many registry syncs fail, for any data type (malware advisories, licenses, advisories)

GitLab.com syncs malware advisories from the PMDB Distribution Service (PDS) into the pm_malware_advisories and pm_malware_affected_packages tables on the sec database. Dependency scanning and the dependency firewall read them to flag malicious packages.

  • PackageMetadata::MalwareAdvisoriesSyncWorker runs every 5 minutes, under an exclusive lease of 22 minutes.
  • Each run syncs every registry PDS serves (npm, pypi, gem, golang, maven, nuget, cargo), mostly with a single bulk /delta request. A registry with no checkpoint yet downloads the full /all snapshot first.
  • Each registry advances its own checkpoint in pm_checkpoints (on the main database), so a failed run resumes where it stopped.

When an alert fires, new malicious packages stop reaching GitLab.com. Customers keep the advisories already synced; nothing is lost, and the next successful run catches up.

What to do: find whether the worker is running at all, then why the syncs fail (see Troubleshooting).

Both alerts use the package_metadata_v3_sync application SLI, defined in metrics-catalog/gitlab-slis/library.libsonnet and attached to the sidekiq service in metrics-catalog/services/sidekiq.jsonnet. It is emitted by PackageMetadata::V3SyncService in GitLab Rails.

  • gitlab_sli_package_metadata_v3_sync_total{data_type}: one per registry per run, except a run with no instance token, which records a single error.
  • gitlab_sli_package_metadata_v3_sync_error_total{data_type}: the registries whose sync failed.

What counts:

  • Success: the registry ingested new data, was already up to date, or was stopped by the run’s time budget after advancing its checkpoint with every batch persisted (it resumes on the next run).
  • Error: PDS rejected or failed the request (a 400, a 5xx or a network error), the run had no instance token, the archive could not be read, or the records did not persist.
  • Not measured: registries PDS does not serve, and registries the run’s time budget stopped before their checkpoint moved or after a batch failed to persist (the next run reports that failure).

Thresholds:

  • PackageMetadataMalwareAdvisorySyncStalled counts successes (total minus errors) for data_type="malware_advisories" over 1 hour. Fewer than 0.5 for 10 minutes fires. This catches a sync that stopped running, which the error ratio cannot see because both counters stop. It evaluates in gprd only.
  • The error SLO is 1% (errorRatio: 0.99) with the standard multi-window burn-rate alerts, and the sample gate is lowered to 50 per window. A single failed bulk /delta request fails every registry in that run, so two failed runs within an hour is enough to burn the 1-hour window.

Under normal conditions, malware advisories record about 7 measurements per run (about 80 an hour) with an error ratio near 0. Most runs are delta_up_to_date: PDS has no new data for most registries most of the time. Over 30 days in November 2026, the longest stretch with no new advisories written was 13 hours, so “no new data” alone is normal; “no successful sync” is not.

  • Expected to be rare. Both alerts are s3: they go to #g_ast-composition-analysis-alerts and do not page.
  • The SLO alert is also generated for gstg and pre, like every Sidekiq SLI, so a staging PDS outage can fire it there. Only gprd alerts reach the team channel; non-production ones go to the shared non-production channel.
  • Silence PackageMetadataMalwareAdvisorySyncStalled during a planned PDS outage, for its duration only.
  • After a deploy that restarts Sidekiq, the counters restart at 0; increase() handles the reset.
  • Customer impact is delayed detection of new malicious packages for every GitLab.com customer using dependency scanning or the dependency firewall. Packages already flagged stay flagged.
  • Raise the severity if the sync has been stalled for more than a day, or if a widely reported malicious package is missing from GitLab.com.
  • Successes in the last hour (the stalled alert’s expression):

    sum by (env) (increase(gitlab_sli_package_metadata_v3_sync_total{env="gprd", data_type="malware_advisories"}[1h]))
    -
    sum by (env) (increase(gitlab_sli_package_metadata_v3_sync_error_total{env="gprd", data_type="malware_advisories"}[1h]))
  • Is the worker running? Job completions in the last hour:

    sum(increase(sidekiq_jobs_completion_count{env="gprd", worker="PackageMetadata::MalwareAdvisoriesSyncWorker"}[1h]))
  • Kibana: the malware advisory sync dashboard, https://log.gprd.gitlab.net/app/r/s/whjHw, built on json.event: "malware_advisory_sync" in the Sidekiq index.

  1. Is the worker running? Check job completions (query above), or in Kibana filter json.class: "PackageMetadata::MalwareAdvisoriesSyncWorker". About 288 runs a day is normal.
    • No jobs: check the Sidekiq cron (package_metadata_malware_advisories_sync_worker in ee/config/schedule.yml).
    • Jobs finish in under a second: another run holds the exclusive lease, logged as json.message: "Cannot obtain an exclusive lease. There must be another instance already in execution." with json.class_name: "PackageMetadata::MalwareAdvisoriesSyncWorker". A lease left behind by a killed job expires after 22 minutes.
  2. Why do registries fail? In Kibana, filter json.event: "malware_advisory_sync" and json.severity: "ERROR", then group by json.phase:
    • aborted_no_token: the instance token (IJWT) is missing. Check Cloud Connector.
    • bulk_delta_failed or fetch_rejected: PDS failed or rejected the request. Check the PDS alerts (PmdbDistSvcGke*) and its service overview.
    • purl_type_mismatch: an archive held another registry’s records, so that registry’s checkpoint did not advance.
    • No ERROR line: the sync raised, for example on an unreadable archive or a failed upsert. Filter json.class: "PackageMetadata::MalwareAdvisoriesSyncWorker" and json.job_status: "fail", read json.exception.class, and check Sentry.
  3. Which registries? Group the completed lines by json.purl_type to find a single registry that keeps failing.
  • PDS outage: wait for PDS to recover; the next run catches up from each checkpoint.
  • Stuck lease: wait for it to expire (22 minutes).
  • PMDB Distribution Service (pmdb-dist-svc) on Runway.
  • Cloud Connector, for the instance token sent to PDS.
  • The sec database (advisories) and the main database (pm_checkpoints).
  • #g_ast-composition-analysis for the sync, the data and PDS.