extensions icon indicating copy to clipboard operation
extensions copied to clipboard

[storage-resize-images] Event handler is not getting triggered

Open itssidhere opened this issue 3 years ago • 16 comments

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs for a specific extension in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk Google group.
  • To file a bug against the Firebase Extensions platform, or for an issue affecting multiple extensions, please reach out to Firebase support directly.

[REQUIRED] Step 2: Describe your configuration

  • Extension name: storage-resize-images
  • Extension version: 0.1.29
  • Configuration values (redact info where appropriate): Enabled events

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur? The custom event handler is not getting triggered after the successful execution of the plugin

Logs for Storage Resize Image Extension image

Logs for Custom event handler image

Configuration of extension image

Code for custom event handler exports.onimageresized = onCustomEventPublished("firebase.extensions.storage-resize-images.v1.complete", (e) => { logger.info(e); })

itssidhere avatar Sep 03 '22 08:09 itssidhere

Hi @itssidhere, Thank you for filing this issue. Can you please check that you have the required permissions/role to listen to Pub/Sub evetns? Steps are documented in this PR #1090.

Issue possibly related to #1080 #1136

yamankatby avatar Sep 05 '22 09:09 yamankatby

@yamankatby I have done these steps https://github.com/firebase/extensions/pull/967#issuecomment-1186171281

itssidhere avatar Sep 05 '22 09:09 itssidhere

@itssidhere did they make the trick?

yamankatby avatar Sep 05 '22 09:09 yamankatby

@yamankatby Nope, I did this before creating the issue.

itssidhere avatar Sep 05 '22 09:09 itssidhere

Hey @itssidhere, Unfortunately, I couldn't reproduce the issue you are getting. Can you please provide more information about your setup, something such as config params, pub-sub related permissions you have, and any other piece of information you think may be helpful?

yamankatby avatar Sep 05 '22 11:09 yamankatby

Can you tell me the pubsub permission thing? I read the documentation you linked but it was pretty generic. Is it anything different from this https://github.com/firebase/extensions/pull/967#issuecomment-1186171281 ?

itssidhere avatar Sep 05 '22 11:09 itssidhere

@itssidhere It is pretty much what was mentioned in that comment (https://github.com/firebase/extensions/pull/967#issuecomment-1186171281), can you confirm that you have the roles/iam.serviceAccountTokenCreator role now?

yamankatby avatar Sep 05 '22 11:09 yamankatby

@yamankatby I am the project owner so I think it has the highest level roles right?

itssidhere avatar Sep 05 '22 12:09 itssidhere

@itssidhere no, it must be granted manually

yamankatby avatar Sep 05 '22 12:09 yamankatby

@yamankatby Can you please guide me a bit so that I can verify the same

itssidhere avatar Sep 05 '22 12:09 itssidhere

Hi @itssidhere .

Do you still have any issue with events not getting triggered?

dackers86 avatar Oct 10 '22 10:10 dackers86

Hey @dackers86 & @yamankatby I seem to be affected by this as well.

According to this post, the OP says it has to do because of the region & it only works when all related regions are us-central1... 🤔

I can confirm that I am not receiving the event with the following regions:

  • Extension version: 0.2.1
  • firebase region (AKA default GCP resource location): asia-northeast1
  • extension region: asia-northeast1
  • event handler function region: asia-northeast1
  • eventarc channel region: asia-northeast1

With these regions, I can confirm that I am not receiving any events triggered. However, the extension is correctly resizing my images...

My event handler functions which is not being hit looks something like this:

export const imageResizeEvent = onCustomEventPublished(
  {
    eventType: "firebase.extensions.storage-resize-images.v1.onCompletion",
    channel: "locations/asia-northeast1/channels/firebase",
    region: "asia-northeast1",
  },
  async (event: CloudEvent<any>) => {
      console.log('hello world')
  })

Unfortunately, creating a completely new firebase project with a different region as the OP of the post above is not a good option for me...

Any help or advise you can provide? So far, this is a major blocker for correctly setting up this extension. Thank you!

Update: I've tried following these steps https://github.com/firebase/extensions/pull/967#issuecomment-1186171281, and it s still not working, I've also just tried giving my service account Eventarc Admin & Pub/Sub Admin roles, all to no avail 😢

TangrisJones avatar Nov 29 '23 04:11 TangrisJones

Re-opening to investigate the underlying issue more.

pr-Mais avatar Dec 05 '23 13:12 pr-Mais

Im having the same issue

CalvinJamesHeath avatar Jan 29 '24 20:01 CalvinJamesHeath