#Talon - CLI Trigger Error

1 messages · Page 1 of 1 (latest)

compact adder
#

Hello again!

tame eagle
#

should I ignore it. seems like CLI is doing something after it's not possible anymore

#

Hello again 🙂

compact adder
#

Hm, interesting, let me take a look...

tame eagle
#

evt_1JwyBqF9Zo1nikLicVKSR4bj

compact adder
#

You got this error from Stripe CLI or somewhere else?

Request req_GruB07smzZKJsN: You cannot update a subscription that is `canceled or incomplete_expired`
tame eagle
#

stripe cli

compact adder
#

Oh, so that error is actually coming from your own code but is being surfaced by the stripe listen command.

tame eagle
#

not doing anything tbh

compact adder
#

So when you run stripe trigger customer.subscription.deleted Stripe CLI creates and then immediately cancels a Subscription in order to generate a customer.subscription.deleted event. It looks like you have stripe listen running which is forwarding various events to your webhook code, including the events associated with the creation of the Subscription the CLI creates.

#

By the time your webhook handling code runs the Subscription has already been canceled by Stripe CLI, so you get the error above when you try to interact with it.

tame eagle
#

I got it. so my subscription_created have a logic which can't be triggered for this use case and therefore it's failing

#

this is getting triggered with customer.subscription.deleted as well because it is also triggering customer.subscription.create

compact adder
#

Yep. Running stripe trigger customer.subscription.deleted will actually create and cancel a Subscription, which generates more events than just customer.subscription.deleted.