0

My deployment command:

gcloud functions deploy send-verification-mail ^
  --gen2 ^
  --runtime=python312 ^
  --trigger-location=asia-south2 ^
  --region=asia-south2 ^
  --source=. ^
  --entry-point=send_verification_mail ^
  --set-env-vars GOOGLE_CLOUD_PROJECT=myproject ^
  --trigger-event-filters=type=google.cloud.firestore.document.v1.create ^
  --trigger-event-filters-path-pattern=document='users/{username}'

This results in:

ERROR: (gcloud.functions.deploy) ResponseError: status=[400], code=[Ok], message=[Validation failed for trigger projects/myproject/locations/asia-south2/triggers/send-verification-mail-878142: The request was invalid: Operator match-path-pattern is not supported for attribute document within event type google.cloud.firestore.document.v1.create]

4
  • 1
    did you double check that document names support path-pattens? cloud.google.com/eventarc/docs/… Commented Jan 2 at 7:41
  • I used: gcloud eventarc providers describe firestore.googleapis.com --location=asia-south2 which resulted in many event types for datastore and firestore and .created was supported (for firestore too), but if I use .created (in the command) it results in the aforementioned error. .written event type has deployed fine though? Commented Jan 2 at 17:46
  • The error isnt saying document.create as a trigger isnt supported, its saying you cant do a path match on document names, the ourput of the describe command should show a list of event attributes, as far as I understand unless that one explicitely says pathPatternSupported: true for attribute document, you cant do what you are trying to do. Commented Jan 3 at 8:15
  • Apologies for not providing enough info. It does say true: attribute: document description: Pattern to match for the resource. pathPatternSupported: true for type: google.cloud.firestore.document.v1.created, for the same command Commented Jan 3 at 16:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.