# Problem with 500 error with subscriptions

**URL:** https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808
**Category:** Support
**Tags:** subscriptions
**Created:** [April 7, 2025, 9:28pm UTC](https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808 "2025-04-07T21:28:36Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [April 9, 2025, 6:34pm UTC](https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808/7 "2025-04-09T18:34:55Z")

</div>

Cool. Thanks!

There was one subscription.

One fix on your code:

```plaintext
subs = ::Stripe::Subscription.list(customer: customer.stripe_customer_id, status: 'all')[:data]

```

There are 100 plans (so probably more than that)-- maybe this is the problem? (I tried with `limit: 1000` but that didn’t change anything; I guess that’s a Stripe API limit?)

So maybe if there are \>100 plans it fails? Oh, and the users for whom it’s not failing, are on plans that are in the first 100.

```plaintext
discourse(prod)> plan = plans[:data].find { |p| p[:id] == price_id }
discourse(prod)>
=> nil

```

EDIT:

Yes. If I do this:

```plaintext
# Get the last item's ID
last_price_id = plans.data.last.id

# Get the next 100
next_plans = ::Stripe::Price.list(
  expand: ['data.product'],
  limit: 100,
  starting_after: last_price_id
)

```

then

```plaintext
discourse(prod)> next_plans[:data].find { |p| p[:id] == price_id }

```

finds what it’s looking for.

EDIT AGAIN: next\_plans.count == 8. I suggested that they delete 10 plans.

---

_[View the full topic](https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808)._
