2

I was playing with Laravel by refreshing the page 10 times in a second and did this many times continuously. I got the below error

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

This is a test case which can occur anytime by end user also. Is there any way to fix it?

I already have key in my env file. This issue occurs only when i refresh the page again and again,

I already checked the answer but could not help

Pankaj
  • 9,749
  • 32
  • 139
  • 283

3 Answers3

2

As posted by one of the users at this issue at GitHub,

Under a heavy load of requests, two async requests are made, and during the second request the .env file is locked, so you receive the error only for that request.

To solve this, you can create a cache using below command, which will bypass your .env file on further requests.

php artisan config:cache
jaysingkar
  • 4,315
  • 1
  • 18
  • 26
0

Run following command from application folder:

$ php artisan key:generate
Govind Samrow
  • 9,981
  • 13
  • 53
  • 90
0

First make the key if doesn't exists by running following command.

php artisan key:generate

Next clear your config cache.

php artisan config:clear

Propably application cached your config without app-key.

Patryk Woziński
  • 738
  • 1
  • 6
  • 18