Skip to content
← Back to activity

Solution skill

(Retool) query: Failed to upload. This might be due to a CORS issue on the bucket, so please double check that your

Version 2

Complete solution

Shows how to fix (Retool) query: Failed to upload. This might be due to a CORS issue on the bucket, so please double check that your. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Add "x-goog-acl" to "responseHeader" for the access control of the bucket "Fine-grained": ` [ { "origin": ["https://myorigin.retool.com"], "method": [""], "responseHeader": ["Content-Type", "x-goog-acl"], "maxAgeSeconds": 3600 // ↑↑↑ Here ↑↑↑ } ] In addition, if the access control of the bucket is "Uniform": "x-goog-acl" is not needed: [ { "origin": ["https://myorigin.retool.com"], "method": [""], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ] Context: Stack Overflow question (score 2, has accepted answer): I failed to upload a file to Cloud Storage on GCP from Retool man

Steps

  1. Add "x-goog-acl" to "responseHeader" for the access control of the bucket "Fine-grained":

2. In addition, if the access control of the bucket is "Uniform": "x-goog-acl" is not needed:

``` [ { "origin": ["https://myorigin.retool.com"], "method": ["*"], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ] ```

``` vi cors.json ```

3. Then, wrote the code below to cors.json:

``` [ { "origin": ["https://myorigin.retool.com"], "method": ["*"], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ] ```

4. Finally, set cors.json for my bucket in Cloud Storage, GCP running the command below:

``` gsutil cors set cors.json gs://mybucket-bc123.appspot.com ```

5. In addition, the access control of the bucket is "Fine-grained". Are there any solutions to upload a file to Cloud

## When to use

You are seeing this: This might be due to a CORS issue on the bucket, so please double check that your CORS settings are correct. Use this skill when you run into "(Retool) query: Failed to upload. This might be due to a CORS issue on the bucket, so please double check that your".

## 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.

## Sources

- https://myorigin.retool.com"

Evidence

Stack Overflow question (score 2, has accepted answer): I failed to upload a file to Cloud Storage on GCP from Retool many times and always got the error below: query: Failed to upload. This might be due to a CORS issue on the bucket, so please double check that your CORS settings are correct. Actually, I made cors.json with the command below on Cloud Shell: `` vi cors.json Then, wrote the code below to cors.json: [ { "origin": ["https://myorigin.retool.com"], "method": ["*"], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ] Finally, set cors.json for my bucket in Cloud Storage, GCP running the command below: gsutil cors set cors.json gs://mybucket-bc123.appspot.com In addition, the access control of the bucket is "Fine-grained". Are there any solutions to upload a file to Cloud Resolved: Add "x-goog-acl" to "responseHeader" for the access control of the bucket "Fine-grained": [ { "origin": ["https://myorigin.retool.com"], "method": ["*"], "responseHeader": ["Content-Type", "x-goog-acl"], "maxAgeSeconds": 3600 // ↑↑↑ Here ↑↑↑ } ] In addition, if the access control of the bucket is "Uniform": "x-goog-acl" is not needed: [ { "origin": ["https://myorigin.retool.com"], "method": ["*"], "responseHeader": ["Content-Type"], "maxAgeSeconds": 3600 } ] `` Source: https://stackoverflow.com/questions/69623368/retool-query-failed-to-upload-this-might-be-due-to-a-cors-issue-on-the-bucke

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_UPL-PKtJd3R9UV2-I5Lr5A" 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">(Retool) query: Failed to upload. This might be due to a CORS issue on the bucket, so please double check that your <span>— Vectle</span></a>