Question

I have just installed django-sentry and plan to use it for logging in my django project. But I have run into a roadblock.

This is the error that I get, whenever I try to log an error:

    Unable to record event: cannot import name Group

Relevant stack I am using:

    django-paging   - 0.2.4
    django-indexer  - 0.3.0
    django-templatetag-sugar - 0.1
    django-sentry   - 1.13.5 
    raven           - 3.1.15 
    eventlet        - 0.12.1
    greenlet        - 0.4.0 
    lockfile        - 0.9.1   
    python-daemon   - 1.6

This is what I do:

    import logging
    logger=logging.getLogger('sentry.error')
    logger.error('error message')

Logging settings defined in settings.py:

    SENTRY_LOGGING = {
        'version': 1,
        'disable_existing_loggers': True,
        'root': {
            'level': 'WARNING',
            'handlers': ['sentry']
        },
        'formatters': {
            'verbose': {
                'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
            }
        },
        'handlers': {
            'sentry': {
                'level': 'DEBUG',
                'class': 'raven.contrib.django.handlers.SentryHandler'
            },
            'console': {
                'level': 'DEBUG',
                'class': 'logging.StreamHandler',
                'formatter': 'verbose'
            },
            'mail_admins': {
                'level': 'ERROR',
                'class': 'django.utils.log.AdminEmailHandler'
            }
        },
        'loggers': {
            'django.db.backends': {
                'level': 'ERROR',
                'handlers': ['console'],
                'propagate': False
            },
            'raven': {
                'level': 'DEBUG',
                'handlers': ['console'],
                'propagate': False
            },
            'sentry.errors': {
                'level': 'DEBUG',
                'handlers': ['console'],
                'propagate': False
            },
            'django.request': {
                'handlers': ['mail_admins'],
                'level': 'ERROR',
                'propagate': True
            }
        }
    }

Stack trace of the exception:

    ERROR 2013-02-25 16:07:56,938 client 17887 140238506051328 Unable to record event: cannot import name Group
    Traceback (most recent call last):
      File "/home/user/src/virtualenv/lib/python2.7/site-packages/raven/contrib/django/client.py", line 148, in send
        return self.send_integrated(kwargs)
      File "/home/user/src/virtualenv/lib/python2.7/site-packages/raven/contrib/django/client.py", line 153, in send_integrated
        from sentry.models import Group
    ImportError: cannot import name Group

I am trying to figure out what is going wrong, but without luck till now. My hunch is it might be a version problem between Raven and Sentry.

Please help me out if you have any idea what might be causing the problem.

In case I missed some info, do let me know.

Thanks!!

Was it helpful?

Solution

This was because of version conflicts of sentry and raven. Please check the versions at the time of installing. I used raven 3.3.3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top