question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
textcolorcommented, Oct 8, 2019

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:

img

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.

4reactions
emielvanlierecommented, Oct 4, 2019

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 enter myproject-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: buckets

How can I use a custom bucket with this extension?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I resize all existing images in firebase storage?
1 Answer 1 · Get all the files of your bucket, see the getFiles() method of the Google Cloud Storage Node. · By...
Read more >
Extension for Resizing an image within a For Loop
I have written an extension to resize a given image: extension NSImage { func resizeImage(width: CGFloat, _ height: CGFloat) -> NSImage { let...
Read more >
Trigger Firebase Storage Image Resize with Cloud Functions
Let's write an image resizer triggered by Firebase Storage with ... You can create a bucket and then insert any kind of file...
Read more >
Resize Images | Extensions Marketplace by Firebase
Use this extension to create resized versions of an image uploaded to a Cloud Storage bucket. When you upload a file to your...
Read more >
Troubleshooting - ASP.NET Image resizing for IIS
You might be trying to resize certain large images for the first time. Even a 15MB jpg, however, uncompresses to about 80MB in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found