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

AttributeError: 'Provider' object has no attribute '_is_coroutine' #108

Open
bbekdemir opened this issue Dec 17, 2022 · 1 comment
Open

Comments

@bbekdemir
Copy link

When I try to upgrade Django 3.2.16 to 4.1.4, I'm getting

AttributeError: 'Provider' object has no attribute '_is_coroutine'
  File "django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "django/utils/deprecation.py", line 131, in __call__
    if self._is_coroutine:

I'm using the following in my list of MIDDLEWAREs:

MIDDLEWARE = [
    ...
    'raygun4py.middleware.django.Provider'
]
@dqd
Copy link

dqd commented Feb 24, 2023

After checking the __init__ method in raygun4py's middleware, I realized that they do not call super().__init__(get_response), so they miss the self._async_check() call from MiddlewareMixin which causes this error.

A workaround for now can be this:

  1. Create your own middleware that inherits Provider and calls self._async_check() by itself, such as this:
from raygun4py.middleware.django import Provider


class ProviderMiddleware(Provider):
  def __init__(self, get_response):
      super().__init__(get_response)
      self._async_check()
  1. Replace 'raygun4py.middleware.django.Provider' in the MIDDLEWARE settings (located in your settings.py file) with your my_project.middleware.ProviderMiddleware implemented in step 1.

mathjazz added a commit to mathjazz/pontoon that referenced this issue Apr 22, 2024
mathjazz added a commit to mathjazz/pontoon that referenced this issue Apr 22, 2024
mathjazz added a commit to mathjazz/pontoon that referenced this issue Apr 23, 2024
mathjazz added a commit to mozilla/pontoon that referenced this issue Apr 24, 2024
* pytest.yield_fixture is a deprecated alias for pytest.fixture

* Update Django dev dependencies

* Update bleach

* Upgrade existing dependencies within the given constraints of the input files

* Fix jinja after update

* Update pip-tools

* Update django-* libraries

* Upgrade graphene-django

* Upgrade Django to 4.0

* Drop pytz

* ALLOWED_HOSTS must be a list

* Upgrade Django to 4.1

* Add workaround for the Raygun AttributeError

See:
MindscapeHQ/raygun4py#108

* Avoid ValueError when instance doesn't have a primary key value but relationship is used.

See:
django/django@7ba6ebe

* Upgrade Django to 4.2.11

* Drop pytz as a direct requirement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants