Ferchau Gupta
06/26/2026, 11:14 AMMarvin
06/26/2026, 11:14 AMMarvin
06/26/2026, 11:18 AMstart_time instead of expected_start_time.
That means runs can exist in the DB/API, but still not appear in the dashboard if they were:
- scheduled but not picked up yet
- marked Late
- pending/queued for a while
- otherwise missing start_time
This is more of a Prefect 2.x UI behavior/bug than actual data loss.
First things to check
1. Do the runs exist via the API?
2. Do those missing runs have start_time = null but expected_start_time populated?
3. Are you using SQLite or Postgres for the self-hosted server? SQLite can make UI queries much worse on larger datasets.
4. Is this affecting all old runs, or only some states like Scheduled/Late?
Quick API test
If your server is at http://<host>:4200, try:
bash
curl -X POST http://<host>:4200/api/flow_runs/filter \
-H "Content-Type: application/json" \
-d '{
"flow_runs": {
"expected_start_time": {
"after_": "2024-01-01T00:00:00Z",
"before_": "2024-01-02T00:00:00Z"
}
},
"sort": "EXPECTED_START_TIME_DESC",
"limit": 100
}'
Then compare with:
bash
curl -X POST http://<host>:4200/api/flow_runs/filter \
-H "Content-Type: application/json" \
-d '{
"flow_runs": {
"start_time": {
"after_": "2024-01-01T00:00:00Z",
"before_": "2024-01-02T00:00:00Z"
}
},
"sort": "START_TIME_DESC",
"limit": 100
}'
If the first returns runs and the second does not, that strongly points to this UI/dashboard filtering issue.
DB checks
For Postgres:
sql
SELECT COUNT(*), state_type, state_name
FROM flow_run
WHERE expected_start_time >= '2024-01-01'
AND expected_start_time < '2024-01-02'
GROUP BY state_type, state_name
ORDER BY 1 DESC;
Check for runs with no actual start time:
sql
SELECT COUNT(*)
FROM flow_run
WHERE start_time IS NULL
AND expected_start_time >= '2024-01-01'
AND expected_start_time < '2024-01-02';
If you want examples:
sql
SELECT id, name, state_name, expected_start_time, start_time, end_time
FROM flow_run
WHERE expected_start_time >= '2024-01-01'
AND expected_start_time < '2024-01-02'
ORDER BY expected_start_time DESC
LIMIT 20;
Other things to verify
- Timezone mismatch: UI/browser timezone vs server UTC can make “previous day” filters look wrong near day boundaries.
- Late runs: runs marked Late often still have start_time = NULL.
- Database size/performance: on self-hosted 2.x, especially with SQLite, older dashboard queries can become slow or incomplete.
- Logs: check server logs for query timeouts/errors when loading the dashboard.
Useful next step
Tell me:
1. whether you use Postgres or SQLite
2. whether the missing runs are completed runs or mostly scheduled/late/pending
3. what exact page in the UI is affected (Dashboard, flow run list, deployment run history, etc.)
If you want, I can help you build a step-by-step debug checklist for your exact setup, or help interpret the output of your API/SQL checks.