google-cloud-functionsstripe-paymentsgoogle-cloud-consolestripe-payments-js

Webhook handler for Stripe event ... of type <several events> failed: User not found


I have a test mode product which I am generating a payment link for and passing a uid encoded in hex through a client_reference_id param. I have an firebase cloud function event handler and a webhook in my test stripe dashboard pointing to my event endpoint. Everything seems to be functioning properly, but I'm seeing these errors in my log console for several of the events sent:

I'm seeing these in my google cloud logs explorer. The error is as stated in the description. I don't see a stacktrace, but there is a trace path. I found them in Google Cloud's Trace List, but there's no stacktrace in there either. Just the sequence that got me to the errror:

  1. /ext-firestore-stripe-payments-handleWebhookEvents (2645.429 ms)
  2. Handling Stripe event [<event name>] of type <event type>
❗️[Error]: Webhook handler for  Stripe event [<eventname>] of type [checkout.session.completed] failed: User not found! 
[Open in Logs Viewer]
Full Log Entry
{
textPayload: "❗️[Error]: Webhook handler for  Stripe event [<eventname>] of type [checkout.session.completed] failed: User not found!"
insertId: "<id>"
resource: {2}
timestamp: "2023-02-04T00:24:11.569373Z"
severity: "ERROR"
labels: {2}
logName: "<path>"
trace: "<path>"
receiveTimestamp: "2023-02-04T00:24:11.661364910Z"
}

and finally 4. Function execution took 2248 ms, finished with status code: 200

It's just not clear to me what is causing this error. Since I am using a payment link, I don't know how I can have a user besides what the user enters for themselves in the payment screen (email, etc).


Solution

  • The issue here was that there was a second endpoint with a different name which I had created while testing which was still enabled. Since I changed the name, it appears the extension was reporting errors on the firebase side. Deleting / disabling the endpoint solves the reported errors.