-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session store @env
is nil with Rails 7
#244
Comments
Thanks for the report Chad, it seems JRuby-Rack's (servlet) session store isn't compatible with Rack 2.2. In the mean-time you could switch to simply using the Rails default (cookie) session store.. |
We've had it working with Rack 2.2 (somehow) via Rails 5.2, 6.0 and 6.1 for some time so not sure what changed about Rails 7 that broke this. There's also this that might be related 😅 https://github.com/gocd/gocd/blob/c4888b585a239dd32b32a532d0de0b286c62c687/server/src/main/webapp/WEB-INF/rails/config/initializers/session_store.rb#L18 So perhaps it worked in a very limited set of circumstances/usages/hacks. Almost all auth and session 'stuff' for our app is handled in Java-land prior to getting to the |
yeah, sounds like the fix should be rather simple than, but it still requires someone to do "a lot of" work (ideally getting the test suite/CI running with Rails versions we intend to support). I would be happy to keep this project going but lack time to even properly support my other oss work 😞 ...
✔️ that is the proper way to switch to the servlet store but only in a servlet container environment (if you simply remove that initializer this should no longer block you from running) |
Our current setup is using Jetty started inline as servlet container, deploying a war into Jetty programmatically, of which RackServlet is one of a few servlets handling different routes and then splitting (with some url rewriting) across. Some routes use Java Spring FW, some use Rails/Rack via JRuby. Is that the type of servlet container usage you're referring to that could make this code appropriate? I believe that's why that is there (not being around when this was all wired together and just taking over as defacto maintainer I'm doing some guessing as to intent and how this all works!) Regardless, for my own curiosity I'll try removing and see what happens 😅 |
Jetty "inline" (pbly aka embedded) servlet container is still a servlet container 😜. JRuby-Rack (e.g. from a configured context-listener) starts an embedded JRuby which eventually sets the
sounds like a fun project 😉 |
I don't really have any deep experience with Rack or JRuby Rack - so please excuse the question if it speaks to ignorance.
After upgrading a JRuby-on-Rails application from Rails
6.1.7.6
to7.0.8
I get the following stack traces when accessing any rails pages/controllers.coming from
jruby-rack/src/main/ruby/jruby/rack/session_store.rb
Line 45 in 710c1a4
I'm not quite sure how the
@env
ends upnil
, but there seems to be some Rails-version-coupled stuff here.jruby-rack/src/main/ruby/jruby/rack/session_store.rb
Lines 13 to 58 in 710c1a4
Does anyone know what might have changed that could perhaps break rack or jruby-rack to point me in the right direction? Something to do with autoloading?
The text was updated successfully, but these errors were encountered: