-2

I am trying to deploy my site with Heroku. I created the site with Laravel 6. The deployment went well but when I try to open my site, I get error 500. I am not able to find any issues, can you please guide me to find the root cause and eventually fix it?

2020-03-20T21:36:45.046621+00:00 heroku[web.1]: State changed from down to starting

2020-03-20T21:36:45.042846+00:00 heroku[web.1]: Unidling

2020-03-20T21:36:49.111583+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 public/`

2020-03-20T21:36:52.831320+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'

2020-03-20T21:36:52.942370+00:00 app[web.1]: Detected 536870912 Bytes of RAM

2020-03-20T21:36:52.979231+00:00 app[web.1]: PHP memory_limit is 128M Bytes

2020-03-20T21:36:52.992073+00:00 app[web.1]: Starting php-fpm with 4 workers...

2020-03-20T21:36:53.372095+00:00 heroku[web.1]: State changed from starting to up

2020-03-20T21:36:53.134132+00:00 app[web.1]: Starting httpd...

2020-03-20T21:36:54.437872+00:00 heroku[router]: at=info method=GET path="/" host=born.herokuapp.com request_id=8d35e95d-3ac1-41bb-bd6f-cf601c89c0f8 fwd="86.68.15.24" dyno=web.1 connect=1ms service=345ms status=500 bytes=1786 protocol=https

2020-03-20T21:36:54.441186+00:00 app[web.1]: 10.99.209.116 - - [20/Mar/2020:21:36:54 +0000] "GET / HTTP/1.1" 500 1562 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0

i found this logs

2020-03-21T11:27:01.722880+00:00 app[web.1]: 10.181.29.40 - - [21/Mar/2020:11:27:01 +0000] "GET / HTTP/1.1" 500 1562 "https://dashboard.heroku.com/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0

2020-03-21T11:27:01.723771+00:00 app[web.1]: [2020-03-21 11:27:01] production.ERROR: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. {"exception":"[object] (RuntimeException(code: 0): The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. at /app/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:43)

2020-03-21T11:27:01.723804+00:00 app[web.1]: [stacktrace]

2020-03-21T11:27:01.724139+00:00 app[web.1]: #0 /app/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(28): Illuminate\\Encryption\\Encrypter->__construct()

2020-03-21T11:27:01.724507+00:00 app[web.1]: #1 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(799): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}()

2020-03-21T11:27:01.724800+00:00 app[web.1]: #2 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\\Container\\Container->build()

2020-03-21T11:27:01.725096+00:00 app[web.1]: #3 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(785): Illuminate\\Container\\Container->resolve()

2020-03-21T11:27:01.725405+00:00 app[web.1]: #4 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Foundation\\Application->resolve()

2020-03-21T11:27:01.725683+00:00 app[web.1]: #5 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(770): Illuminate\\Container\\Container->make()

2020-03-21T11:27:01.725962+00:00 app[web.1]: #6 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(945): Illuminate\\Foundation\\Application->make()

2020-03-21T11:27:01.726271+00:00 app[web.1]: #7 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(873): Illuminate\\Container\\Container->resolveClass()

2020-03-21T11:27:01.726593+00:00 app[web.1]: #8 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(834): Illuminate\\Container\\Container->resolveDependencies()

2020-03-21T11:27:01.726881+00:00 app[web.1]: #9 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(681): Illuminate\\Container\\Container->build()

2020-03-21T11:27:01.727212+00:00 app[web.1]: #10 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(785): Illuminate\\Container\\Container->resolve()

2020-03-21T11:27:01.727521+00:00 app[web.1]: #11 /app/vendor/laravel/framework/src/Illuminate/Container/Container.php(629): Illuminate\\Foundation\\Application->resolve()

2020-03-21T11:27:01.727814+00:00 app[web.1]: #12 /app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(770): Illuminate\\Container\\Container->make()

2020-03-21T11:27:01.728122+00:00 app[web.1]: #13 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(209): Illuminate\\Foundation\\Application->make()

2020-03-21T11:27:01.728457+00:00 app[web.1]: #14 /app/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(183): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware()

2020-03-21T11:27:01.728665+00:00 app[web.1]: #15 /app/public/index.php(60): Illuminate\\Foundation\\Http\\Kernel->terminate()

2020-03-21T11:27:01.728711+00:00 app[web.1]: #16 {main}
clemfr
  • 5
  • 3
  • [Please don't post screenshots of text](https://meta.stackoverflow.com/a/285557/354577). They can't be searched or copied and offer poor usability. Instead, paste the code as text directly into your question. If you select it and click the `{}` button or Ctrl+K the code block will be indented by four spaces, which will cause it to be rendered as code. – ChrisGPT was on strike Mar 20 '20 at 20:31
  • 1
    [HTTP 500](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_Server_Error) is a generic server-side error message. On its own it doesn't tell us anything useful. Any time you see this your first step should be to check your error logs for more detail. In this case it looks like you need to debug whatever code you're trying to run for requests to `/`. At minimum, add some logging to it. – ChrisGPT was on strike Mar 20 '20 at 20:32
  • I can't debug because i can't access to my site, my first page return error 500 and i don't know where i can try to debug. i think he tries to affiche the fichier / and my router doesn't work so i'm not redirecting to my welcome page. my router work in local si i'm lost – clemfr Mar 20 '20 at 22:21
  • Again, _at minimum, add some logging to whatever code runs on `/`_. – ChrisGPT was on strike Mar 20 '20 at 23:50
  • i'm sorry, it's my first site and i don't know many things, i found this logs – clemfr Mar 21 '20 at 11:30

1 Answers1

2

Here's the relevant error message:

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. at /app/vendor/laravel/framework/src/Illuminate/Encryption/Encrypter.php:43

It looks like your APP_KEY isn't set properly.

In development this would probably be set via your your .env file, which shouldn't be included in your repository. This file is just a convenient way of setting environment variables in development; Heroku supports environment variables natively via config vars.

Either generate a new APP_KEY or copy the one from your .env file and set it on Heroku by running

heroku config:set APP_KEY=<your_key>

or via the web portal.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257