Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stripe cli doesn't receive any event from stripe #487

Closed
Geekimo opened this issue Jul 16, 2020 · 21 comments
Closed

Stripe cli doesn't receive any event from stripe #487

Geekimo opened this issue Jul 16, 2020 · 21 comments
Labels
bug Something isn't working

Comments

@Geekimo
Copy link

Geekimo commented Jul 16, 2020

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

@Geekimo Geekimo added the bug Something isn't working label Jul 16, 2020
@tomer-stripe
Copy link
Collaborator

Hey @Geekimo, could you share a little more about how you're generating the events? It sounds like you were creating them in the dashboard, correct?

What does the output for --log-level debug show when you run it? Could you also share the parallel output for logs tail?

@drnic
Copy link

drnic commented Oct 24, 2020

Not my ticket, but I'll borrow it.

I'm getting good looking websocket connections; but they are being dropped and reconnecting. But I'm not seeing any events.

$ stripe listen --log-level=debug
⣾ Getting ready... [Sat, 24 Oct 2020 17:46:17 AEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⣟ Getting ready... [Sat, 24 Oct 2020 17:46:18 AEST] DEBUG stripeauth.Client.Authorize: Got successful response from Stripe display_connect_filter_warning=false reconnect_delay=38 websocket_authorized_feature=webhook-payloads websocket_id=cliws_{42}_1WNwP2mP7XosGnGEnnZ0yzTSo4Z67QWarhBSshAoSZH8e9RRVW websocket_url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X
[Sat, 24 Oct 2020 17:46:18 AEST] DEBUG websocket.client.Run: Attempting to connect to Stripe
[Sat, 24 Oct 2020 17:46:18 AEST] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X?websocket_feature=webhook-payloads
⣽ Getting ready... [Sat, 24 Oct 2020 17:46:19 AEST] DEBUG websocket.client.connect: Connected!
> Ready! Your webhook signing secret is whsec_Fs5oNxV2ZFnYBJF5mz2w6umZ3JtoQdJz (^C to quit)
[Sat, 24 Oct 2020 17:46:28 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:46:28 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:46:37 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:46:37 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:46:46 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:46:46 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:46:55 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:46:55 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:46:57 AEST] DEBUG websocket.Client.Run: Resetting the connection
[Sat, 24 Oct 2020 17:46:57 AEST] DEBUG websocket.Client.writePump: stopWritePump
[Sat, 24 Oct 2020 17:46:57 AEST] DEBUG websocket.Client.readPump: stopReadPump
[Sat, 24 Oct 2020 17:46:57 AEST] DEBUG websocket.client.Run: Attempting to connect to Stripe
[Sat, 24 Oct 2020 17:46:57 AEST] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X?websocket_feature=webhook-payloads
[Sat, 24 Oct 2020 17:46:58 AEST] DEBUG websocket.client.connect: Connected!
[Sat, 24 Oct 2020 17:47:07 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:08 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:47:16 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:17 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:47:25 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:26 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:47:34 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:35 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:47:36 AEST] DEBUG websocket.Client.Run: Resetting the connection
[Sat, 24 Oct 2020 17:47:36 AEST] DEBUG websocket.Client.readPump: stopReadPump
[Sat, 24 Oct 2020 17:47:36 AEST] DEBUG websocket.Client.writePump: stopWritePump
[Sat, 24 Oct 2020 17:47:36 AEST] DEBUG websocket.client.Run: Attempting to connect to Stripe
[Sat, 24 Oct 2020 17:47:36 AEST] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X?websocket_feature=webhook-payloads
[Sat, 24 Oct 2020 17:47:37 AEST] DEBUG websocket.client.connect: Connected!
[Sat, 24 Oct 2020 17:47:46 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:46 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:47:55 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:47:55 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:04 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:04 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:13 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:13 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:15 AEST] DEBUG websocket.Client.Run: Resetting the connection
[Sat, 24 Oct 2020 17:48:15 AEST] DEBUG websocket.Client.writePump: stopWritePump
[Sat, 24 Oct 2020 17:48:15 AEST] DEBUG websocket.Client.readPump: stopReadPump
[Sat, 24 Oct 2020 17:48:15 AEST] DEBUG websocket.client.Run: Attempting to connect to Stripe
[Sat, 24 Oct 2020 17:48:15 AEST] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X?websocket_feature=webhook-payloads
[Sat, 24 Oct 2020 17:48:16 AEST] DEBUG websocket.client.connect: Connected!
[Sat, 24 Oct 2020 17:48:25 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:25 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:34 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:34 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:43 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:43 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:52 AEST] DEBUG websocket.Client.writePump: Sending ping message
[Sat, 24 Oct 2020 17:48:52 AEST] DEBUG websocket.Client.readPump: Received pong message
[Sat, 24 Oct 2020 17:48:54 AEST] DEBUG websocket.Client.Run: Resetting the connection
[Sat, 24 Oct 2020 17:48:54 AEST] DEBUG websocket.Client.writePump: stopWritePump
[Sat, 24 Oct 2020 17:48:54 AEST] DEBUG websocket.Client.readPump: stopReadPump
[Sat, 24 Oct 2020 17:48:54 AEST] DEBUG websocket.client.Run: Attempting to connect to Stripe
[Sat, 24 Oct 2020 17:48:54 AEST] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/acct_1HfbKEBrTNfbHR4X?websocket_feature=webhook-payloads
[Sat, 24 Oct 2020 17:48:55 AEST] DEBUG websocket.client.connect: Connected!
$ stripe logs tail
> Ready! You're now waiting to receive API request logs (^C to quit)
2020-10-24 17:46:36 [200] POST /v1/payment_intents [req_1VoL59Ao2ylbeG]
2020-10-24 17:46:55 [200] POST /v1/customers [req_BmXneTrRlQXBqS]
2020-10-24 17:47:43 [200] GET /v1/payment_pages/:id [req_5QQNJ9EvOu2mU8]

Commands I tried:

$ stripe trigger payment_intent.succeeded
$ stripe customers create

@drnic
Copy link

drnic commented Oct 24, 2020

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.

@roosnic1
Copy link

roosnic1 commented Dec 3, 2020

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.

@edgework
Copy link

edgework commented Dec 23, 2020

Similar problem for me. First time the stripe cli console indicated it forwarded the webhook but my code rejected the request due to WAF issue. I resolved that but afterwards I get no more forwards. I got this error once

--> payment_intent.created [evt_1I1ObEFjb5xm4tcWEw0TFcBf]
2020-12-22 20:05:52            [ERROR] Failed to POST: Post https://wongo.com:8443/webhook: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

I do have a perfectly valid certificate for wongo.com installed on my dev machine so that's not the issue and my server never got any requests.

@easybi-vv
Copy link

easybi-vv commented Apr 15, 2021

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.

@kylefox
Copy link

kylefox commented Apr 15, 2021

I'm seeing the exact same issue as @easybi-vv, more often with Stripe Connect events.

When I perform an operation (either via API or dashboard) I expect to emit events, I sometimes receive the expected events. For example, I will update a customer in the dashboard and expect to receive a customer.updated event but the Stripe CLI never receives it and just endlessly logs this output:

DEBUG websocket.Client.writePump: Sending ping message
DEBUG websocket.Client.readPump: Received pong message

And sometimes I'll receive the event as expected.

It seems completely random and sporadic. I can perform the same operation repeatedly (ex: add a piece of random metadata to a customer) and it's completely unpredictable how many customer.updated events I'll receive, if any. There doesn't seem to be a delay issue — I either receive the event instantly or not at all, even after waiting several minutes.

And similar to what @easybi-vv reported, when performing an operation that emits several events (like processing a payment) I may receive none, some, or all of the expected events.

Here's the command I'm running:

stripe listen \
  --log-level debug \
  --skip-verify \
  --forward-to https://api.lvh.me:5001/webhooks/stripe \
  --forward-connect-to https://api.lvh.me:5001/webhooks/stripe/connect

@tomer-stripe I'm happy to perform any additional debugging or provide further details that could be helpful. This isn't a new issue, but I seem to be experiencing it more frequently over the last month or so.

@pepin-stripe
Copy link
Contributor

@kylefox thanks for the additional data. We're fully focused on this issue and have added additional logs and metrics on our side. Next time you are facing this issue, please share the id of an event that was dropped (you can find it on your dashboard).

Thanks!

@pepin-stripe
Copy link
Contributor

To keep focus on the issue we've pinned #600 and will keep communicating there. Closing this. If you have any follow or new reports, please continue the conversation on #600.

Thanks!

@germanolira
Copy link

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

image

@mbrn
Copy link

mbrn commented Jun 16, 2021

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

image

I faced with same issue. i uninstalled and installed again. It works now. I use scoop with Windows 10.

@tdrdimov
Copy link

tdrdimov commented Jul 2, 2021

I'm having the same issue, events are showing in the logs and dashboard but not when listen to the hook url. Also my function isn't firing when the event is triggered, not sure if this is only when testing local or behavior is same when hook is pushed live when we can test with the dashboard.

@exigenltd
Copy link

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.

@adityabhaskar
Copy link

Thanks @exigenltd! Just confirmed with the debug log level. It's the same issue for m:

[Thu, 15 Jul 2021 06:31:10 BST] DEBUG proxy.Proxy.filterWebhookEvent: Received event with non-default API version, ignoring api_version=2020-08-27

@applibs
Copy link

applibs commented Jan 21, 2022

I see only:
[Fri, 21 Jan 2022 10:50:19 CET] DEBUG websocket.Client.writePump: Sending ping message
[Fri, 21 Jan 2022 10:50:19 CET] DEBUG websocket.Client.readPump: Received pong message
[Fri, 21 Jan 2022 10:50:21 CET] DEBUG websocket.Client.writePump: Sending ping message
[Fri, 21 Jan 2022 10:50:21 CET] DEBUG websocket.Client.readPump: Received pong message
....
Nothing else.

@renielsalvador
Copy link

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.

@apkallum
Copy link

apkallum commented Jun 1, 2022

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.

@derekpankaew
Copy link

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

@Aaryan6
Copy link

Aaryan6 commented Mar 8, 2023

So what's the solution??

@kylefox
Copy link

kylefox commented Mar 8, 2023

@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.

@dominiceden
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests