Skip to content

Error: Billing customer not found #11960

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

Closed
sentry-io bot opened this issue May 9, 2025 · 1 comment · Fixed by #12116
Closed

Error: Billing customer not found #11960

sentry-io bot opened this issue May 9, 2025 · 1 comment · Fixed by #12116
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented May 9, 2025

Sentry Issue: TWENTY-SERVER-53F

For the billing master

@prastoin
Copy link
Contributor

prastoin commented May 9, 2025

( might a duplicated @etiennejouan, because was assigned to you through Sentry but no GitHub issue. Feel free to close in case it doesn't make sense

@etiennejouan etiennejouan moved this from 🔖 Planned to 🏗 In Progress in 🎯 Roadmap & Sprints May 19, 2025
@etiennejouan etiennejouan moved this from 🏗 In Progress to 👀 In review in 🎯 Roadmap & Sprints May 19, 2025
Weiko pushed a commit that referenced this issue May 19, 2025
### Context
Several 'Customer not found' errors arrived in Sentry, all coming from
webhook-entitlement.service, at subscription creation (coinciding with
customer creation 99% of the time).
Stripe sends many events to update/create customer, subscription,
entitlement, ...
All these events are handle in parallel but customer.created stripe
event arrived first and few seconds after subscription.created and
entitlements.active_entitlement_summary.updated

Issue happens at entitlements.active_entitlement_summary.updated
handling. It checks for customer existence through subscription. But
subscription can be not created yet at this moment.

### Solution
Check directly for customer existence in billingCustomer table. Not sure
it will fix the error because of the parallel handling of Stripe event,
but should still be better.

### Tested
- Workspace creation
- Subscription upgrade (check for entitlement update)

closes #11960
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in 🎯 Roadmap & Sprints May 19, 2025
@etiennejouan etiennejouan moved this from ✅ Done to 👀 In review in 🎯 Roadmap & Sprints May 19, 2025
@etiennejouan etiennejouan moved this from 👀 In review to 🔦 In QA in 🎯 Roadmap & Sprints May 19, 2025
@etiennejouan etiennejouan moved this from 🔦 In QA to ✅ Done in 🎯 Roadmap & Sprints May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants