hackclub / hackclub/auth

Missing master key error when running in dev

Open
#52 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
80
Forks
66
Avg merge
2d 59m
Merged PRs (30d)
6

Description

Steps to repro:
- Set up the dev environment as per the readme
- Visit localhost:3000, enter an email and signup details
```
2025-11-26 09:39:02.493413 F [11069:puma srv tp 002 deprecators.rb:86] Rails -- Exception: ArgumentError: Missing master key
/opt/homebrew/lib/ruby/gems/3.4.0/gems/lockbox-2.0.1/lib/lockbox.rb:67:in 'Lockbox.attribute_key'
/opt/homebrew/lib/ruby/gems/3.4.0/gems/lockbox-2.0.1/lib/lockbox/utils.rb:21:in 'Lockbox::Utils.build_box'
/opt/homebrew/lib/ruby/gems/3.4.0/gems/lockbox-2.0.1/lib/lockbox/model.rb:646:in 'block (3 levels) in LoginAttempt.has_encrypted'
...50 more lines of yap (why are rails stacktraces so horrible :hs:)
```
The fix here is to run:
```bash
openssl rand -hex 32
```
and set that result as the `LOCKBOX_MASTER_KEY` in `.env.development` but it'd be nice if this was in the readme!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.