Skip to content
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

Prerelease app is broken because of a Rack/Unicorn incompatibility #2730

Closed
nickcharlton opened this issue Dec 24, 2024 · 1 comment · Fixed by #2744
Closed

Prerelease app is broken because of a Rack/Unicorn incompatibility #2730

nickcharlton opened this issue Dec 24, 2024 · 1 comment · Fixed by #2744
Labels
bug breakages in functionality that is implemented documentation how to use administrate, examples and common usage
Milestone

Comments

@nickcharlton
Copy link
Member

We're getting the following error log when trying to load /admin on the prerelease demo app:

2024-12-24T14:40:15.544423+00:00 app[web.1]: E, [2024-12-24T14:40:15.544391 #5] ERROR -- : app error: undefined method `=~' for ["_administrate-prototype_session=aW1pVHNZcmF0WG9zSHJ0UEFJQWI5cUxKRjVWS2JuUWZxZktMSENRclhEQTZlZzY2VVQzTEc3d1VVR21wU3RaRGU4cWtWazVOM29UdCt4VzFMU0lPMG5MZ1hXakc3RHpWV1ExcEdwZHdBWUdyQXozT2ZMQ3Y2RU1PVUhwcGZLWG9DT1pid05tSUJhdGJoSVpyVlovNUljYkpWMzRBK1hhUFdzQTdMRFNnb05vUTMvaTRXQzlCOUFQaE4wYjdCblNWLS02YldIejUrMzZnS3RwcWZBcDJrMEFnPT0%3D--3e7eabdc3aa263fc3c2c45256b73a7638b067b4e; path=/; secure; httponly"]:Array (NoMethodError)

It sounds like it's an incompatibility with Rack 3 and Unicorn, the last release of which was 6.1.0 on 2021-12-25.

Options:

  1. Switch to Puma
  2. Monkey-patch Rack 3 support in whilst we wait for a new Unicorn release
@nickcharlton nickcharlton added bug breakages in functionality that is implemented documentation how to use administrate, examples and common usage labels Dec 24, 2024
@nickcharlton nickcharlton added this to the v1.0.0 milestone Dec 24, 2024
nickcharlton added a commit that referenced this issue Jan 6, 2025
We're now using Rack 3, since upgrading to Rails 8.0 in #2705. There's
an incompatiblity between Unicorn and Rack 3, which whilst it has a
commit to fix it, hasn't been released yet.

Unfortunately it wasn't possible to bundle Unicorn directly from the repo, and
building the gem locally didn't work despite a few attempts.

Instead, let's switch to Puma.

Fixes #2730.

https://stackoverflow.com/a/78594913
https://yhbt.net/unicorn.git/9d7bab0bc2211b20806d4d0289a7ea992e49a8a1/s/
@nickcharlton
Copy link
Member Author

I was hoping to just get Unicorn to work — I've successfully bundled from Git for lots of things in the past — but this didn't work out and I couldn't get the gem to build either to consider another approach.

So I gave up and switched to Puma instead.

On the prerelease app, we need to scale the workers down to 1 to deal with Heroku's cheap dyno (https://devcenter.heroku.com/articles/ruby-memory-use#too-many-workers-at-boot), but this shouldn't be too much of a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug breakages in functionality that is implemented documentation how to use administrate, examples and common usage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant