Solucionado (ver solução)
Solucionado
(ver solução)
7
respostas

Whoops, looks like something went wrong.

Olá, pessoal! Estou na aula 2, do curso Laravel, mas quando tento acessar a lista de produtos, mesmo depois de apagar o .env, surge a seguinte mensagem: Whoops, looks like something went wrong. O que poderá estar acontecendo Já configurei o database.php. Um abraço!

7 respostas

Verifique o arquivo laravel.log e poste o erro ao tentar acessar a página.

Onde se encontra esse arquivo e como procedo?

Você pode encontrar esse arquivo dentro de /storage/logs/laravel.log

Assim que encontrar o arquivo, limpe todo o conteúdo dele e acesse novamente a tela em que dá erro, após, posta o erro aqui =)

Boa noite,

Cara estou com esse mesmo erro, você pode me ajudar?

O conteúdo do meu log de erro é o seguinte:

[2016-06-30 02:10:44] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php:7746
Stack trace:
#0 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(7736): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher(NULL, 'AES-256-CBC')
#1 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1353): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1309): Illuminate\Container\Container->build(Object(Closure), Array)
#3 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1874): Illuminate\Container\Container->make('encrypter', Array)
#4 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1410): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#5 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1387): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#6 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1373): Illuminate\Container\Container->getDependencies(Array, Array)
#7 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1309): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#8 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1874): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#9 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(9930): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#10 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#11 C:\Users\gusta\Documents\Alura\Laravel\estoque\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#12 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#13 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(9920): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#14 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(8201): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(8192): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#16 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(8182): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#17 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#18 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#19 C:\Users\gusta\Documents\Alura\Laravel\estoque\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#20 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#21 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(9935): call_user_func_array(Array, Array)
#23 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 C:\Users\gusta\Documents\Alura\Laravel\estoque\vendor\laravel\framework\src\Illuminate\Routing\Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#25 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#26 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(9920): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#27 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#28 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#29 C:\Users\gusta\Documents\Alura\Laravel\estoque\public\index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#30 C:\Users\gusta\Documents\Alura\Laravel\estoque\server.php(21): require_once('C:\\Users\\gusta\\...')
#31 {main}  
[2016-06-30 02:10:44] production.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php:7746
Stack trace:
#0 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(7736): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher(NULL, 'AES-256-CBC')
#1 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1353): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1309): Illuminate\Container\Container->build(Object(Closure), Array)
#3 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1874): Illuminate\Container\Container->make('encrypter', Array)
#4 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1410): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#5 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1387): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#6 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1373): Illuminate\Container\Container->getDependencies(Array, Array)
#7 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1309): Illuminate\Container\Container->build('App\\Http\\Middle...', Array)
#8 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(1874): Illuminate\Container\Container->make('App\\Http\\Middle...', Array)
#9 C:\Users\gusta\Documents\Alura\Laravel\estoque\bootstrap\cache\compiled.php(2373): Illuminate\Foundation\Application->make('App\\Http\\Middle...')
#10 C:\Users\gusta\Documents\Alura\Laravel\estoque\public\index.php(58): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#11 C:\Users\gusta\Documents\Alura\Laravel\estoque\server.php(21): require_once('C:\\Users\\gusta\\...')
#12 {main}

Olá, Gabriel! O meu problema resolvi restaurando o arquivo .env que se encontrava em um outro projeto criado há algum temopo, a partir do livro de Laravel que adquiri na Casa do Código. Diante disso, acho que o melhor é colocar os parâmetros da conexão diretamente nesse arquivo. Um abraço!

solução!

José fico feliz em saber que você conseguiu uma solução pra o seu problema.

Em consultas ao pai Google e fóruns também consegui entender o meu problema e soluciona-lo.

O problema ocorreu na instalação do Laravel, o arquivo confing/app.php requer uma chave de 32bits, no entanto por padrão ele esta gerando uma de 16 ('SomeRandomString').

Como solução pode ser aberto o arquivo confing/app.php e alterar a chave solicitada

De:

'cipher' => 'AES-256-CBC',

Para:

'cipher' => 'AES-128-CBC',

Uma segunda solução é gerar uma nova chave automaticamente pelo comando.

php artisan key:generate

Para que esse comando funcione verifique se o arquivo .env esta habitada na pasta raiz do projeto. Se na pasta raiz o arquivo estiver como .env.example renomeie para .env.

Basta executar o seginte comando no DOS do Windows

ren .env.example .env

E depois

php artisan key:generate

O DOS devera retornar o uma mensagem de sucesso coma nova string de configuração.

Segue abaixo dois links de foruns que me ajudaram: Link 1

Link 2

Caso tenha dito algo errado por favor me corrijam.

Espero ter ajudado alguém.

Abraço