# Проблема с ошибкой 500 при подписках

**URL:** <https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808>\
**Category:** Product Support\
**Tags:** subscriptions\
**Created:** [07.Апрель.2025 21:28:36 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:** 1

<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:** [07.Апрель.2025 21:28:36 UTC](https://meta.discourse.org/t/problem-with-500-error-with-subscriptions/360808/1 "2025-04-07T21:28:36Z")

</div>

Похоже, это баг для раздела #Contribute > Bug, но я не понимаю, что происходит.

Несколько пользователей получают ошибку 500 при попытке загрузить `/s/user/subscriptions/` (когда переходят на страницу /my/billing/subscriptions).

```plaintext
NoMethodError (undefined method `[]' for nil) app/controllers/application_controller.rb:427:in `block in with_resolved_locale' app/controllers/application_controller.rb:427:in `with_resolved_locale' l

```

```plaintext

NoMethodError (undefined method `[]' for nil)
app/controllers/application_controller.rb:427:in `block in with_resolved_locale'
app/controllers/application_controller.rb:427:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:35:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:410:in `call'
lib/middleware/csp_script_nonce_injector.rb:12:in `call'
config/initializers/008-rack-cors.rb:14:in `call'
lib/middleware/default_headers.rb:13:in `call'
config/initializers/100-quiet_logger.rb:20:in `call'
config/initializers/100-silence_logger.rb:29:in `call'
lib/middleware/enforce_hostname.rb:24:in `call'
lib/middleware/processing_request.rb:12:in `call'
lib/middleware/request_tracker.rb:385:in `call'

```

Я надеялся, что это какая-то случайность, так как ошибка возникает не у всех пользователей. Однако я не могу найти закономерность.

Я могу выполнить следующее:

```plaintext
 user=User.find_by_username 'xxx'
 DiscourseSubscriptions::Customer.find_by(user_id: user.id)

```

И это работает.

Я не уверен, куда смотреть дальше.

---

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