Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

3.1 active_record_store "domain: :all" TypeError #2483

Closed
JeanMertz opened this Issue · 42 comments
@JeanMertz

update: see the comment below for a clean 3.1 app with the same error.

See Pow issue #199

Basically I keep getting a can't convert Symbol into String error when I change the domain for session_store to :all.

@JeanMertz

From the lack of comments I presume this isn't an issue in rails. Although I am still having this issue on my app, not sure what is going on though.

I managed to work around the issue by setting the domain to .mydomain.dev, and this worked fine, until I started testing custom domains just a few minutes ago. Now I really need :all again to support custom domains and allow for flash messages cross-requests on these domains (not cross-domain), but this is when the error returns again...

My session_store.rb:

Manager::Application.config.session_store :active_record_store, key: "_manager_session", domain: :all

Here is a (cucumber/capybara test suite) backtrace, it happens in development as well:

  can't convert Symbol into String (TypeError)
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/utils.rb:190:in `+'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/utils.rb:190:in `set_cookie_header!'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/session/abstract/id.rb:323:in `set_cookie'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/session/abstract/id.rb:311:in `commit_session'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/session/abstract/id.rb:196:in `context'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/session/abstract/id.rb:190:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/cookies.rb:326:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/activerecord-3.1.0.rc8/lib/active_record/query_cache.rb:62:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/activerecord-3.1.0.rc8/lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/activesupport-3.1.0.rc8/lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/activesupport-3.1.0.rc8/lib/active_support/callbacks.rb:81:in `run_callbacks'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/sendfile.rb:101:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-rails-1.0.2/lib/cucumber/rails/action_controller.rb:10:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/railties-3.1.0.rc8/lib/rails/rack/logger.rb:13:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/methodoverride.rb:24:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/runtime.rb:17:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/activesupport-3.1.0.rc8/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/lock.rb:15:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/actionpack-3.1.0.rc8/lib/action_dispatch/middleware/static.rb:53:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/railties-3.1.0.rc8/lib/rails/engine.rb:455:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/urlmap.rb:52:in `block in call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/urlmap.rb:46:in `each'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-1.3.2/lib/rack/urlmap.rb:46:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-test-0.6.1/lib/rack/mock_session.rb:30:in `request'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-test-0.6.1/lib/rack/test.rb:219:in `process_request'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/rack-test-0.6.1/lib/rack/test.rb:66:in `post'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/rack_test/browser.rb:53:in `process'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/rack_test/browser.rb:19:in `submit'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/rack_test/form.rb:64:in `submit'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/rack_test/node.rb:58:in `click'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-rails-1.0.2/lib/cucumber/rails/capybara/javascript_emulation.rb:16:in `click_with_javascript_emulation'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/node/element.rb:93:in `click'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/node/actions.rb:38:in `click_button'
  (eval):2:in `click_button'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/capybara-1.0.1/lib/capybara/dsl.rb:139:in `click_button'
  /Users/Jean/nulvierdrie/manager/source/manager/features/step_definitions/reset_password_steps.rb:8:in `block in <top (required)>'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/core_ext/instance_exec.rb:48:in `instance_exec'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/core_ext/instance_exec.rb:48:in `block in cucumber_instance_exec'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/core_ext/instance_exec.rb:69:in `cucumber_run_with_backtrace_filtering'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/core_ext/instance_exec.rb:36:in `cucumber_instance_exec'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/rb_support/rb_step_definition.rb:62:in `invoke'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/step_match.rb:26:in `invoke'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/step_invocation.rb:59:in `invoke'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/step_invocation.rb:38:in `accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:99:in `block in visit_step'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:98:in `visit_step'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/step_collection.rb:15:in `block in accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/step_collection.rb:14:in `each'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/step_collection.rb:14:in `accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:93:in `block in visit_steps'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:92:in `visit_steps'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/scenario.rb:55:in `block (2 levels) in accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:79:in `block (2 levels) in with_hooks'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:95:in `before_and_after'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:78:in `block in with_hooks'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime/support_code.rb:115:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime/support_code.rb:115:in `block (3 levels) in around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/language_support/language_methods.rb:13:in `block in around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/language_support/language_methods.rb:95:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/language_support/language_methods.rb:95:in `execute_around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/language_support/language_methods.rb:12:in `around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime/support_code.rb:114:in `block (2 levels) in around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime/support_code.rb:112:in `call'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime/support_code.rb:112:in `around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:90:in `around'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:77:in `with_hooks'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/scenario.rb:53:in `block in accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/scenario.rb:108:in `with_visitor'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/scenario.rb:47:in `accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:51:in `block in visit_feature_element'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:50:in `visit_feature_element'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/feature.rb:43:in `block in accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/feature.rb:42:in `each'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/feature.rb:42:in `accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:20:in `block in visit_feature'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:19:in `visit_feature'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/features.rb:29:in `block in accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/features.rb:17:in `each'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/features.rb:17:in `each'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/features.rb:28:in `accept'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:14:in `block in visit_features'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:163:in `broadcast'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/ast/tree_walker.rb:13:in `visit_features'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/runtime.rb:45:in `run!'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:43:in `execute!'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/lib/cucumber/cli/main.rb:20:in `execute'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/gems/cucumber-1.0.2/bin/cucumber:14:in `<top (required)>'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/bin/cucumber:19:in `load'
  /Users/Jean/.rvm/gems/ruby-1.9.2-p290@manager/bin/cucumber:19:in `<main>'
  features/reset_password.feature:14:in `And I fill in the correct email'
@JeanMertz

Well I am going to bump this again, I could be totally wrong on how to use this, but in a clean 3.1 app, with only scaffold post this works:

Testapp::Application.config.session_store :cookie_store, key: '_testapp_session', domain: :all

But this fails:

Testapp::Application.config.session_store :active_record_store, key: '_testapp_session', domain: :all

Here is another trace:

TypeError in PostsController#index

can't convert Symbol into String

rack (1.3.2) lib/rack/utils.rb:190:in `+'
rack (1.3.2) lib/rack/utils.rb:190:in `set_cookie_header!'
rack (1.3.2) lib/rack/session/abstract/id.rb:323:in `set_cookie'
rack (1.3.2) lib/rack/session/abstract/id.rb:311:in `commit_session'
rack (1.3.2) lib/rack/session/abstract/id.rb:196:in `context'
rack (1.3.2) lib/rack/session/abstract/id.rb:190:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/cookies.rb:326:in `call'
activerecord (3.1.0) lib/active_record/query_cache.rb:62:in `call'
activerecord (3.1.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.0) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.0) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.0) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.2) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.0) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.2) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.2) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.0) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.2) lib/rack/lock.rb:15:in `call'
actionpack (3.1.0) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.0) lib/rails/engine.rb:455:in `call'
railties (3.1.0) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.0) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.2) lib/rack/handler/webrick.rb:59:in `service'
/Users/Jean/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
/Users/Jean/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
/Users/Jean/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
@d11wtq

Running into this trying to migrate to 3.1.0 too. The problem actually appears to be in action_dispatch/middleware/cookies.rb not converting the :all special case to the domain name.

@JeanMertz

Wow, I am not the only one with this issue? I switched to using the cookie_store for now. I find it weird though that this skipped past the tests (if there are any), and no one else brought up this issue. There must be plenty of Rails apps using this method, no?

@d11wtq

I'm using my own custom SessionStore and am trying to see if I can work around the issue, but it appears that there are some places where #handle_options needs to be called in CookieJar (defined in "action_dispatch/middleware/cookies.rb") in order to convert :all to a valid cookie domain. It is called in CookieJar itself, but not in any of its subclasses, and the issue stems from line 190 in rack/utils.rb doing this:

        domain  = "; domain="  + value[:domain] if value[:domain]

Trying to concatenate a String with the Symbol :all fails. value here is a Hash of the form:

{ :value => "actual value", :domain => :all, :path => "/", :expires_in => " .... " }

Rails should have swapped out the :all domain before handing off to Rack, but obviously there's a regression here.

Still poking around.

@d11wtq

I've worked around this in my own SessionStore. What was happening was that Rails was passing the cookie information to Rack as-is, without converting the :domain to :all. This meant that Rack internally could not set cookies, but Rails could set them by passing the correct domain for every cookie being set. Rack internally caches the invalid cookie information in a @default_options hash and it attempts to "commit" the session without Rails (thinking that :all is the domain it should use).

Rails 3.0 only had 3 parameters to set_cookie and destroy has changed too. Both of these method now take an options parameter, which contains the cookie domain used for sessions. I've worked around the problem by mutating this options hash in the same way CookieJar does it (in fact, I just use CookieJar directly). I think there must have been some substantial refactoring of the Session storage to more directly back off of Rack, or something like that, but whatever it was has broken things.

Here's the method I'm invoking in my session handler.

      def handle_options(env, options)
        @cookie_jar ||= ActionDispatch::Request.new(env).cookie_jar
        @cookie_jar.handle_options(options)
      end

It'd be good if this could be fixed so that the options hash passed to set_session and destroy_session is actually "correct" in the first place ;)

@d11wtq

Yup, I see the issue in the ActiveRecord session store:

https://github.com/rails/rails/blob/master/activerecord/lib/active_record/session_store.rb#L317

It receives options in set_session, but doesn't do anything with them. Mutating away :domain => :all here will fix things. There surely has to be a better way though.

5am seems like a good time to go to bed! o_O

@getscripted

I'm experiencing the same issue. Temporarily fixed this by explicitly setting domains based on the current environment, e.g. for development:
MySuperApp::Application.config.session_store :active_record_store, :key => '_my_super_session', :domain => ".lvh.me"

Thank you guys for pointing me out where this "can't convert symbol into string" error even comes from, it would take lots of time to figure this out from the stacktrace...

@calvincorreli

Just wanted to +1 this. I've been bitten by the same problem.

Haven't been able to figure out what the proper fix is yet. It's pretty complex layered code.

@d11wtq

For those who are stuck and noting the lack of any response from the core team, this should get you up and running #3047

@macmartine

+1 on hitting this

@mateomurphy

Hitting this as well

@davout

+1

@carlesso

+1

@nviennot

+1

@calvinl

+1

@pdenya

+1

@rafaelfranca

Fixed by #6084

@d11wtq

Awesome, thanks!

@getscripted

Thanks a lot!

@mhuggins

What version of Rails is #6084 available in? I'm using Rails 3.2.6 and am still encountering this issue in conjunction with redis-store.

@rafaelfranca
Owner

It will be available only in 4.0.0

@mhuggins

Just tried upgrading to the latest version of Rails (3.2.7), and it's still not working.

MyApp::Application.config.session_store :redis_store, domain: :all,
  servers: { host: 'localhost', port: 6379, db: 0, namespace: 'myapp:sessions' }

Stack trace:

TypeError (can't convert Symbol into String):
  rack (1.4.1) lib/rack/utils.rb:219:in `+'
  rack (1.4.1) lib/rack/utils.rb:219:in `set_cookie_header!'
  rack (1.4.1) lib/rack/session/abstract/id.rb:342:in `set_cookie'
  rack (1.4.1) lib/rack/session/abstract/id.rb:330:in `commit_session'
  rack (1.4.1) lib/rack/session/abstract/id.rb:206:in `context'
  rack (1.4.1) lib/rack/session/abstract/id.rb:200:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/cookies.rb:338:in `call'
  activerecord (3.2.7) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `_run__3715311219079540099__call__697857605585126000__callbacks'
  activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.7) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.7) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/reloader.rb:65:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.7) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.7) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.7) lib/action_dispatch/middleware/static.rb:62:in `call'
  railties (3.2.7) lib/rails/engine.rb:479:in `call'
  railties (3.2.7) lib/rails/application.rb:220:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.7) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
  /Users/mhuggins/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
  /Users/mhuggins/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
  /Users/mhuggins/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
@rafaelfranca
Owner

Just backported to 3-2-stable @ 393c652. Could you try with this branch?

@mhuggins

Awesome, looks like that fixed it! Thanks :)

@mhuggins

Actually, I retract that. I'm still seeing the same stack trace error. :(

@rafaelfranca
Owner

@mrudhukar could you try with master branch?

@rafaelfranca

@mhuggins could you try the pull request #7316?

@mhuggins

Just updated #7316 with my findings.

@krzkrzkrz

Issue still happens

@usbsnowcrash

I am still getting this issue when using the redis session store on Rails 4.

@rafaelfranca

@usbsnowcrash could you open a new issue with a way to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.