Simple Uploader to S3 from file input component -- "Failed to Fetch" error

I'm trying to set up a simple resource query that uploads a file to an S3-compatible cloud storage service. I'm new to using S3 and I'm having trouble getting it set up.

The query is supposed to take a file input and put the file in an S3 bucket. Though the resource is communicating with the S3 storage ok, I'm getting a "failed to fetch" error when trying to put the file.

I know that a CORS policy issue is a common cause of these kinds of problems, but I don't have any other details from Retool or from the S3 storage except for the "failed to fetch" message in teh Retool console, so I don't know how to troubleshoot where the breakdown is occurring.

Is there any way to get more information about what the error is so that I can diagnose the issue?

Have you looked at Chrome Dev Tools? Check out the console there and it will tell you if you have a CORS issue and may provide other clues. It helped with a CORS issue with Google's version of S3. Add your results here and it may provide enough data to point you in the right direction.

Another good source of debugging is ChatGPT. It is not really useful for Retool specific things (but OpenAI did just update so maybe it can now?) but it can at least help with error like "I am getting this CORS error with the S3 API call, what do I do?"

1 Like