sentry.manager.get_or_create PicklingError #570

Closed
dbazhal opened this Issue Aug 9, 2012 · 3 comments

Comments

Projects
None yet
3 participants

dbazhal commented Aug 9, 2012

Good day.

Rinning with:

sentry==4.8.6
django-pylibmc==0.2.3
pylibmc==1.2.3

Using caching backend:

django_pylibmc.memcached.PyLibMCCache

Getting an error trying to create new Project object:

Stacktrace (most recent call last):

  File "django_sentry_ldap_import/management/commands/ldap_import.py", line 383, in handle_noargs
    per_search_object_import(search_object)

  File "django_sentry_ldap_import/management/commands/ldap_import.py", line 347, in per_search_object_import
    get_project(slug_name, real_name, owner, manager_name_list, team)

  File "django_sentry_ldap_import/management/commands/ldap_import.py", line 289, in get_project
    'name': real_name, 'owner': owner, 'team': team, 'public': False

  File "sentry/manager.py", line 219, in get_or_create
    instance, created = super(BaseManager, self).get_or_create(defaults=defaults, **kwargs)

  File "django/db/models/manager.py", line 134, in get_or_create
    return self.get_query_set().get_or_create(**kwargs)

  File "django/db/models/query.py", line 449, in get_or_create
    obj.save(force_insert=True, using=self.db)

  File "sentry/models.py", line 154, in save
    super(Project, self).save(*args, **kwargs)

  File "django/db/models/base.py", line 463, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)

  File "django/db/models/base.py", line 565, in save_base
    created=(not record_exists), raw=raw, using=using)

  File "django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)

  File "sentry/manager.py", line 135, in _post_save
    cache.set(self._get_from_cache_key(**{pk_name: pk_val}), instance, self.cache_ttl)

  File "django_pylibmc/memcached.py", line 99, in set
    MIN_COMPRESS)

Local values passed to django_pylibmc/memcached.py _cache.set() are:



key 
':1:modelcache:Project:f41b09be582711e207a7f362cd32930f'
self    
'<django_pylibmc.memcached.PyLibMCCache object at 0x1545bd0>'
timeout 
300
value   
'<Project: Test ldap imported project (cool-ldap-imported-project)>'
version 
None

for sentry/manager.py cache.set(self._get_from_cache_key(**{pk_name: pk_val}), instance, self.cache_ttl):

<
db  
'default'
instance    
'<Project: Test ldap imported project (cool-ldap-imported-project)>'
key 
'slug'
kwargs  
{'created': True,
 'raw': False,
 'sender': "<class 'sentry.models.Project'>",
 'signal': '<django.dispatch.dispatcher.Signal object at 0x136cb90>',
 'using': 'default'}
pk_name 
'id'
pk_names    
('pk', 'id')
pk_val  
10
self    
'<sentry.manager.ProjectManager object at 0x191c6d0>'
Owner

dcramer commented Aug 17, 2012

Do you know what the actual pickle error was? I havent seen this before.

dbazhal commented Aug 17, 2012

Huh, that was pickling error -)
I'm not sure that I realy understood the point of this error - it seem to me that trace didn't catch it's exact appearance point.
I guess the reason of error appearance is the fact of trying to cache model instance. And it looks like django memcached backend doesn't catch PicklingError and raises it.
I could attach error json file from sentry if it could help.
And I still keep getting this error when try to get_or_create ANY of sentry models instance - Team, Project, TeamMember etc. To avoid error appearance i can just run same function once more(for existing object) -)

Contributor

heynemann commented Apr 28, 2013

@dbajal Can you confirm if this is still an issue?

dcramer closed this Apr 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment