unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* Exception with rails and devise
@ 2023-12-13 14:01 Luca Berruti
  2023-12-14 23:09 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Luca Berruti @ 2023-12-13 14:01 UTC (permalink / raw)
  To: unicorn-public

Hello,

Unicorn 6.1.0 raises this exception when running on Rails 7.1.2 and Devise 4.9.3 within the production environment:

E, [2023-12-13T13:38:12.560072 #20] ERROR -- : app error: undefined method `=~' for ["_app_session=KbIfGKW%2FGniK%2B7V6boKx8Gh4VYYlk45gI14J5%2F4pSmJQkl890zAknDviSCWCBY4Jx%2FIa86Et1h%2Bad1laCN8sVf%2B9IgtgvN%2BhVLrHBYb9zqmX43LyNqKTEOaEfbU0H6EMEDS6TVJqmtP%2FVzGTf08uP8wgQFMCM6t5jWahl4h9dc47jC96h8BTF8%2FQDXHWPpcj6yzCC3aXjZqm7k2LEPQfXdmXJPwXS57sEYNk518vYWg%2BVOop16o7Lwqh3enXJVd1w%2F6CRFt5cFFlzsDHB7%2FA4%2BPWNLU%3D--v8qFRntrlxCgtLDy--7bldsiyqYyL2eow3kk348A%3D%3D; path=/; secure; httponly; SameSite=Lax"]:Array (NoMethodError)
E, [2023-12-13T13:38:12.560131 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_response.rb:43:in `block in http_response_write'
E, [2023-12-13T13:38:12.560152 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_response.rb:34:in `each'
E, [2023-12-13T13:38:12.560165 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_response.rb:34:in `http_response_write'
E, [2023-12-13T13:38:12.560176 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:645:in `process_client'
E, [2023-12-13T13:38:12.560186 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:739:in `worker_loop'
E, [2023-12-13T13:38:12.560206 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:547:in `spawn_missing_workers'
E, [2023-12-13T13:38:12.560226 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_server.rb:143:in `start'
E, [2023-12-13T13:38:12.560239 #20] ERROR -- : /usr/local/bundle/gems/unicorn-6.1.0/bin/unicorn:128:in `<top (required)>'
E, [2023-12-13T13:38:12.560249 #20] ERROR -- : bin/unicorn:27:in `load'
E, [2023-12-13T13:38:12.560259 #20] ERROR -- : bin/unicorn:27:in `<main>'


Changing rails' "config.force_ssl" option to "false" makes things to work.

Looking at /usr/local/bundle/gems/unicorn-6.1.0/lib/unicorn/http_response.rb:43, it seems that the cookie header content is a string when force_ssl=false but becomes an array with force_ssl=true

best regards,
Luca


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Exception with rails and devise
  2023-12-13 14:01 Exception with rails and devise Luca Berruti
@ 2023-12-14 23:09 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2023-12-14 23:09 UTC (permalink / raw)
  To: Luca Berruti; +Cc: unicorn-public

Luca Berruti <nadirio@gmail.com> wrote:
> Hello,
> 
> Unicorn 6.1.0 raises this exception when running on Rails 7.1.2 and Devise 4.9.3 within the production environment:
> 
> E, [2023-12-13T13:38:12.560072 #20] ERROR -- : app error: undefined method `=~' for ["_app_session=KbIfGKW%2FGniK%2B7V6boKx8Gh4VYYlk45gI14J5%2F4pSmJQkl890zAknDviSCWCBY4Jx%2FIa86Et1h%2Bad1laCN8sVf%2B9IgtgvN%2BhVLrHBYb9zqmX43LyNqKTEOaEfbU0H6EMEDS6TVJqmtP%2FVzGTf08uP8wgQFMCM6t5jWahl4h9dc47jC96h8BTF8%2FQDXHWPpcj6yzCC3aXjZqm7k2LEPQfXdmXJPwXS57sEYNk518vYWg%2BVOop16o7Lwqh3enXJVd1w%2F6CRFt5cFFlzsDHB7%2FA4%2BPWNLU%3D--v8qFRntrlxCgtLDy--7bldsiyqYyL2eow3kk348A%3D%3D; path=/; secure; httponly; SameSite=Lax"]:Array (NoMethodError)

That looks like a Rack 3 response with an array and 6.1.0
doesn't support Rack 3.  This patch ought to work:

https://yhbt.net/unicorn-public/ZHlX3HkxP6mK16If@jeremyevans.local/raw

(commit 9d7bab0bc2211b20806d4d0289a7ea992e49a8a1 in unicorn.git)

I'll try to get a unicorn 7.x release soon but tests take
forever to run on ancient HW and I need to ration releases to
keep download counts low in order to stay under the MFA
threshold on Rubygems.org

I don't ever want users viewing me as trustworthy nor liable for
anything I do, so no MFA nor sigs from me; just source + docs :>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-14 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13 14:01 Exception with rails and devise Luca Berruti
2023-12-14 23:09 ` Eric Wong

Code repositories for project(s) associated with this public inbox

	http://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).