encryption key is incorrect. if you have intentionally changed it, you may want to run `rake db:reset_encryption_key_hash`
Summary:
Hi, I have been working on hosting canvas lms on the Ubuntu server manually. I have been following the wiki page - Production Start. After resolving all the errors, I successfully executed all the steps. But when I opened the browser to access the application using IP address/ hostname, I got the below webpage:

When I accessed the log file at path /var/log/apache2/error.log, I got the following error:
Could not spawn process for application /var/canvas: The application encountered the following error: encryption key is incorrect. if you have intentionally changed it, you may want to run rake db:reset_encryption_key_hash (SystemExit)
I tried the following commands/ways to resolve this error:
- bundle exec rake db:reset_encryption_key_hash
- rake db:reset_encryption_key_hash
- bundle exec rake db:migrate RAILS_ENV=production
- rake db:migrate RAILS_ENV=production
- bundle exec rake db:generate_security_key
- Updated encryption key in security.yml file, removed the encryption key
Still, there was no luck, can anyone help me with this?
RAILS_ENV=production bundle exec rake db:reset_encryption_key_hash
@hitika26 it look like issue of Redis, because redis store old data. You need remove all redis key by command: redis-cli flushall and restart nginx or apache again!
I have what seems to be the same error:
encryption key is incorrect. if you have intentionally changed it, you may want to run `rake db:reset_encryption_key_hash`
App 70316 output: Error: The application encountered the following error: encryption key is incorrect. if you have intentionally changed it, you may want to run `rake db:reset_encryption_key_hash` (SystemExit)
I did this
RAILS_ENV=production bundle exec rake db:reset_encryption_key_hash
I may have misconfigured something and required sudo...
but it did not work for me.
I also tried it without
RAILS_ENV=production
and without
bundle exec
@hitika26 i have the same page , i even used sudo RAILS_ENV=production bundle exec rake db:reset_encryption_key_hash still its showing Psych::AliasesNotEnabled: Alias parsing was not enabled. To enable it, pass aliases: true to Psych::load or Psych::safe_load. error and the same page as you is on the browser have u overcomed the issue ????
@geet-h17 execute the bash line in your project home root
i'm getting the same issue as geet-h17 it tells me an issue with Psych::AliasesNotEnabled when I run the bash to reset the encryption key. I am running it from the project root.
Hi, I have the same issue. And I found this solution. But I don't know exactly how to implement the solution? Can anyone please help? https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
If you are stuck with rake, this is my fix:
- Backup and edit
config/initializers/canvas_security.rb - Replace
CanvasSecurity.validate_encryption_key(ENV["UPDATE_ENCRYPTION_KEY_HASH"])toCanvasSecurity.validate_encryption_key(1) - Restart your server, it will prepare the environment and generate security keys
- Restore
config/initializers/canvas_security.rbafterwards
try this:
- backup your canvas_production database
- drop canvas_production database
- create new database
- restore your backup
- compile_assets