Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New install error: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. #516

Closed
o355 opened this issue Jan 9, 2017 · 9 comments

Comments

@o355
Copy link

o355 commented Jan 9, 2017

Fresh out of a second new install, can't login using the specified info in the .env file, and laravel.log turns up this:

[2017-01-09 05:53:04] production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in /srv/koel/bootstrap/cache/compiled.php:13210

Stack trace:
#0 /srv/koel/bootstrap/cache/compiled.php(7699): Illuminate\Encryption\Encrypter->__construct('SomeRandomStrin...', 'AES-256-CBC')

#1 /srv/koel/bootstrap/cache/compiled.php(1371): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(App\Application), Array)

#2 /srv/koel/bootstrap/cache/compiled.php(1327): Illuminate\Container\Container->build(Object(Closure), Array)

#3 /srv/koel/bootstrap/cache/compiled.php(1902): Illuminate\Container\Container->make('encrypter', Array)

#4 /srv/koel/bootstrap/cache/compiled.php(1577): Illuminate\Foundation\Application->make('encrypter')

#5 /srv/koel/bootstrap/cache/compiled.php(12359): Illuminate\Container\Container->offsetGet('encrypter')

#6 /srv/koel/bootstrap/cache/compiled.php(12314): Illuminate\Session\SessionManager->buildSession(Object(Illuminate\Session\FileSessionHandler))

#7 /srv/koel/bootstrap/cache/compiled.php(12308): Illuminate\Session\SessionManager->createNativeDriver()

#8 /srv/koel/bootstrap/cache/compiled.php(12406): Illuminate\Session\SessionManager->createFileDriver()

#9 /srv/koel/bootstrap/cache/compiled.php(12396): Illuminate\Support\Manager->createDriver('file')

#10 /srv/koel/bootstrap/cache/compiled.php(7767): Illuminate\Support\Manager->driver()

#11 /srv/koel/bootstrap/cache/compiled.php(1371): Illuminate\Session\SessionServiceProvider->Illuminate\Session\{closure}(Object(App\Application), Array)

#12 /srv/koel/bootstrap/cache/compiled.php(1327): Illuminate\Container\Container->build(Object(Closure), Array)

#13 /srv/koel/bootstrap/cache/compiled.php(1902): Illuminate\Container\Container->make('session.store', Array)

#14 /srv/koel/bootstrap/cache/compiled.php(1577): Illuminate\Foundation\Application->make('session.store')

#15 /srv/koel/bootstrap/cache/compiled.php(5274): Illuminate\Container\Container->offsetGet('session.store')

#16 /srv/koel/bootstrap/cache/compiled.php(1171): Illuminate\Routing\RoutingServiceProvider->Illuminate\Routing\{closure}(Object(App\Application))

#17 /srv/koel/bootstrap/cache/compiled.php(1371): Illuminate\Container\Container->Illuminate\Container\{closure}(Object(App\Application), Array)

#18 /srv/koel/bootstrap/cache/compiled.php(1327): Illuminate\Container\Container->build(Object(Closure), Array)

#19 /srv/koel/bootstrap/cache/compiled.php(1902): Illuminate\Container\Container->make('redirect', Array)

#20 /srv/koel/bootstrap/cache/compiled.php(5631): Illuminate\Foundation\Application->make('redirect')

#21 /srv/koel/bootstrap/cache/compiled.php(1512): Illuminate\Foundation\Providers\FoundationServiceProvider->Illuminate\Foundation\Providers\{closure}(Object(App\Http\Requests\API\UserLoginRequest), Object(App\Application))

#22 /srv/koel/bootstrap/cache/compiled.php(1495): Illuminate\Container\Container->fireCallbackArray(Object(App\Http\Requests\API\UserLoginRequest), Array)

#23 /srv/koel/bootstrap/cache/compiled.php(1337): Illuminate\Container\Container->fireResolvingCallbacks('App\\Http\\Reques...', Object(App\Http\Requests\API\UserLoginRequest))

#24 /srv/koel/bootstrap/cache/compiled.php(1902): Illuminate\Container\Container->make('App\\Http\\Reques...', Array)

#25 /srv/koel/bootstrap/cache/compiled.php(7868): Illuminate\Foundation\Application->make('App\\Http\\Reques...')

#26 /srv/koel/bootstrap/cache/compiled.php(7857): Illuminate\Routing\ControllerDispatcher->transformDependency(Object(ReflectionParameter), Array, Array)

