stripe-cli: Stripe cli doesn't receive any event from stripe

Issue

When a create a subscription in test mode, events are triggered in the dashboard, but the stripe cli, which is listening with ./stripe.exe listen --load-from-webhooks-api --forward-to api.myapp.local --log-level debug receives nothing

Expected Behavior

I should get the events trigerred from the dashboard sent to my local app

Steps to reproduce

Define webhooks, login via stripe cli and redirect to local app loading webhooks via api, then do an action that triggers one of the listened events. If I manually trigger the event via stripe trigger [...] my application webhook is correctly called, but I’d like to work with my test data. After a few tests, I find out that only API generated events are received to the cli, but why ?

Traceback

Nothing, and I can see the events via stripe logs tail

Environment

Windows and Debian via WSL2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (2 by maintainers)

Most upvoted comments

I have the exact same issue as @drnic. I have crated one webhook pointing to the actual URL. Then i start stripe listen --load-from-webhooks-api --forward-to localhost:4000 and trigger a test webhook. The webhook gets sent to the actual URL and not localhost:4000. Triggering events from the CLI stripe trigger checkout.session.completed works perfectly. Yesterday the same setup worked just fine. Is this a Stripe internal issue or am I doing something wrong? Thanks for the help.

I am experiencing a similar issue, where I set up a redirect to my local dev environment. Events triggered via cli are received just fine, while those initiated via stripe API are sometimes received, sometimes not. I see a sequence of 7 events in the event log, but only some (if that) are received by the cli listener.

customer.created
payment_intent.created
charge.pending
payment_method.attached
payment_intent.processing
charge.succeeded
payment_intent.succeeded

While my cli listener receives a variable selection of these events, anywhere from 2 to 5. If I resend the specific events via stripe events resend the listener receives the event without fail.

Slightly off topic, but this seems to be the result page if you’re searching for “stripe listening not working”. By default “stripe listen” seems to ignore webhook messages with the wrong version without any warning and hence appears to not be working.

Using the log level parameter: stripe listen --forward-to localhost:4242/webhook.php --log-level debug

I eventually got the message: [Tue, 13 Jul 2021 16:26:59 BST] DEBUG proxy.Proxy.filterWebhookEvent: Received event with non-default API version, ignoring api_version=2020-08-27

Hopefully this helps someone not waste most of the day as I have just done.

Not sure if this would help someone but I encountered this as well, it turns out that on my CLI I was logged in with a different account. Running stripe login works for me.

I run stripe listen and nothing happens, yesterday everything was working normally

image

@Aaryan6 I’d recommend ditching stripe-cli entirely and using something like Ultrahook or ngrok instead. I don’t think Stripe has the resources required deal with much besides housekeeping tasks (just look at the issues vs commits). Personally I don’t use stripe-cli for anything anymore.

I’d agree with this unfortunately. Just spent an hour trying to get stripe-cli and listening to webhooks to work, I know it worked previously. Switched to Cloudflare Tunnels and it’s working fine. Who knows.

@Aaryan6 I’d recommend ditching stripe-cli entirely and using something like Ultrahook or ngrok instead. I don’t think Stripe has the resources required deal with much besides housekeeping tasks (just look at the issues vs commits). Personally I don’t use stripe-cli for anything anymore.

For some reason, adding log-level debug made events start appearing for me. Before logging, nothing was showing up.

I’m facing the same issue, v1.10:

[Tue, 31 May 2022 19:32:36 MDT] DEBUG websocket.Client.readPump: Received pong message
[Tue, 31 May 2022 19:32:38 MDT] DEBUG websocket.Client.writePump: Sending ping message
[Tue, 31 May 2022 19:32:38 MDT] DEBUG websocket.Client.readPump: Received pong message

Logged in multiple times to no avail.

Update: 12 hours later and stripe webhooks are arriving at stripe listen immediately again. I think the issue was stripe was blocked up sending out webhooks. I noticed last night that the events were at https://dashboard.stripe.com/test/events and looked to be annotated to say they had not been sent out yet.