BCrypt issues on new clean install of 2.4.1


#1

I get the following error whenever I try to create a user:

    [mastodon@hostname live]$ RAILS_ENV=production bundle exec rake mastodon:add_user
    E-mail: user@example.com
    Username: username
    Role: user
    Proceed to create the user? Yes
    rake aborted!
    BCrypt::Errors::InvalidHash: invalid hash
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/bcrypt-3.1.11/lib/bcrypt/password.rb:60:in `initialize'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/bcrypt-3.1.11/lib/bcrypt/password.rb:46:in `new'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/bcrypt-3.1.11/lib/bcrypt/password.rb:46:in `create'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/devise-4.4.3/lib/devise/encryptor.rb:11:in `digest'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/devise-4.4.3/lib/devise/models/database_authenticatable.rb:167:in `password_digest'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/devise-4.4.3/lib/devise/models/database_authenticatable.rb:47:in `password='
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:51:in `public_send'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:51:in `_assign_attribute'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:44:in `block in _assign_attributes'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:43:in `each'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:43:in `_assign_attributes'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/attribute_assignment.rb:23:in `_assign_attributes'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activemodel-5.2.0/lib/active_model/attribute_assignment.rb:35:in `assign_attributes'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb:28:in `perform_attribute_assignment'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/attr_encrypted-3.1.0/lib/attr_encrypted/adapters/active_record.rb:36:in `assign_attributes'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/core.rb:314:in `initialize'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/devise-4.4.3/lib/devise/models/confirmable.rb:67:in `initialize'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/inheritance.rb:66:in `new'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/activerecord-5.2.0/lib/active_record/inheritance.rb:66:in `new'
    /home/mastodon/live/lib/tasks/mastodon.rake:476:in `block (2 levels) in <top (required)>'
    /home/mastodon/live/vendor/bundle/ruby/2.5.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
    /home/mastodon/.rbenv/versions/2.5.1/bin/bundle:23:in `load'
    /home/mastodon/.rbenv/versions/2.5.1/bin/bundle:23:in `<main>'
    Tasks: TOP => mastodon:add_user
    (See full trace by running task with --trace)

I am running on Fedora 28 using PostgreSQL 10, but all of the Ruby stuff & versions are as dictated by the installation directions. Any ideas what is up here?


#2

Fedora 28 has some changes that cause issues with this.


#3

Looks like we need to update our bcrypt gem: Gem is broken on Fedora 28 · Issue #170 · codahale/bcrypt-ruby · GitHub