25

After updating gems, it does not load the sidekiq website giving the following error:

NoMethodError (undefined method `transform_keys' for <ActionDispatch::Request::Session:0x00005568df2a8710>):

The gems that were updated were:

selenium-webdriver 3.142.7
rack-protection 2.0.8.1
mime-types 3.3.1
 mini_magick 4.10.1
image_processing 1.10.3
groupdate 4.3.0
friendly_id 5.3.0
faraday 0.17.3
http 4.3.0
public_suffix 4.0.3
rack 2.1.1
crass 1.0.6
i18n 1.7.1
minitest 5.14.0

ruby version: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux]

Full error message

rhugo
  • 464
  • 1
  • 5
  • 15
  • 1
    What version of Ruby and Ruby on Rails do you use? – spickermann Jan 13 '20 at 17:28
  • @spickermann is asking because [Hash#transform_keys](https://ruby-doc.org/core-2.5.0/Hash.html#method-i-transform_keys) was added to the Ruby core fairly recently, in v2.5. – Cary Swoveland Jan 13 '20 at 18:10
  • @spickermann ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] – rhugo Jan 14 '20 at 07:43
  • @rhugo Can you please post the full error message including the stack trace and the code which triggers the exception (see stack trace to identify where the error occurs in your application). – spickermann Jan 14 '20 at 07:56
  • @spickermann I added an image with the log, it doesn't let me include so much code in the message – rhugo Jan 14 '20 at 08:25
  • @GuillermoSiliceoTrueba solved using rack 2.0.8 – rhugo Jan 14 '20 at 08:34

4 Answers4

36

It seems to be an issue with Rack 2.1.1. It works ok with 2.0.8.

dolarsrg
  • 905
  • 1
  • 9
  • 10
  • 6
    It has been fixed in Rack 2.1.2, which was just released a couple hours ago. – Mike A. Jan 28 '20 at 00:46
  • 1
    I've updated to Rack 2.1.2 but Sidekiq renders blank pages. Downgrading to 2.0.8 makets it to work again. More issues here: https://github.com/rack/rack/issues/1531 – dolarsrg Jan 29 '20 at 08:46
21

it's a rack issue and fixed by this PR: https://github.com/rack/rack/pull/1428

Chao Lin
  • 219
  • 1
  • 3
9

Update: Rack 2.1.2 has been released and it solves this error

Now the solution is making sure you use 2.1.2 or higher.

bundle update rack

might do the trick for you depending on the rest of your Gemfile.


Old answer

Two options in order to solve this.

  • Install a previous working release (recommended). This will install the latest release on 2.0.X branch:
gem 'rack', '~> 2.0.0'
  • Install the fixed version from git repository itself
gem 'rack', github: 'rack/rack', ref: 'f690bb71425aa31d7b9b3113829af773950d8ab5'

In both cases, you should remove/replace this with the proper fixed release once this happens. Keep track of https://github.com/rack/rack/pull/1428

jBilbo
  • 1,683
  • 13
  • 24
5

For me, I solved this problem by adding this line to Gemfile

gem 'rack', '2.0.7'

If you have Gemfile.lock in local, you can delete it and then run bundle install.

If you are using Capistrano, you needn't run bundle install manually, and Gemfile.lock often doesn't exists in your repository.

Lane
  • 4,682
  • 1
  • 36
  • 20