Chroma "Collection Already Exists" UniqueConstraintError

Share
Workaround available Python, JavaScript, Docker Updated November 15, 2026Based on 2 user reportsHow we research

Quick answer

create_collection fails if the name is taken. Use get_or_create_collection.

Most likely fix: Use get_or_create_collection

How to fix it

Try these in order — the most common fix is first.

  1. 1. Use get_or_create_collection

    1. Replace create_collection(name) with get_or_create_collection(name)
    2. Or call delete_collection(name) first if you want a clean start
    Did this fix it?

Symptoms

UniqueConstraintError: Collection my_collection already exists.

Why it happens

  • Script re-run with create_collection
  • Persistent data from an earlier run

This guide also covers

  • chromadb collection already exists
  • UniqueConstraintError chroma

Still not working?

If Chroma keeps failing, you're not alone. See every Chroma problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us
Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Chroma errors

All 11 Chroma errors and fixes →