Skip to content

Supabase Storage errorSupabase Storage: “The resource already exists” on upload

The resource already exists is the Supabase Storage error for an upload to a path that already holds a file. The error codes page lists it as ResourceAlreadyExists with HTTP 409, and the uploads guide calls it Asset Already Exists.

Short answer

Upload each new file to a unique path, for example with a UUID or timestamp in the name. If the app really should replace the file, pass upsert: true and add SELECT and UPDATE policies on storage.objects next to the INSERT policy.

Rather not fix it yourself? App Fix Ticket starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.

Why the upload collides, and the fix

  1. 01

    Every upload uses the same file name

    “When uploading a file to a path that already exists, the default behavior is to return a 400 Asset Already Exists error.” Supabase docs, Standard uploads (overwriting files)

    Names like avatar.png or the original file name collide on the second upload. Put a unique part in the path.

    const path = `${user.id}/${crypto.randomUUID()}.png`;
    const { data, error } = await supabase.storage
      .from('avatars')
      .upload(path, file);
  2. 02

    The app means to replace the file

    “Use x-upsert:true header to overwrite the resource.” Supabase docs, Storage error codes (ResourceAlreadyExists)

    For a profile photo that should overwrite the old one, pass upsert: true in the upload options.

    await supabase.storage
      .from('avatars')
      .upload(`${user.id}/avatar.png`, file, { upsert: true });
  3. 03

    upsert is on, but the policies only allow INSERT

    “To allow overwriting files using the upsert functionality you will need to additionally grant SELECT and UPDATE permissions.” Supabase docs, Storage access control

    Overwriting reads and updates the existing row in storage.objects, so an INSERT-only policy is not enough. Add SELECT and UPDATE policies with the same folder check.

  4. 04

    Users still see the old file

    “Uploading a file to a new path is the recommended way to avoid propagation delays and stale content.” Supabase docs, Standard uploads

    Also check: an overwritten file can stay cached at the edge for a while. A new path per version avoids stale images.

Checked against the vendor’s docs on : Supabase docs: Storage error codes; Supabase docs: Standard uploads; Supabase docs: Storage access control.

Rather hand it over?

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
A buyer in the United States, July 2022. Shopify on Fiverr
All 127 Fiverr reviews

Related: Supabase Storage invalid key · Supabase Storage bucket not found · Supabase Storage entity too large · Supabase Storage MIME type error

Questions

More on this error

Is it a 400 or a 409?

The Storage server returns 409 with the message The resource already exists, as the error codes page lists. The uploads guide still says 400 Asset Already Exists, so handle both in client code.

Should I delete the old file first instead?

Deleting and re-uploading needs a DELETE policy and leaves a moment with no file. upsert or a new path is simpler.

Can you fix it for me?

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

A different error?

Describe it and get a written quote

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.