<@ULVA73B9P> The dashboard in prefect UI is not sh...
# marvin-ai
f
@Marvin The dashboard in prefect UI is not showing runs from previous days, even though there were actually present. Setup is prefect 2.20 with self hosted server. Help me debug this
m
thought for 217.0 seconds
A likely cause in Prefect 2.20 self-hosted is that the older UI/dashboard filters historical runs using
start_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:
Copy code
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:
Copy code
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:
Copy code
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:
Copy code
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:
Copy code
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.