bkeepers/qu — Issue #32: BSON::InvalidDocument exception
Author: fbjork
Created: 2011-10-26 22:46:46+00:00
State: open

Getting an exception when I run the following:

options = { generated_at: Time.current, meta: { state: :processed, source: 'Chat', client: 'iPhone' } }
Qu.enqueue(StatsWorker, "Push Notifications", 1, options)

Stack trace:
BSON::InvalidDocument exception raised:

```ruby
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/bson-1.3.1/lib/bson/bson_c.rb:24:in `serialize'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/bson-1.3.1/lib/bson/bson_c.rb:24:in `serialize'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/collection.rb:872:in `block in insert_documents'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/collection.rb:871:in `each'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/collection.rb:871:in `insert_documents'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongo-1.3.1/lib/mongo/collection.rb:305:in `insert'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-mongo-0.1.3/lib/qu/backend/mongo.rb:55:in `enqueue'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu.rb:29:in `enqueue'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/models/apn/notification.rb:87:in `process_push!'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/stateflow-0.4.2/lib/stateflow/transition.rb:33:in `execute_action'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/stateflow-0.4.2/lib/stateflow/transition.rb:23:in `find_to_state'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/stateflow-0.4.2/lib/stateflow/event.rb:19:in `fire'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/stateflow-0.4.2/lib/stateflow.rb:61:in `fire_event'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/stateflow-0.4.2/lib/stateflow.rb:35:in `block (2 levels) in stateflow'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/workers/push_notification_worker.rb:7:in `block in perform'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/workers/abstract_worker.rb:8:in `block (2 levels) in wrap'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/mongoid-2.2.3/lib/mongoid.rb:130:in `unit_of_work'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/workers/abstract_worker.rb:8:in `block in wrap'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/benchmarkable.rb:43:in `block in benchmark'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/benchmark.rb:5:in `block in ms'
2011-10-26T22:41:04+00:00 app[qu.1]: /usr/local/lib/ruby/1.9.1/benchmark.rb:309:in `realtime'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/benchmark.rb:5:in `ms'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/benchmarkable.rb:43:in `benchmark'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/workers/abstract_worker.rb:7:in `wrap'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/app/workers/push_notification_worker.rb:5:in `perform'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/payload.rb:23:in `perform'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/worker.rb:49:in `work'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/worker.rb:57:in `block in start'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/worker.rb:57:in `loop'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/worker.rb:57:in `start'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/qu-0.1.3/lib/qu/tasks.rb:5:in `block (2 levels) in '
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/task.rb:205:in `call'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:112:in `invoke_task'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:90:in `block (2 levels) in top_level'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/gems/rake-0.9.2/lib/rake/application.rb:62:in `block in run'
2011-10-26T22:41:04+00:00 app[qu.1]: /app/vendor/bundle/ruby/1.9.1/bin/rake:19:in `load'
```