#27 /srv/koel/bootstrap/cache/compiled.php(7851): Illuminate\Routing\ControllerDispatcher->resolveMethodDependencies(Array, Object(ReflectionMethod))

#28 /srv/koel/bootstrap/cache/compiled.php(9386): Illuminate\Routing\ControllerDispatcher->resolveClassMethodDependencies(Array, Object(App\Http\Controllers\API\AuthController), 'login')

#29 /srv/koel/bootstrap/cache/compiled.php(8446): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\API\AuthController), 'login')

#30 /srv/koel/bootstrap/cache/compiled.php(8427): Illuminate\Routing\Route->runController()

#31 /srv/koel/bootstrap/cache/compiled.php(8123): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))

#32 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#33 /srv/koel/bootstrap/cache/compiled.php(9954): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#34 /srv/koel/bootstrap/cache/compiled.php(9846): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))

#35 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

#36 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(48): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#37 /srv/koel/bootstrap/cache/compiled.php(9846): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), '60', '1')

#38 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

#39 /srv/koel/bootstrap/cache/compiled.php(9831): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#40 /srv/koel/bootstrap/cache/compiled.php(8124): Illuminate\Pipeline\Pipeline->then(Object(Closure))

#41 /srv/koel/bootstrap/cache/compiled.php(8115): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))

#42 /srv/koel/bootstrap/cache/compiled.php(8106): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))

#43 /srv/koel/bootstrap/cache/compiled.php(2452): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))

#44 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))

#45 /srv/koel/app/Http/Middleware/UseDifferentConfigIfE2E.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#46 /srv/koel/bootstrap/cache/compiled.php(9846): App\Http\Middleware\UseDifferentConfigIfE2E->handle(Object(Illuminate\Http\Request), Object(Closure))

#47 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

#48 /srv/koel/bootstrap/cache/compiled.php(3189): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#49 /srv/koel/bootstrap/cache/compiled.php(9846): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))

#50 /srv/koel/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))

#51 /srv/koel/bootstrap/cache/compiled.php(9831): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))

#52 /srv/koel/bootstrap/cache/compiled.php(2396): Illuminate\Pipeline\Pipeline->then(Object(Closure))

#53 /srv/koel/bootstrap/cache/compiled.php(2380): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))

#54 /srv/koel/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

#55 /srv/koel/server.php(19): require_once('/srv/koel/index...')

#56 {main}

Pretty much stumped at this point at what to do.

Steps to reproduce on my end:

  • Install Koel 1:1 as the install directions do.
  • Try to log in, and have it fail, spits out this. Login window is red and shakes not vigorously

OS is Ubuntu Server 16.04.1 LTS. I am running Apache/SoftEther on this server so I don't know if that interferes with encryption. Working directory is /srv/koel

@phanan
Copy link
Member

phanan commented Jan 9, 2017

Can you try following the guide here laravel/framework#9080 and let me know if the problem persists?

@o355
Copy link
Author

o355 commented Jan 9, 2017

Alright, looks like it works.

The way I did it was I ran php artisan key:generate. I then copied the output in the brackets, and put in my .env file as APP_KEY=base64:keygoesherenotpostingmyrealkey. I did php artisan config:clear, then php artisan config:cache, and things are now working!

Excited to enjoy koel 👍

@o355 o355 closed this as completed Jan 9, 2017
@RaymondMwaura
Copy link

Thanks @o355 . You're a lifesaver!

@jmichaelterenin
Copy link

But what do you do to debug this when things DON'T WORK after performing this?? It originally did (last month) but after doing a composer update and downloading Laravel 5.4.24 (from 5.4.23), this solution no longer works for me. I've even tried changing the cipher to AES-128-CBC, no use.

@V1TA5
Copy link

V1TA5 commented Jun 6, 2017

What i found is: if you change the key string in your app.php to anything else than the default placeholder (even emptying it). laravel will fail and display the encryption error. (even if you did the keysetting in your env file correctly).

@Shoukat-bjr
Copy link

Thank you, this works.

@irving-caamal
Copy link

nice

@Saif-hub24
Copy link

Thanks. This works for me .

@uithatran
Copy link

Alright, looks like it works.

The way I did it was I ran php artisan key:generate. I then copied the output in the brackets, and put in my .env file as APP_KEY=base64:keygoesherenotpostingmyrealkey. I did php artisan config:clear, then php artisan config:cache, and things are now working!

Excited to enjoy koel 👍

thank you very much!!!!!!!!!!!!1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants