DORA Dashboard SQL Bug — Double-Quoted String Literals
Status: Upstream bug in apache/incubator-devlake v1.0.3-beta12 / v1.0.4-alpha. Affects all DORA panels in the official dashboard JSON exports.
Discovered: 2026-06-10, after fixing the DevLake datasource in Grafana.
Severity: Low (cosmetic). DORA dashboards never render — every panel shows the error message instead of numbers. No data loss; numbers are correct in the underlying database.
Symptom
When the DORA datasource is correctly configured (database = lake, password valid), the dashboards still fail with:
db query error: Error 1054 (42S22): Unknown column 'N/A. Please check if you have collected deployments.' in 'field list'
This error appears in the affected panels:
| Dashboard | Panel ID | Title |
|---|---|---|
dfo090rqoyl8ge (DORA) | 8 | Overall DORA Metrics |
dfo090rqoyl8ge (DORA) | 11 | Deployment Frequency |
dfo090rqoyl8ge (DORA) | 12 | Median Lead Time for Changes In Hours |
dfo090rqoyl8ge (DORA) | 14 | Change Failure Rate |
dfo090rqoyl8ge (DORA) | 17 | Failed Deployment Recovery Time |
The DORA (by Team) and the DORA Details dashboards have similar bugs in their SQL.
Root cause
The panel SQL has CASE / ELSE branches that return string literals using MySQL double-quote syntax:
ELSE "N/A. Please check if you have collected deployments." END
In MySQL, double-quoted identifiers are column names, not string literals. So MySQL’s parser tries to resolve "N/A. Please check if you have collected deployments." as a column name, doesn’t find it, and fails at parse time (not runtime — so the WHEN conditions never get a chance to match).
The correct MySQL syntax would be:
ELSE 'N/A. Please check if you have collected deployments.' END
(single-quoted string literal).
The bug is widespread in the dashboard SQL. The full grep returns ~14 occurrences across the DORA dashboard family:
$ grep -n '"N/A' /tmp/dora_panel11.sql
127: ELSE "N/A. Please check if you have collected deployments." END
134: ELSE "N/A. Please check if you have collected deployments." END
$ grep -n '"N/A' /tmp/dora_overall.sql
264: ELSE "N/A. Please check if you have collected deployments."
272: ELSE "N/A. Please check if you have collected deployments."
327: ELSE "N/A. Please check if you have collected deployments/pull_requests."
334: ELSE "N/A. Please check if you have collected deployments/pull_requests."
409: WHEN is_collected = "No All" THEN "N/A. Please check if you have collected deployments/incidents."
411: WHEN is_collected = "No Deployments" THEN "N/A. Please check if you have collected deployments."
416: ELSE "N/A. Please check if you have collected deployments/incidents."
419: WHEN is_collected = "No All" THEN "N/A. Please check if you have collected deployments/incidents."
421: WHEN is_collected = "No Deployments" THEN "N/A. Please check if you have collected deployments."
426: ELSE "N/A. Please check if you have collected deployments/incidents."
481: "Failed deployment recovery time" as metric,
488: ELSE "N/A. Please check if you have collected deployments or incidents."
Workaround (local fix in Grafana)
Until upstream fixes the bug, the workaround is to patch the dashboard JSON in Grafana. We can’t directly PUT the dashboard via API without an Editor-role token, so the fix has to be applied through the UI:
- In Grafana, open the affected dashboard → Settings (gear icon, top right) → JSON model
- Search for the patterns below and replace:
ELSE "N/A.→ELSE 'N/A.WHEN is_collected = "No→WHEN is_collected = 'NoWHEN count(deployment_id) is null then "No All"→WHEN count(deployment_id) is null then 'No All'
- Save the dashboard
- Refresh the page — the panels should now show real numbers
For an automated fix via API (when you have an Editor token), the JSON dump + sed works:
# Export dashboard JSON
curl -H "Authorization: Bearer $TOKEN" \
https://public-grafana-hh-production.f.aivencloud.com/api/dashboards/uid/dfo090rqoyl8ge > /tmp/dora.json
# Patch the SQL inside the targets
python3 -c "
import json
d = json.load(open('/tmp/dora.json'))
def patch(s):
# The fix: replace the unquoted literal with a properly-quoted one
return s.replace('ELSE \"N/A.', \"ELSE 'N/A.\") \
.replace('WHEN is_collected = \"No', \"WHEN is_collected = 'No\") \
.replace('when count(deployment_id) is null then \"No All\"', \"when count(deployment_id) is null then 'No All'\")
for p in d['dashboard'].get('panels', []):
for t in p.get('targets', []):
if t.get('rawSql'):
t['rawSql'] = patch(t['rawSql'])
json.dump(d, open('/tmp/dora_patched.json', 'w'), indent=2)
"
# Re-upload via Grafana UI (paste the patched JSON)
Permanent fix (upstream)
A PR to apache/incubator-devlake should:
- Fix all
ELSE "N/A. ..."patterns in the DORA dashboard JSON exports to use single quotes - Add a smoke test in CI that imports the dashboards into a test Grafana and asserts they render (not just that the datasource is OK)
- The dashboards should ship with a
graphTooltipof “See DevLake docs if data is missing” so users know the dashboards are working as designed
Related
- Postmortem:
DevLake_Incident_2026-06-04_GraphQL_Regression.md— fifth follow-on section - Runbook:
DevLake_Runbook.md - Architecture:
DevLake_Architecture_and_Operations.md - Grafana setup:
Grafana_DevLake_Datasource_Setup.md