-
Notifications
You must be signed in to change notification settings - Fork 145
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
ArgumentError (key must be 32 bytes) with Ruby 2.4.1 #705
Comments
I don't think it's due to 2.4, even though I haven't tested it yet. IIRC in v0.14.0 we were using an older version of I'd say just put a print here: shipit-engine/app/models/shipit/user.rb Line 11 in 7672980
attr_encrypted requires at least 32 bytes, but you can give it more.
We default it to your secret key_base, and pre 5.0 Rails generated a smaller one. |
I've tried with longer keys and is still raises. It seems to only work exactly when the key is 32 bytes. Hmm based on some digging I think it's related to this addition to ruby: ruby/ruby@ce63526 More discussion can be related to |
Interesting, you were right then :) I'll dig into this on monday unless you submit a PR first. |
Fixed in #706 |
Shipit Version:
0.18.1
Ruby Version:
ruby 2.4.1p111
Context
While upgrading from Shipit
v0.14.0
tov0.18.1
I encountered the following error when visiting the root of the engine. I believe this has to do with the fact that the keys are not being truncated to 32 bytes, which before Ruby 2.4 wasn't an issue, I've noticed in thedev.yml
you're usingv2.2.x
.They had a comparable issue in Rails: rails/rails#25192 although our issue stems from the
attr_encrypted
gem.I think just truncating the returned value of this method would be the quickest fix.
Thoughts? Is Shopify interested in supported > Ruby 2.2 with Shipit?
Partial Stack Trace
The text was updated successfully, but these errors were encountered: