cachethq / cachet

🚦 The open-source status page system.
https://cachethq.io
MIT License
13.79k stars 1.55k forks source link

No supported encrypter found. The cipher and / or key length are invalid #947

Closed gremo closed 8 years ago

gremo commented 8 years ago
bash-4.2$ git status
# HEAD detached at v1.2.1
nothing to commit, working directory clean

When I try to access cachet I got a 500 error. From the log:

[2015-09-17 18:43:06] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/vhosts/myhost/httpdocs/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:29

My .env is copied from .env.example and I changed only the database related stuff. Did this without success:

php artisan key:generate
php artisan config:cache

I can't go to the setup wizard. Any idea why?openssl and mcrypt are up and running, php 5.5.29

jbrooksuk commented 8 years ago

Try deleting out the files in ./bootstrap/cache.

jbrooksuk commented 8 years ago

Then run php artisan config:cache again

gremo commented 8 years ago

@jbrooksuk thanks for helping but I'm getting the same error.

GrahamCampbell commented 8 years ago

Do you have a .env file?

GrahamCampbell commented 8 years ago

If it's named .env.example, you'll need to rename it.

gremo commented 8 years ago

Of course, here is it:

APP_ENV=production
APP_DEBUG=false
APP_URL=http://health.***.it
APP_KEY=SomeRandomString

DB_DRIVER=mysql
DB_HOST=localhost
DB_DATABASE=health_***_cachet_database
DB_USERNAME=health_***
DB_PASSWORD= ***

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=database

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ADDRESS=null
MAIL_NAME=null

REDIS_HOST=null
REDIS_DATABASE=null
GrahamCampbell commented 8 years ago

APP_KEY=SomeRandomString

This MUST actually be a 32 character long string. Just type out some garbage there, and you're sorted.

Arcrammer commented 8 years ago

@jbrooksuk Removing and re-running like you suggested just solved the error for me. Thanks!

GrahamCampbell commented 8 years ago

Yeh, after you change any config, you absolutely must flush the config cache.

chloesoe commented 3 years ago

APP_KEY=SomeRandomString

This MUST actually be a 32 character long string. Just type out some garbage there, and you're sorted.

I couldn't get it running, because my APP_KEY was 28 char long. Thanks to your post I found the error and was able to reinstall it properly. Should this be mentioned in https://docs.cachethq.io/docs/installing-cachet#?