Skip to content

Instantly share code, notes, and snippets.

@gronnbeck
Created July 25, 2012 07:17
Show Gist options
  • Save gronnbeck/3174892 to your computer and use it in GitHub Desktop.
Save gronnbeck/3174892 to your computer and use it in GitHub Desktop.
2012-07-25T07:15:35,701 [ERROR] [hoopla.sync ] Unhandled exception in messageReceived. Traceback follows
Traceback (most recent call last):
File "/Users/gronnbeck/Development/hoopla/backend/hoopla/sync.py", line 178, in messageReceived
yield self._handle_beeps(message['beeps'])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/defer.py", line 1018, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/failure.py", line 350, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/Users/gronnbeck/Development/hoopla/backend/hoopla/sync.py", line 196, in _handle_beeps
yield self._write_beeps(beeps)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/internet/defer.py", line 1018, in _inlineCallbacks
result = result.throwExceptionIntoGenerator(g)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/failure.py", line 350, in throwExceptionIntoGenerator
return g.throw(self.type, self.value, self.tb)
File "/Users/gronnbeck/Development/hoopla/backend/hoopla/model.py", line 76, in wrapper
defer.returnValue( (yield threads.deferToThread(method, self, session, *args, **kwargs)) )
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/threadpool.py", line 207, in _worker
result = context.call(ctx, function, *args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
File "/Users/gronnbeck/Development/hoopla/backend/hoopla/sync.py", line 205, in _write_beeps
session.commit()
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/session.py", line 656, in commit
self.transaction.commit()
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/session.py", line 314, in commit
self._prepare_impl()
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/session.py", line 298, in _prepare_impl
self.session.flush()
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/session.py", line 1583, in flush
self._flush(objects)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/session.py", line 1654, in _flush
flush_context.execute()
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/unitofwork.py", line 331, in execute
rec.execute(self)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/unitofwork.py", line 475, in execute
uow
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/persistence.py", line 64, in save_obj
table, insert)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/orm/persistence.py", line 530, in _emit_insert_statements
execute(statement, multiparams)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/engine/base.py", line 1449, in execute
params)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/engine/base.py", line 1584, in _execute_clauseelement
compiled_sql, distilled_params
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/engine/base.py", line 1698, in _execute_context
context)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/engine/base.py", line 1691, in _execute_context
context)
File "build/bdist.macosx-10.7-intel/egg/sqlalchemy/engine/default.py", line 331, in do_execute
cursor.execute(statement, parameters)
IntegrityError: (IntegrityError) insert or update on table "beeps" violates foreign key constraint "beeps_ticket_id_fkey"
DETAIL: Key (ticket_id)=(340599958022) is not present in table "tickets".
'INSERT INTO beeps (uuid, ticket_id, beeped, data) VALUES (%(uuid)s, %(ticket_id)s, %(beeped)s, %(data)s)' {'beeped': datetime.datetime(2012, 7, 24, 10, 44, 40, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=0, name='UTC')), 'data': '{"hm": 424242}', 'uuid': u'96c72853-ac66-4aae-8c34-76a84e4b91ea', 'ticket_id': 340599958022}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment