Problem Editing Credentials
Hi everyone,
I setup a new Jumpstart app today from latest master. When I attempt to edit credentials:
rails credentials:edit --environment=development
For any environment, I have an empty file..not filled in as Chris indicates should have all the different services listed.
What am I missing?
Thanks,
Rob Bazinet
I setup a new Jumpstart app today from latest master. When I attempt to edit credentials:
rails credentials:edit --environment=development
For any environment, I have an empty file..not filled in as Chris indicates should have all the different services listed.
What am I missing?
Thanks,
Rob Bazinet
Add notes to the docs for this. https://jumpstartrails.com/docs/credentials
Thanks for the nudge Rob. You're right that it should be included.
Thanks for the nudge Rob. You're right that it should be included.
hi all, I've updated my default editor, but even when I save, the only thing on my STDOUT is:
UPDATE: Issue was that I needed to actually make a modification for the keys to show up. After adding credentials for rollbar, a key showed up and, while it didn't show up in my STDOUT like the video, the key was in the key file.
File encrypted and saved.
I don't actually see a new key file created, either. Did I miss something? Seems I'm not finding what I need in order to set my RAILS_MASTER_KEY
. Thanks!UPDATE: Issue was that I needed to actually make a modification for the keys to show up. After adding credentials for rollbar, a key showed up and, while it didn't show up in my STDOUT like the video, the key was in the key file.
hi all - when I use
EDITOR="atom --wait" rails credentials:edit --environment=development I get an error that says:
Couldn't decrypt config/credentials/development.yml.enc. Perhaps you passed the wrong key?
I also tried EDITOR="atom --wait" rails credentials:edit (without the --environment=development) and then my app doesn't run rails server any more. I get this error:
I also tried EDITOR="atom --wait" rails credentials:edit (without the --environment=development) and then my app doesn't run rails server any more. I get this error:
`rescue in _decrypt': ActiveSupport::MessageEncryptor::InvalidMessage (ActiveSupport::MessageEncryptor::InvalidMessage)
Sorry, it might be because I am a newbie at this rails stuff. Any suggestions?
Sorry, it might be because I am a newbie at this rails stuff. Any suggestions?
--environment=development
will edit a different credentials file than without it.Without, it will edit
config/credentials.yml.enc
and config/master.key
With --environment, it will edit
config/credentials/development.yml.enc
and config/credentials/development.key
If it can't decrypt, you're missing the
.key
file or it has invalid contents. You can also pass that as RAILS_MASTER_KEY=x before the command like you do with EDITOR, but that's usually just for when you're deploying.Delete them and recreate your credentials from scratch if you need to.
Thanks for the quick response. I recreated my credentials from scratch and now I see
config/credentials/development.yml.enc
and config/credentials/development.key files. I confirmed the right key is in the .key file . However, when I run the rails credentials:edit --environment development command again, I am still getting the error:
Couldn't decrypt config/credentials/development.yml.enc. Perhaps you passed the wrong key? Any other thoughts on why this could be?
Can somebody help me, please? I purchased a license over the weekend and pushed Jumpstart Pro into a new Github repository, then my Github Actions' run tests isn't passing.
Run bin/rails db:test:prepare 2 bin/rails db:test:prepare 3 bin/rails test 4 shell: /bin/bash -e {0} 5 env: 6 PATH: /home/runner/.rubies/ruby-2.7.1/bin:/usr/share/rust/.cargo/bin:/home/runner/.config/composer/vendor/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin 7 DATABASE_URL: postgres://postgres:password@localhost:5432/test 8 REDIS_URL: redis://localhost:6379/0 9 RAILS_ENV: test 10 RAILS_MASTER_KEY: 11 PG_USER: postgres 12 rails aborted! ... Caused by: 87 ArgumentError: key must be 16 bytes
I've tried editing credentials following the credentials documentation, but I keep getting this error:
nano ~/.bashrc
added
export EDITOR="code --wait" bin/rails credentials:edit
got this error
No $EDITOR to open file in. Assign one like this: EDITOR="mate --wait" bin/rails credentials:edit For editors that fork and exit immediately, it's important to pass a wait flag, otherwise the credentials will be saved immediately with no chance to edit.
It's just contents of your test.key file.
I have some docs here for staging and production, but same applies to CI like GitHub actions. https://jumpstartrails.com/docs/credentials
I'll try and update that when I'm finished moving out of my house. 😅
I have some docs here for staging and production, but same applies to CI like GitHub actions. https://jumpstartrails.com/docs/credentials
I'll try and update that when I'm finished moving out of my house. 😅
FWIW, I had to create each set of credential files twice for each environment. The first time, each failed with:
Couldn't decrypt config/credentials/<environment>.yml.enc. Perhaps you passed the wrong key?
No amount of re-copying the first key generated, or passing it as `RAILS_MASTER_KEY` on the command line worked. I simply had to destroy and recreate the `.yml.enc` and `.key` files each time.
I tried a few other things different times, like closing out of my editor and re-opening. No luck.
I wonder if anyone else experienced the same and can contribute a solution for new users?
Notifications
You’re not receiving notifications from this thread.