rails: New app: "key must be 32 bits".
Steps to reproduce
Run rails s
. No more… (new app)
Expected behavior
It should display my index.
Actual behavior
It fails.
Here is what is going wrong:
Can you help me? Don’t understand at all.
System configuration
Rails version: 5.0.0.rc1
Ruby version: 2.4.0dev
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 30 (13 by maintainers)
Commits related to this issue
- We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the acceptable value. ruby < 2.4 allowed... — committed to vipulnsward/rails by vipulnsward 8 years ago
- We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the acceptable value. ruby < 2.4 allowed... — committed to koic/rails by vipulnsward 8 years ago
- We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the acceptable value. ruby < 2.4 allowed... — committed to ojiry/rails by vipulnsward 8 years ago
- Fix default key length on cipher We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the ac... — committed to iwz/rails by deleted user 7 years ago
- Fix default key length on cipher We default to using aes-256-cbc as our verification/signing cipher. It can accept key lengths of 128, 192 or 256-bit, whereas currently we were providing twice the ac... — committed to iwz/rails by iwz 7 years ago
- fix: test after rails upgrade - key length on generated key must be 32 bytes SOURCE: https://github.com/rails/rails/issues/25185 — committed to basimilch/basimilch-app by rbf 7 years ago
- bump to 5.0.0.1 to inter-op with Ruby 2.4.1 https://github.com/rails/rails/issues/25185 https://github.com/rails/rails/pull/25192 — committed to thoughtbot/ember-cli-rails by seanpdoyle 6 years ago
- bump to 5.0.0.1 to inter-op with Ruby 2.4.1 https://github.com/rails/rails/issues/25185 https://github.com/rails/rails/pull/25192 — committed to thoughtbot/ember-cli-rails by seanpdoyle 6 years ago
- Update rails to fix key error https://github.com/rails/rails/issues/25185 maclover7: ``` Hmm, after some digging in some C code (💀), looks like there is a new breaking change in OpenSSL, which rejec... — committed to sophomoric/secret by AdrianCann 6 years ago
- Update rails to fix key error https://github.com/rails/rails/issues/25185 maclover7: ``` Hmm, after some digging in some C code (💀), looks like there is a new breaking change in OpenSSL, which rejec... — committed to sophomoric/secret by AdrianCann 6 years ago
- Update rails to fix key error https://github.com/rails/rails/issues/25185 maclover7: ``` Hmm, after some digging in some C code (💀), looks like there is a new breaking change in OpenSSL, which rejec... — committed to sophomoric/secret by AdrianCann 6 years ago
- https://github.com/rails/rails/issues/25185 — committed to buermann/introspective_grape by buermann 5 years ago
Hmm, after some digging in some C code (💀), looks like there is a new breaking change in OpenSSL, which rejects certain values for
key=
, which is the bug you are running into. 😦Looking into fixes.
Same issue (Rails 5.1.0.alpha1, ruby-2.4.preview1)
Upgrade your Rails version to 5.0.1
It has been fixed by https://github.com/rails/rails/pull/25758 and backported in https://github.com/rails/rails/commit/15a972e080d7712aa2eb04f21472398457d1439c
I still have the same issue when upgrading from ruby version
2.2.8
to2.5.1
. My rails version is5.1.5
. I have a key that has a size of 40 bytes. Is this considered an issue with rails and will this be patched in future versions or not?I was experiencing this issue earlier my solution is described beneath the heading element at the bottom of this comment.
Rails and Ruby version:
Stack trace:
Running
bundle update
was the key. I upgraded Ruby from 2.0 to 2.5.1 yesterday so that may have played a role. Here’s the terminal readout of the successful update which solved the problem:How I Got it Running Locally
I ran
bundle install
then I followed up withbundle update
.Then I reset the server (
CMD+C
thenrails s
)After updating bundle, I forgot to restart the server and spent a few minutes researching the error needlessly. So… restarting the server is important. 🥇
My motivation for putting this solution here is that I found this thread while seeking a solution to the error. The above conversation is helpful for understanding how problems in Rails are diagnosed. There was no specific solution for a young Rails developer like myself.
The problem is about the ruby 2.4.0, just for now if you want a quick solution use ruby 2.3.1
Hi, have the same issue on rails 7.0.4 and ruby 3.1.2
Lot’s of fails during tests :