Lots of tracebacks for authenticated calls

Bug #983106 reported by Anthony Lenton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Apps Directory
Fix Released
Medium
Anthony Lenton

Bug Description

We're getting around 4k of these tracebacks on a daily basis:

Traceback (most recent call last):
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/core/handlers/base.py", line 111, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/views/decorators/vary.py", line 22, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/piston/resource.py", line 74, in __call__
    if not self.authentication.is_authenticated(request):
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/src/webcatalog/auth.py", line 81, in is_authenticated
    consumer, token, parameters = self.validate_token(request)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/src/webcatalog/auth.py", line 140, in validate_token
    return oauth_server.verify_request(oauth_request)
  File "/usr/lib/python2.6/dist-packages/oauth/oauth.py", line 436, in verify_request
    self._check_signature(oauth_request, consumer, token)
  File "/usr/lib/python2.6/dist-packages/oauth/oauth.py", line 500, in _check_signature
    self._check_nonce(consumer, token, nonce)
  File "/usr/lib/python2.6/dist-packages/oauth/oauth.py", line 528, in _check_nonce
    nonce = self.data_store.lookup_nonce(consumer, token, nonce)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/src/webcatalog/models/oauthtoken.py", line 204, in lookup_nonce
    Nonce.create(consumer.key, token.key, nonce)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/src/webcatalog/models/oauthtoken.py", line 149, in create
    return consumer.nonce_set.create(token=token, nonce=nonce)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/fields/related.py", line 436, in create
    return super(RelatedManager, self.db_manager(db)).create(**kwargs)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/manager.py", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/query.py", line 360, in create
    obj.save(force_insert=True, using=self.db)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/base.py", line 553, in save_base
    result = manager._insert(values, return_id=update_pk, using=using)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/manager.py", line 195, in _insert
    return insert_query(self.model, values, **kwargs)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/query.py", line 1436, in insert_query
    return query.get_compiler(using=using).execute_sql(return_id)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/sql/compiler.py", line 791, in execute_sql
    cursor = super(SQLInsertCompiler, self).execute_sql(None)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/models/sql/compiler.py", line 735, in execute_sql
    cursor.execute(sql, params)
  File "/srv/uwc.ubuntu.com/production/ubuntu-webcatalog/sourcecode/django/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
    return self.cursor.execute(query, args)
IntegrityError: duplicate key value violates unique constraint "webcatalog_nonce_nonce_key"

This might be that we need to clear out the nonce table on a daily basis.

Related branches

Changed in ubuntu-webcatalog:
status: New → Confirmed
Changed in ubuntu-webcatalog:
status: Confirmed → Fix Committed
assignee: nobody → Anthony Lenton (elachuni)
milestone: none → 12.04
importance: Undecided → Medium
Changed in ubuntu-webcatalog:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.