Grafana Error Guide: 'A dashboard with the same name already exists' — Resolve the Title Clash
Fix Grafana 'A dashboard with the same name in the folder already exists' errors on save and API import: use overwrite, set a stable uid, or rename to avoid folder title collisions.
- #grafana
- #observability
- #troubleshooting
- #errors
Stuck on this Grafana error? Get the free incident triage checklist
A one-page PDF — the exact steps to isolate, fix, and verify a production error like this one. No spam, unsubscribe anytime.
Overview
Grafana enforces unique dashboard titles within a folder. When you save or import a dashboard whose title already exists in the target folder — but with a different uid than the one on disk — Grafana rejects the write rather than silently overwriting the other dashboard:
A dashboard with the same name in the folder already exists
The HTTP API returns the same condition as a 412 Precondition Failed with a status body:
{"message":"A dashboard with the same name in the folder already exists","status":"name-exists"}
The defining symptom: the save/import fails with name-exists, an existing dashboard with that exact title already lives in the target folder, and the one you are pushing has no matching uid (or a different one).
Symptoms
- Saving a new dashboard shows
A dashboard with the same name in the folder already exists. - A CI/API import returns
412with"status":"name-exists". - Terraform or
grafana_dashboardapply fails on create with the same message. - Two dashboards were meant to be “the same” board across environments but push as duplicates.
- It appeared after cloning/duplicating a dashboard and keeping the original title.
Common Root Causes
- True title collision — a different dashboard already uses that exact title in the same folder, and Grafana blocks the duplicate.
- Missing or changed
uid— the JSON has nouid(or a new one), so Grafana treats it as a create, and the create collides with the existing title. overwritenot set — an intentional update via the API omits"overwrite": true, so Grafana refuses to replace the existing board.- Provisioning vs API race — a file-provisioned dashboard already owns the title, and an API push with a different
uidtries to add a second one. - Copy-paste duplicate — “Save As” kept the source title instead of a new one.
- Folder assumption wrong — the push targets the General/default folder where a same-named board already exists, not the folder you intended.
Diagnostic Workflow
First find the dashboard already holding the title, and read its uid — the correct fix depends on whether you meant to update it or create a genuinely new board:
# Search for the conflicting title and show its uid + folder
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"http://localhost:3000/api/search?query=Checkout%20Overview&type=dash-db" \
| jq -r '.[] | "\(.uid)\t\(.folderTitle)\t\(.title)"'
If you intend to update the existing board, reuse its uid and set overwrite:
# Update in place: same uid, overwrite true
curl -X POST http://localhost:3000/api/dashboards/db \
-H "Authorization: Bearer $GRAFANA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dashboard": { "uid": "checkout-overview", "title": "Checkout Overview", "schemaVersion": 39 },
"folderUid": "prod-services",
"overwrite": true
}'
If you intend a genuinely new board, give it a distinct title (and let Grafana assign a fresh uid):
curl -X POST http://localhost:3000/api/dashboards/db \
-H "Authorization: Bearer $GRAFANA_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"dashboard": { "title": "Checkout Overview (Canary)", "schemaVersion": 39 },
"folderUid": "prod-services",
"overwrite": false
}'
For file provisioning, pin a stable uid in the JSON so re-provisioning updates the same board instead of colliding, and confirm each file’s uid is unique across the provider path:
# provisioning/dashboards/services.yaml — one provider, a dedicated folder
apiVersion: 1
providers:
- name: services
folder: "Prod Services"
type: file
disableDeletion: false
allowUiUpdates: false # UI edits to provisioned boards cannot be saved anyway
options:
path: /var/lib/grafana/dashboards/services
# Ensure no two provisioned JSON files share a uid (a common cause of clashes)
grep -RhoE '"uid"\s*:\s*"[^"]+"' /var/lib/grafana/dashboards/services | sort | uniq -d
Example Root Cause Analysis
A CI pipeline that imported dashboards started failing with 412 {"status":"name-exists"} on the “Checkout Overview” board, even though the pipeline was meant to update it in place. Nothing about the dashboard content had changed.
Searching the API for the title returned one existing board with uid: checkout-overview in the Prod Services folder. Inspecting the JSON the pipeline pushed showed the uid field had been dropped during a jq transform step, so every run posted the board as a create with no uid. Grafana saw a create request for a title that already existed in the folder and refused it with name-exists.
Restoring the "uid": "checkout-overview" field and adding "overwrite": true to the request body made the import update the existing board cleanly. The lasting fix was to pin the uid in source control so the transform could never strip it, and the pipeline has imported idempotently since.
Prevention Best Practices
- Give every dashboard a stable, hand-chosen
uidin source control so imports update rather than create. - Use
"overwrite": trueonly for intended updates of a knownuid; never as a blanket flag that could clobber an unrelated board. - Keep titles unique within a folder by convention (prefix with team/service), and use folders to separate environments.
- In provisioning, verify no two JSON files share a
uidbefore deploy, and give each environment its own folder. - When duplicating a dashboard, rename it immediately so a “Save As” never inherits the source title.
Quick Command Reference
# Find the dashboard currently holding a title (uid + folder)
curl -s -H "Authorization: Bearer $GRAFANA_TOKEN" \
"http://localhost:3000/api/search?query=Checkout%20Overview&type=dash-db" \
| jq -r '.[] | "\(.uid)\t\(.folderTitle)\t\(.title)"'
# Update in place (same uid + overwrite)
curl -X POST http://localhost:3000/api/dashboards/db \
-H "Authorization: Bearer $GRAFANA_TOKEN" -H "Content-Type: application/json" \
-d '{"dashboard":{"uid":"checkout-overview","title":"Checkout Overview"},"folderUid":"prod-services","overwrite":true}'
# Detect duplicate uids across provisioned dashboard files
grep -RhoE '"uid"\s*:\s*"[^"]+"' /var/lib/grafana/dashboards | sort | uniq -d
Conclusion
A dashboard with the same name in the folder already exists is Grafana protecting you from silently clobbering a board: the title is taken and the dashboard you are pushing does not carry the matching uid. Decide intent first — search the API for who owns the title. To update, reuse that uid and set "overwrite": true; to create, pick a distinct title. Pin stable uids in source control and keep provisioned files free of duplicate uids, and the name-exists error disappears from your pipelines for good.
Fixed it? Get 500 Grafana & DevOps AI prompts — free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.
Did this fix your issue?
More Grafana prompts & error guides
Every Grafana AI prompt and troubleshooting guide, in one place.
Get 500 Battle-Tested DevOps AI Prompts — Free
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.