invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
433 stars 163 forks source link

Stripe Extension Failing to Deploy with Resource Errors #490

Open b0ot opened 1 year ago

b0ot commented 1 year ago

Bug report

Describe the bug

I have upgraded from 0.3.1 to 0.3.2

When I try to build and deploy my firebase project it generates errors related to the stripe extension. On occasion it will actually say it successfully deployed, however if you click on the stripe extension or look at the cloud functions there are errors.

Be aware that a parameter misconfiguration might have caused some extension resources to not successfully deploy.

Use the details below to help resolve this error, then retry configuring the extension. If you continue to get this error, we recommend uninstalling the extension to remove any extension resources that might be deployed.

; RESOURCE_ERROR at /deployments/firebase-ext-firestore-stripe-payments/resources/createCheckoutSession: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"500","ResourceErrorMessage":"Failed to configure trigger event-type:providers/cloud.firestore/eventTypes/document.create resource:projects/videomap-majafy/databases/(default)/documents/customers/{uid}/checkout_sessions/{id} service:firestore.googleapis.com"}; RESOURCE_ERROR at /deployments/firebase-ext-firestore-stripe-payments/resources/onCustomerDataDeleted: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"500","ResourceErrorMessage":"Failed to configure trigger event-type:providers/cloud.firestore/eventTypes/document.delete resource:projects/videomap-majafy/databases/(default)/documents/customers/{uid} service:firestore.googleapis.com"}

I have uninstalled and reinstalled multiple times. I have uninstalled and then installed via the command line I have uninstalled and then installed via the command line 0.3.1 All have the same issue for me.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository: Building & Deploying the Firebase Project causes the issue.

Expected behavior

Should be able to build and deploy firebase use default && QENV=production quasar build firebase use default && firebase deploy --debug (Site & extension was working before the upgrade)

Screenshots

If applicable, add screenshots to help explain your problem.

System information

firebase-tools@11.20.0 stripe/firestore-stripe-payments@0.3.2

Additional context

Add any other context about the problem here. image

warrendodsworth commented 1 year ago

Try this Permissions issue: Resolved from a comment in https://github.com/firebase/extensions/issues/824

Thanks rbedemann

Double check that your Google Cloud API Service Agent (@cloudservices.gserviceaccount.com) has all required roles. By default it should have "Editor" (roles/editor)

bensontrent commented 1 year ago

This error seems to occur when you have uninstalled, then re-installed the extension. I was able to resolve this issue by installing a second copy of the extension by visiting https://extensions.dev/extensions/stripe/firestore-stripe-payments. This forces you to create a new identifier for the extension so it doesn't conflict with the originally installed extension. I left the webhook secret blank and did not enable events until the extension was installed. Once it's installed you can reconfigure the extension, add your webhook secret, enable events, then delete the old copy of the extension. This seems to clean up conflicts with artifacts left over from an old installation.

Screenshot 2023-02-19 195042