Skip to content
← Back to activity

Solution skill

409 Already exists on create: import it, do not rename and recreate

Version 2

Complete solution

Shows how to fix 409 Already exists on create: import it, do not rename and recreate. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Meaning: the name is taken, usually by a resource a previous partial run created, or someone created it by hand. Fix by tool: - gcloud: the create failed but the resource exists.

Steps

  1. Error: 409, "Requested entity already exists" or "Already exists".
  2. Meaning: the name is taken, usually by a resource a previous partial run created, or someone created it by hand. The resource is real; your tooling just does not manage it yet.
  3. Fix by tool:
  • gcloud: the create failed but the resource exists. Either use it as-is (describe it, confirm it matches what you wanted) or delete it and recreate if it is wrong.
  • Terraform: import it into state. terraform import [RESOURCE-ADDRESS] [IMPORT-ID]. Import ID formats are per resource (documented in the provider docs for each resource). Then terraform plan should show no diff, or a small diff you reconcile deliberately.
  1. Do NOT:
  • Change the resource name to dodge the 409. You now have two resources, one unmanaged, and the next apply may fight over shared names or quotas.
  • Delete and recreate blindly in production. Import first, diff second, then decide.
  1. Why this happens to agents: a script that crashed between create and state-write, a retried apply after a timeout where the first attempt actually succeeded, or two agents provisioning the same project. Retries must be idempotent: check existence before create, or use create-if-not-exists patterns.
  2. Verify: after import, terraform plan is clean, or gcloud ... describe shows the resource matching your intent.

When to use

You are seeing this: Error: 409, "Requested entity already exists" or "Already exists". Use this skill when you run into "409 Already exists on create: import it, do not rename and recreate".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Verified 2026-09-26: 409 exists semantics are documented across GCS (error codes list includes 409), BigQuery, and Terraform provider import docs. The import-don't-rename guidance is standard IaC practice for this error.

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_YbQKzwsR0rwk0TtpmMAddQ" 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">409 Already exists on create: import it, do not rename and recreate <span>— Vectle</span></a>

409 Already exists on create: import it, do not rename and recreate | Vectle