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

Error 500 after installation #199

Closed
rourke opened this issue Apr 18, 2017 · 5 comments
Closed

Error 500 after installation #199

rourke opened this issue Apr 18, 2017 · 5 comments

Comments

@rourke
Copy link

rourke commented Apr 18, 2017

I'm running the latest version of cachet (v2.3.11) on my Ubuntu Server 16.04 using the instructions here. No matter what I do, I keep getting error 500: Internal Server Error.

image

[2017-04-18 16:40:07] development.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher('dyWhk73OnDeZZCW...', 'AES-256-CBC')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('encrypter', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1178): Illuminate\Foundation\Application->make('encrypter')
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(139): Illuminate\Container\Container->offsetGet('encrypter')
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(147): Illuminate\Queue\QueueManager->connection(NULL)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(111): Illuminate\Queue\Worker->pop(NULL, NULL, '2', '1', '3')
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(87): Illuminate\Queue\Worker->runNextJobForDaemon(NULL, NULL, '2', '1', '3')
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(120): Illuminate\Queue\Worker->daemon(NULL, NULL, '2', 128, '1', '3')
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(79): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, NULL, '2', 128, true)
#11 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#14 /var/www/html/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 {main} {"identification":{"id":"da36df86-2479-4dd5-96ea-f761b721d1b4"}}
[2017-04-18 16:40:15] development.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher('dyWhk73OnDeZZCW...', 'AES-256-CBC')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('encrypter', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(849): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(804): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(775): Illuminate\Container\Container->getDependencies(Array, Array)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build('Illuminate\\Cook...', Array)
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('Illuminate\\Cook...', Array)
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(126): Illuminate\Foundation\Application->make('Illuminate\\Cook...')
#10 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#11 /var/www/html/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 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(726): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(699): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php(675): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(246): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#18 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#20 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): 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 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#23 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#25 /var/www/html/vendor/fideloper/proxy/src/TrustProxies.php(55): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#26 [internal function]: Fideloper\Proxy\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(136): call_user_func_array(Array, Array)
#28 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#29 /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#30 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#32 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(132): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(99): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#34 /var/www/html/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#35 {main} {"identification":{"id":"0c93905c-c84a-4ce8-abb7-01cf0c8db550"}}
[2017-04-18 16:40:15] development.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher('dyWhk73OnDeZZCW...', 'AES-256-CBC')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('encrypter', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(849): Illuminate\Foundation\Application->make('Illuminate\\Cont...')
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(804): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(775): Illuminate\Container\Container->getDependencies(Array, Array)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build('Illuminate\\Cook...', Array)
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('Illuminate\\Cook...', Array)
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(152): Illuminate\Foundation\Application->make('Illuminate\\Cook...')
#10 /var/www/html/public/index.php(57): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#11 {main} {"identification":{"id":"c99f5e29-d218-4624-8b27-5b97d7179496"}}
[2017-04-18 16:40:48] development.ERROR: exception 'RuntimeException' with message 'No supported encrypter found. The cipher and / or key length are invalid.' in /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:45
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(25): Illuminate\Encryption\EncryptionServiceProvider->getEncrypterForKeyAndCipher('dyWhk73OnDeZZCW...', 'AES-256-CBC')
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\Encryption\EncryptionServiceProvider->Illuminate\Encryption\{closure}(Object(Illuminate\Foundation\Application), Array)
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\Container\Container->build(Object(Closure), Array)
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(697): Illuminate\Container\Container->make('encrypter', Array)
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1178): Illuminate\Foundation\Application->make('encrypter')
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/QueueManager.php(139): Illuminate\Container\Container->offsetGet('encrypter')
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(147): Illuminate\Queue\QueueManager->connection(NULL)
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(111): Illuminate\Queue\Worker->pop(NULL, NULL, '2', '1', '3')
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(87): Illuminate\Queue\Worker->runNextJobForDaemon(NULL, NULL, '2', '1', '3')
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(120): Illuminate\Queue\Worker->daemon(NULL, NULL, '2', 128, '1', '3')
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(79): Illuminate\Queue\Console\WorkCommand->runWorker(NULL, NULL, '2', 128, true)
#11 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(507): call_user_func_array(Array, Array)
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(169): Illuminate\Container\Container->call(Array)
#14 /var/www/html/vendor/symfony/console/Command/Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/html/vendor/symfony/console/Application.php(794): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/html/vendor/symfony/console/Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/html/vendor/symfony/console/Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/html/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 {main} {"identification":{"id":"c69b4fd9-7d26-45aa-b976-25e6ec425581"}}

@djdefi
Copy link
Contributor

djdefi commented Apr 18, 2017

Hi there. The error seems to be this:

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

Have you set the APP_KEY environment variable in the docker-compose.yml or on the Docker host?

@rourke
Copy link
Author

rourke commented Apr 18, 2017

Yes, I have. It looks like this:

version: "3"

services:
  postgres:
    image: postgres:9.5
    volumes:
      - /var/lib/postgresql/data
    environment:
      - POSTGRES_USER=admin
      - POSTGRES_PASSWORD=somepassword
    restart: always
  cachet:
    build:
      context: .
      args:
        - cachet_ver=v2.3.11
    ports:
      - 80:8000
    links:
      - postgres:postgres
    environment:
      - DB_DRIVER=pgsql
      - DB_HOST=postgres
      - DB_PORT=5432
      - DB_DATABASE=postgres
      - DB_USERNAME=admin
      - DB_PASSWORD=somepassword
      - DB_PREFIX=chq_
      - APP_KEY=dyWhk[...]4yA=
      - DEBUG=false
    depends_on:
      - postgres
    restart: always

I removed the password and part of the key.

I looked inside the container and noticed it's also present in the .env file. But in the config/app.php file I noticed:

    'key' => env('APP_KEY'),

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

Is this correct?

@djdefi
Copy link
Contributor

djdefi commented Apr 18, 2017

I believe you also need to keep the base64 bit on there, such as:

- APP_KEY=base64:MQQ1OXE2f[...]3VV109yQ=

Let me know if that doesn't work for you.

@rourke
Copy link
Author

rourke commented Apr 18, 2017

Ah that was it. It's working now. How silly of me. Thank you very much. :)

@prairiewolf-by
Copy link

prairiewolf-by commented Sep 18, 2018

Hello. Sorry for upvote on old issue, but i got exactly the same, i did the same steps, but i still have error 500. I have rechecked APP_KEY exist in docker-compose.yml and in .env file
I have done tens of reloads, rebuilds and restarts, but it seems i'm still missing something (as always, it will be a very tiny, but very urgent for functioning).
Please, help me with strating this default container - at least it.
Thank you very much in advance, if someone still watching this thread.
Ubuntu 16.04.5 x64
docker 17.03.2-ce
docker-compose 1.22.0
trying to install CachetHQ v2.3.15

Sorry, resolved by rebuilding again with prepending 'base64:' in APP_KEY.

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

3 participants