rails/rails — Issue #4652: Random ArgumentError (A secret is required...
Author: masterkain
Created: 2012-01-24 22:36:45+00:00
State: open

Using Rails 3.2.0 sometimes when I run my server instance (thin, rainbows) and do the first request to the app I'm greeted with this:

ArgumentError (A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb):
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:316:in `ensure_secret_secure'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:281:in `initialize'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:228:in `new'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:228:in `signed'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/cookie_store.rb:53:in `block in unpacked_cookie_data'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/cookie_store.rb:51:in `unpacked_cookie_data'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/cookie.rb:98:in `extract_session_id'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:51:in `block in extract_session_id'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:55:in `stale_session_check!'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:51:in `extract_session_id'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:43:in `load_session_id!'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:32:in `[]'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:262:in `current_session_id'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:268:in `session_exists?'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:107:in `exists?'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:122:in `load_for_read!'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:64:in `has_key?'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/flash.rb:258:in `ensure in call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/flash.rb:259:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:205:in `context'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/session/abstract/id.rb:200:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/cookies.rb:338:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/query_cache.rb:64:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:443:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `_run__3746064330330596767__call__2880902640516870992__callbacks'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/rack/logger.rb:26:in `call_app'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/rack/logger.rb:16:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/methodoverride.rb:21:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.4.1/lib/rack/runtime.rb:17:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.2.0/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/static.rb:53:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/engine.rb:479:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/application.rb:220:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:80:in `block in pre_process'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:78:in `catch'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/thin-1.3.1/lib/thin/connection.rb:78:in `pre_process'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `call'
/Users/kain/.rvm/gems/ruby-1.9.3-p0/gems/eventmachine-0.12.10/lib/eventmachine.rb:1060:in `block in spawn_threadpool'