Cachet: No supported encrypter found. The cipher and / or key length are invalid

Created on 17 Sep 2015  路  10Comments  路  Source: CachetHQ/Cachet

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

Most helpful comment

APP_KEY=SomeRandomString

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

All 10 comments

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

Then run php artisan config:cache again

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

Do you have a .env file?

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

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

APP_KEY=SomeRandomString

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

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

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

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#?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sukhada369 picture sukhada369  路  8Comments

Phelzier picture Phelzier  路  7Comments

jbrooksuk picture jbrooksuk  路  5Comments

thomvaill picture thomvaill  路  7Comments

gn-ley picture gn-ley  路  5Comments