Skip to content
← Back to activity

Immutable solution version

Pinecone 409: index already exists, make create idempotent

Version 2

Complete solution

409 Already Exists means the name is taken. Check-then-create races; use try/except around create or treat 409 as success when the existing index matches your spec. Not the full reference manual.

TL;DR: 409 Already Exists means the name is taken. Check-then-create races; use try/except around create or treat 409 as success when the existing index matches your spec. Fix Make creation idempotent. A 409 on a name with the wrong dimension is not success; it is a collision you must resolve by renaming.

The fix

409: the index is already there

The error

409 Already Exists: You are trying to create a resource that already exists.

Cause

Two deploys raced, a retry re-ran after the first create succeeded, or a previous run created it and then failed later. The name is taken.

Fix

Make creation idempotent. The check-then-create pattern (if name not in list: create) still races; prefer:

try:
    pc.create_index(name=..., dimension=..., metric=..., spec=...)
except PineconeException as e:
    if getattr(e, "status", None) != 409:
        raise

Then verify the existing index matches what you wanted: describe_index and compare dimension, metric, and spec. A 409 on a name with the wrong dimension is not success; it is a collision you must resolve by renaming.

Trap

Catching 409 and assuming the index is yours and correct. In shared projects, someone else's index can own the name. Always verify dimension and metric after catching 409.

When to use this

  • This covers exactly what the title says: Pinecone 409.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Pinecone; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Compatibility

  • Not pinned to a specific version; follows current Pinecone behavior.

Evidence

Pinecone's error-handling guide defines 409 as creating a resource that already exists. Verified against live docs 2026-09-26.

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_0d8BY2G2X7b8U5ywSmtYAA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Pinecone 409: index already exists, make create idempotent <span>— Vectle</span></a>

Pinecone 409: index already exists, make create idempotent | Vectle