[BUG] Define custom bucket for extention Resize Image
See original GitHub issue[REQUIRED] Step 2: Describe your configuration
Resize Image, default settings set Bucket to name of any other bucket that is not your default
Deployment location Description us-central1 Cloud Storage bucket for images Description new-second-bucket Sizes of resized images Description 128x128 Cloud Storage path for resized images (Optional) Description Parameter not set Cache-Control header for resized images (Optional) Description Parameter not set
[REQUIRED] Step 3: Describe the problem
Cloud Storage Bucket is not clear on the naming convention should it be “new-second-bucket” per “gs://new-second-bucket” or <bucket>.<project>.appspot.com/ or something else? needs to be clearer on how to define your custom bucket
Steps to reproduce:
Install new extention “Resize Image” configure the bucket to match the url of the second or alternative bucket ie “gs://new-second-bucket” to “new-second-bucket” or other respectable forms
Expected result
it should use the defined bucket
Actual result
Error occurred while deploying resources: RESOURCE_ERROR: /deployments/firebase-ext-storage-resize-images/resources/generateResizedImage
{“ResourceType”:“gcp-types/cloudfunctions-v1:projects.locations.functions”,“ResourceErrorCode”:“400”,“ResourceErrorMessage”:{“code”:400,“message”:“The request has errors”,“status”:“INVALID_ARGUMENT”,“details”:[{“@type”:“type.googleapis.com/google.rpc.BadRequest”,“fieldViolations”:[{“field”:“event_trigger.resource”,“description”:“GCS bucket resource projects/_/buckets/https://console.cloud.google.com/storage/browser/new-second-bucket does not match the expected pattern, which is projects/{project}/buckets/{bucket}”}]}],“statusMessage”:“Bad Request”,“requestPath”:“https://cloudfunctions.googleapis.com/v1/projects/worldsbeyond-1/locations/us-central1/functions/ext-storage-resize-images-generateResizedImage",“httpMethod”:"PATCH”}}There was an unknown error while processing the request. Try again.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:9 (2 by maintainers)
Top GitHub Comments
After some digging I think I found a workaround for the issue.
Configure the extension with a correct bucket URL for a bucket that doesn’t exist. (e.g. ThisDoesNotExist.appspot.com)
Go to Google Cloud Console and pick your project.
You should see something like this:
The function ext-storage-resize-images-generateResizedImage (your extension) should be have a red icon next to it.
Go to the function, and reconfigure it (Edit -> Bucket) You can add your custom bucket there, the validation in there works just fine (actually you can use the bucket browser in there)
I hope this works for you. It’s not elegant, but at least it’s a temporary fix for me.
I’m trying to setup the extension for a custom bucket in my firebase project.
The default bucket in the Storage explorer is named
myproject.appspot.com
. When I use this in the extension configuration it works fine.However, I want the extension to run on a different bucket, so I create a new bucket
myproject-avatars
(note that I cannot add.appspot.com
here). Now the extension config forces me to enter a bucket name ending in.appspot.com
so I entermyproject-avatars.appspot.com
. This gives me the following error:Error occurred while deploying resources: RESOURCE_ERROR: `/deployments/firebase-ext-storage-resize-images/resources/generateResizedImage` {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Cloud Storage trigger bucket myproject-avatars.appspot.com not found"}
Screenshot of bucket config:
How can I use a custom bucket with this extension?
Thanks!