honeybadger-io / honeybadger-python

Send Python and Django errors to Honeybadger.
https://www.honeybadger.io/
MIT License
15 stars 25 forks source link

Version 0.14.0 doesn't work without Celery #129

Closed stlk closed 1 year ago

stlk commented 1 year ago

Hello,

I just noticed after upgrading to version 0.14.0 Honeybadger breaks when running on Django without Celery.

10:16:17 web.1    | Exception in thread django-main-thread:
10:16:17 web.1    | Traceback (most recent call last):
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application
10:16:17 web.1    |     return import_string(app_path)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
10:16:17 web.1    |     return cached_import(module_path, class_name)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
10:16:17 web.1    |     module = import_module(module_path)
10:16:17 web.1    |   File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
10:16:17 web.1    |     return _bootstrap._gcd_import(name[level:], package, level)
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
10:16:17 web.1    |   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
10:16:17 web.1    |   File "/Users/stlk/Documents/projects/_playground/passionbox_store/passionbox_store/wsgi.py", line 16, in <module>
10:16:17 web.1    |     application = get_wsgi_application()
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
10:16:17 web.1    |     return WSGIHandler()
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/handlers/wsgi.py", line 125, in __init__
10:16:17 web.1    |     self.load_middleware()
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/handlers/base.py", line 40, in load_middleware
10:16:17 web.1    |     middleware = import_string(middleware_path)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/utils/module_loading.py", line 30, in import_string
10:16:17 web.1    |     return cached_import(module_path, class_name)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/utils/module_loading.py", line 15, in cached_import
10:16:17 web.1    |     module = import_module(module_path)
10:16:17 web.1    |   File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
10:16:17 web.1    |     return _bootstrap._gcd_import(name[level:], package, level)
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
10:16:17 web.1    |   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
10:16:17 web.1    |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/honeybadger/contrib/__init__.py", line 6, in <module>
10:16:17 web.1    |     from honeybadger.contrib.celery import CeleryHoneybadger
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/honeybadger/contrib/celery.py", line 1, in <module>
10:16:17 web.1    |     from celery import current_task
10:16:17 web.1    | ModuleNotFoundError: No module named 'celery'
10:16:17 web.1    |
10:16:17 web.1    | The above exception was the direct cause of the following exception:
10:16:17 web.1    |
10:16:17 web.1    | Traceback (most recent call last):
10:16:17 web.1    |   File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
10:16:17 web.1    |     self.run()
10:16:17 web.1    |   File "/opt/homebrew/Cellar/python@3.10/3.10.8/Frameworks/Python.framework/Versions/3.10/lib/python3.10/threading.py", line 953, in run
10:16:17 web.1    |     self._target(*self._args, **self._kwargs)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/utils/autoreload.py", line 64, in wrapper
10:16:17 web.1    |     fn(*args, **kwargs)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 157, in inner_run
10:16:17 web.1    |     handler = self.get_handler(*args, **options)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 31, in get_handler
10:16:17 web.1    |     handler = super().get_handler(*args, **options)
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/management/commands/runserver.py", line 78, in get_handler
10:16:17 web.1    |     return get_internal_wsgi_application()
10:16:17 web.1    |   File "/Users/stlk/.local/share/virtualenvs/passionbox_store-P05AqNEa/lib/python3.10/site-packages/django/core/servers/basehttp.py", line 49, in get_internal_wsgi_application
10:16:17 web.1    |     raise ImproperlyConfigured(
10:16:17 web.1    | django.core.exceptions.ImproperlyConfigured: WSGI application 'passionbox_store.wsgi.application' could not be loaded; Error importing module.
subzero10 commented 1 year ago

Hey @stlk, thank you for reporting this. We are going to look into it asap! You can follow updates at #124.

subzero10 commented 1 year ago

Hey @stlk, this should be fixed with v0.14.1!