---
title: Scheduled job failure
summary: Investigate missed, failing, or apparently successful jobs in the Platform Scheduler.
version: 1.0.0
type: runbooks
order: 2
badges:
  - content: Runbook
    backgroundColor: orange
    textColor: orange
---

## Trigger / Symptom & Blast Radius

A Quartz.NET job in [[service|scheduler-service]] misses its UTC schedule, appears paused or failed in Quartz Dashboard (`/quartz`), or reports success while [[service|catalog-ingestion]] makes no vector indexing progress. Blast radius is limited to scheduled background jobs (5-minute vector batching and 30-second heartbeat); transactional APIs and email notifications are unaffected.

<Admonition type="danger">
	Never edit [[container|catalog-database]] rows through [[container|scheduler-database]], and never
	copy connection strings or credentials into incident notes.
</Admonition>

## Pre-Flight Check

Verify [[service|scheduler-service]] container status, stream logs, and check pending vector queue depth in [[container|catalog-database]]:

```bash
az containerapp show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --query "properties.runningStatus" -o tsv
```

```sql
SELECT COUNT(*) AS pending_count, MIN(updated_at) AS oldest_updated_at FROM pending_vector_updates;
```

## Quick Recovery Procedure

<Steps>
<Step title="Verify Scheduler is running and inspect Quartz Dashboard">

In local Aspire runs, [[service|scheduler-service]] requires an explicit manual start in the Aspire Dashboard. In all environments, open `/quartz` (requires Entra ID `admin` role) and confirm triggers for `ProcessVectorBatchJob` (every 5 minutes UTC) and `HeartbeatJob` (every 30 seconds UTC) are in `NORMAL` state rather than `PAUSED`, `ERROR`, or `BLOCKED`.

</Step>
<Step title="Check Scheduler database and Kafka outbox">

If jobs fail with execution exceptions, inspect [[service|scheduler-service]] logs for [[container|scheduler-database]] or Kafka connectivity errors publishing [[event|ProcessVectorBatchIntegrationEvent]] to [[channel|scheduler.process-vector-batch]]:

```bash
az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 100
```

</Step>
<Step title="Verify downstream Catalog Ingestion if Scheduler succeeds">

A successful job run confirms only that the Kafka trigger was published. Check consumer lag on [[channel|scheduler.process-vector-batch]] and inspect [[service|catalog-ingestion]] logs for advisory lock contention, Microsoft Foundry embedding errors, or [[container|catalog-vector]] errors.

</Step>
<Step title="Restore dependencies and resume triggers">

Restore [[container|scheduler-database]], Kafka, or downstream [[service|catalog-ingestion]] dependencies. Resume any paused trigger in `/quartz` under approved change procedures and allow the next 5-minute cycle (or `FireOnceNow` catch-up) to drain the queue.

</Step>
</Steps>

## Verification

Confirm `HeartbeatTrigger` and `ProcessVectorBatchTrigger` show `Succeeded` runs in `/quartz` and `pending_count` in [[container|catalog-database]] trends toward `0`:

```sql
SELECT COUNT(*) AS pending_count FROM pending_vector_updates;
```

Expected output:

```text
 pending_count
---------------
             0
```

## Rollback / Escalation

- **Rollback:** Pause the affected trigger in `/quartz` if a downstream dependency is overwhelmed, then resume once healthy.
- **Escalation:** Escalate Scheduler, [[container|scheduler-database]], or Kafka issues to [[team|platform-engineering-team]]; escalate ingestion/embedding issues to [[team|platform-engineering-team]].

## Related documentation

- [[flow|product-ingestion]] — End-to-end scheduled vector ingestion flow.
- [[adr|adr-001-postgresql-quartz-persistence]] — Quartz persistence in [[container|scheduler-database]].
