unit: Doesn't work after rails 7.1 update
Updated a rails app from 7.0 to 7.1. Getting the following error in unit logs:
2023/10/18 02:02:58 [error] 977151#977151 [unit] #9: Ruby: Wrong header entry 'value' from application
2023/10/18 02:02:58 [error] 977151#977151 [unit] #9: Ruby: Failed to run ruby script
might be related to rack upgrade from 2.x to 3.x. Locking rack to ~> 2.0 fixes the issue.
Unit version: 1.31.0.
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 29 (23 by maintainers)
Commits related to this issue
- Ruby: Handle response field arrays. @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby:... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays. @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby:... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays. @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby:... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays. @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby:... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays. @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby:... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: ... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: ... — committed to ac000/unit by ac000 8 months ago
- Ruby: Handle response field arrays @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: ... — committed to hongzhidao/unit by ac000 8 months ago
- Ruby: Handle response field arrays @xeron on GitHub reported an issue whereby with a Rails 7.1 application they were getting the following error 2023/10/22 20:57:28 [error] 56#56 [unit] #8: Ruby: ... — committed to nginx/unit by ac000 8 months ago
Will apply and give it a spin! Should add some pytest for this as well! But LGTM! @xeron great first issue! Thanks!!
@ac000 BTW I just realized your build of my sample app fails because of the memory usage. Seems like docker doesn’t have enough memory for
bundle installcommand.Anyway, I applied your patch from https://github.com/nginx/unit/issues/974#issuecomment-1771309585 and rerun the test:
Quick search through
rackPRs points to https://github.com/rack/rack/pull/1793 and https://github.com/rack/rack/issues/2129.Seems like starting with rack 3.0.0 header could be represented by a String or an Array of Strings.
The fix for this has been merged.
This patch should make things work
It handles empty response headers and array response fields.
E.g The following
produces
You’ll notice it also handles
nilarray values.I seem to have managed to setup a Rails 7.1.1 environment on Fedora 38 and created the basic rails app from here by doing
My Unit config is simply
Hitting the app gives…
This is using Rack 3.0.8 as confirmed by strace(1)