plataformatec/devise — Issue #1482: "time must be positive" error on Devise::SessionsController#create
Author: jcollum
Created: 2011-12-02 06:13:56+00:00
State: open

I've seen this error a few times and narrowed it down to Devise. Occasionally I'll get this:

```
ArgumentError in Devise::SessionsController#create

time must be positive
```

Here's the stack:

```
bson (1.5.1) lib/bson/bson_c.rb:28:in `deserialize'
bson (1.5.1) lib/bson/bson_c.rb:28:in `deserialize'
mongo (1.5.1) lib/mongo/networking.rb:211:in `read_documents'
mongo (1.5.1) lib/mongo/networking.rb:158:in `receive'
mongo (1.5.1) lib/mongo/networking.rb:123:in `receive_message'
mongo (1.5.1) lib/mongo/cursor.rb:470:in `block in send_initial_query'
mongo (1.5.1) lib/mongo/util/logging.rb:28:in `instrument'
mongo (1.5.1) lib/mongo/cursor.rb:468:in `send_initial_query'
mongo (1.5.1) lib/mongo/cursor.rb:458:in `refresh'
mongo (1.5.1) lib/mongo/cursor.rb:128:in `next'
mongo (1.5.1) lib/mongo/collection.rb:288:in `find_one'
mongoid (2.3.4) lib/mongoid/collections/master.rb:25:in `block in find_one'
mongoid (2.3.4) lib/mongoid/collections/retry.rb:29:in `retry_on_connection_failure'
mongoid (2.3.4) lib/mongoid/collections/master.rb:24:in `find_one'
mongoid (2.3.4) lib/mongoid/collection.rb:60:in `find_one'
mongoid (2.3.4) lib/mongoid/contexts/mongo.rb:161:in `first'
D:in `first'
orm_adapter (0.0.5) lib/orm_adapter/adapters/mongoid.rb:38:in `find_first'
devise (1.5.2) lib/devise/models/authenticatable.rb:119:in `find_first_by_auth_conditions'
devise (1.5.2) lib/devise/models/authenticatable.rb:115:in `find_for_authentication'
devise (1.5.2) lib/devise/models/database_authenticatable.rb:128:in `find_for_database_authentication'
devise (1.5.2) lib/devise/strategies/database_authenticatable.rb:8:in `authenticate!'
warden (1.1.0) lib/warden/strategies/base.rb:53:in `_run!'
```

The app loads fine but as soon as I log in to Devise I get this message.

Win 7 64b