© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
82 replies
von Schappler

Buckets storage randomly uploading files with 0 data

Hello there!
I am having s small problem that I am been unable to solve.

As for YESTERDAY, while using supabase buckets, all images uploads were fine...
Today, when working back into my application, the same images i had used before for testing are now returning empty data.

Nothing was changed regarding the code to affect / cause this behavior.
Also this happens randomly, with random images.

I would appreciate any feedback over this when possible. Below there is the code snippet used (without changes) - remember that this code WAS WORKING YESTERDAY and its NOT TODAY.

  if (files) {
    // username and slug are existing values in code.
    bucket = `${username}/${slug}`;

    await files.forEach(async (file, i) => {
      const imageFilename = `${name}-${i}-${Math.random()}`;
      const imageURL = `${supabaseUrl}/storage/v1/object/public/${stylistBucket}/${imageFilename}`;
      images.push(imageURL);

      const { error: imageUploadError } = await sbAdmin.storage
        .from(stylistBucket)
        .upload(imageFilename, file, {
          cacheControl: "3600", // tried also removing these options but no changes were noticable in this strange behavior
          upsert: false,
          });

      if (imageUploadError) {
        console.error(imageUploadError);
        throw new Error(imageUploadError)
    });
  }
  // everything was working well until yesterday with this same code.
  if (files) {
    // username and slug are existing values in code.
    bucket = `${username}/${slug}`;

    await files.forEach(async (file, i) => {
      const imageFilename = `${name}-${i}-${Math.random()}`;
      const imageURL = `${supabaseUrl}/storage/v1/object/public/${stylistBucket}/${imageFilename}`;
      images.push(imageURL);

      const { error: imageUploadError } = await sbAdmin.storage
        .from(stylistBucket)
        .upload(imageFilename, file, {
          cacheControl: "3600", // tried also removing these options but no changes were noticable in this strange behavior
          upsert: false,
          });

      if (imageUploadError) {
        console.error(imageUploadError);
        throw new Error(imageUploadError)
    });
  }
  // everything was working well until yesterday with this same code.
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements
Next page

Similar Threads

storage buckets
SupabaseSSupabase / help-and-questions
2mo ago
Storage Buckets
SupabaseSSupabase / help-and-questions
3y ago
Script out storage buckets
SupabaseSSupabase / help-and-questions
4y ago
Creating storage buckets by code (with migrations or config) and seeding files
SupabaseSSupabase / help-and-questions
3mo ago