Upload aplikacji na Heroku - błędy po stronie serwera

0

Próbuję wrzucić projekt wykonany w Symfony 4 na Heroku.

Podążając zgodnie z tym tutorialem nie jestem w stanie wyświetlić prawidłowo żadnej strony.

Wyrzuca mi błąd typu:

Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused. 

Po wywołaniu

heroku logs -t

Jest coś takiego:

2018-12-16T21:54:02.057519+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=79382f2c-e513-4a8d-8491-a29549314c72 fwd="83.218.117.48" dyno=
web.1 connect=0ms service=2ms status=404 bytes=367 protocol=https
2018-12-16T21:54:02.251360+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_id=c488775c-4c41-4df6-b729-20a672ec06c5 fwd="83.218.117.48"
 dyno=web.1 connect=0ms service=1ms status=404 bytes=373 protocol=https
2018-12-16T22:09:57.109908+00:00 app[api]: Running release v6 commands by user [email protected]
2018-12-16T22:09:57.127948+00:00 app[api]: @ref:jawsdb-amorphous-24090 completed provisioning, setting JAWSDB_URL. by user [email protected]
2018-12-16T22:09:57.127948+00:00 app[api]: Release v7 created by user [email protected]
2018-12-16T22:09:57.109908+00:00 app[api]: Attach JAWSDB (@ref:jawsdb-amorphous-24090) by user [email protected]
2018-12-16T22:09:57.687606+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:09:58.880290+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:09:58.864399+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:09:58.958765+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:10:01.705765+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:10:04.609066+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:10:04.644342+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:10:04.653147+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:10:06.657175+00:00 app[web.1]: Starting httpd...
2018-12-16T22:10:06.926811+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:10:07.134526+00:00 app[api]: Update JAWSDB by jawsdb by user [email protected]
2018-12-16T22:10:07.524801+00:00 heroku[web.1]: Restarting
2018-12-16T22:10:07.652596+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:10:07.134526+00:00 app[api]: Release v8 created by user [email protected]
2018-12-16T22:10:08.613507+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:10:08.591278+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:10:08.710850+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:10:13.353475+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:10:17.047145+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:10:17.095066+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:10:17.105790+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:10:19.325582+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:10:19.113954+00:00 app[web.1]: Starting httpd...
2018-12-16T22:11:18.754469+00:00 heroku[web.1]: Restarting
2018-12-16T22:11:18.773273+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:11:18.274926+00:00 app[api]: Set DATABASE_URL config vars by user [email protected]
2018-12-16T22:11:20.046870+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:11:20.026364+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:11:20.185491+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:11:18.274926+00:00 app[api]: Release v9 created by user [email protected]
2018-12-16T22:11:24.703716+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:11:28.624790+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:11:28.674856+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:11:28.708082+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:11:30.715628+00:00 app[web.1]: Starting httpd...
2018-12-16T22:11:31.165504+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:12:06.758826+00:00 app[api]: Starting process with command `php bin/console cache:clear` by user [email protected]
2018-12-16T22:12:12.455335+00:00 heroku[run.5526]: Awaiting client
2018-12-16T22:12:12.474783+00:00 heroku[run.5526]: Starting process with command `php bin/console cache:clear`
2018-12-16T22:12:19.969282+00:00 heroku[run.5526]: State changed from up to complete
2018-12-16T22:12:19.948289+00:00 heroku[run.5526]: Process exited with status 0
2018-12-16T22:12:28.419507+00:00 app[web.1]: [Sun Dec 16 22:12:28.418707 2018] [autoindex:error] [pid 136:tid 139940523542272] [client 10.45.211.114:34102] AH01276: Cannot serve director
y /app/: No matching DirectoryIndex (index.php,index.html,index.htm) found, and server-generated directory index forbidden by Options directive
2018-12-16T22:12:28.423783+00:00 app[web.1]: 10.45.211.114 - - [16/Dec/2018:22:12:28 +0000] "GET / HTTP/1.1" 403 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/2010010
1 Firefox/64.0
2018-12-16T22:12:28.654177+00:00 app[web.1]: 10.45.211.114 - - [16/Dec/2018:22:12:28 +0000] "GET /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Ge
cko/20100101 Firefox/64.0
2018-12-16T22:12:28.654033+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_id=e2982879-3526-4ab9-bba2-edb83769ce26 fwd="83.218.117.48"
 dyno=web.1 connect=0ms service=1ms status=404 bytes=373 protocol=https
2018-12-16T22:12:32.114106+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=495324d8-ebb3-4653-aaa3-fc9ece3a67b3 fwd="83.218.117.48" dyno=
web.1 connect=0ms service=3ms status=404 bytes=367 protocol=https
2018-12-16T22:18:08.095005+00:00 app[api]: Running release v10 commands by user [email protected]
2018-12-16T22:18:08.095005+00:00 app[api]: Attach JAWSDB_NAVY (@ref:jawsdb-deep-18505) by user [email protected]
2018-12-16T22:18:09.152816+00:00 heroku[web.1]: Restarting
2018-12-16T22:18:09.174010+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:18:08.119005+00:00 app[api]: @ref:jawsdb-deep-18505 completed provisioning, setting JAWSDB_NAVY_URL. by user [email protected]
2018-12-16T22:18:08.119005+00:00 app[api]: Release v11 created by user [email protected]
2018-12-16T22:18:10.286373+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:18:10.259519+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:18:10.387301+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:18:15.403698+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:18:18.082389+00:00 app[api]: Update JAWSDB_NAVY by jawsdb by user [email protected]
2018-12-16T22:18:19.594410+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:18:19.636057+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:18:19.648079+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:18:21.656931+00:00 app[web.1]: Starting httpd...
2018-12-16T22:18:21.855028+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:18:21.831893+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:18:21.990857+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:18:24.064067+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:18:27.464702+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:18:27.507735+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:18:27.521502+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:18:29.918247+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:19:55.118149+00:00 app[api]: Starting process with command `php bin/console cache:clear` by user [email protected]
2018-12-16T22:20:01.747584+00:00 heroku[run.9824]: State changed from starting to up
2018-12-16T22:20:01.901755+00:00 heroku[run.9824]: Starting process with command `php bin/console cache:clear`
2018-12-16T22:20:01.856193+00:00 heroku[run.9824]: Awaiting client
2018-12-16T22:20:12.481356+00:00 heroku[run.9824]: State changed from up to complete
2018-12-16T22:20:12.462316+00:00 heroku[run.9824]: Process exited with status 0
2018-12-16T22:20:28.000000+00:00 app[api]: Build started by user [email protected]
2018-12-16T22:20:45.304751+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:20:46.407468+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:20:46.378129+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:20:46.496774+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:20:45.026215+00:00 app[api]: Release v13 created by user [email protected]
2018-12-16T22:20:45.026215+00:00 app[api]: Deploy 234f942e by user [email protected]
2018-12-16T22:20:46.000000+00:00 app[api]: Build succeeded
2018-12-16T22:20:57.144644+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2018-12-16T22:20:57.297898+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:20:59.446215+00:00 app[web.1]: Starting httpd...
2018-12-16T22:20:59.812806+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:21:01.434162+00:00 app[web.1]: 2018-12-16T22:21:01+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-16T22:21:01.910240+00:00 app[web.1]: 10.79.217.135 - - [16/Dec/2018:22:21:01 +0000] "GET / HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/2010010
1 Firefox/64.0
2018-12-16T22:21:02.128264+00:00 app[web.1]: 2018-12-16T22:21:02+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-16T22:21:02.152497+00:00 app[web.1]: 10.79.217.135 - - [16/Dec/2018:22:21:02 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Ge
cko/20100101 Firefox/64.0
2018-12-16T22:21:05.789943+00:00 app[web.1]: 2018-12-16T22:21:05+00:00 [critical] Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: "Environmen
t variable not found: "APP_SECRET"." at /app/vendor/symfony/dependency-injection/EnvVarProcessor.php line 77
2018-12-16T22:21:05.799599+00:00 app[web.1]: 10.69.9.74 - - [16/Dec/2018:22:21:05 +0000] "GET /login HTTP/1.1" 500 495 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100
101 Firefox/64.0
2018-12-16T22:21:05.799883+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=cc0a1f9d-dab1-478e-bffa-f871429c662b fwd="83.218.117.48" dyno=
web.1 connect=0ms service=70ms status=500 bytes=719 protocol=https

Mój plik .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Determine the RewriteBase automatically and set it as environment variable.
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    # If the requested filename exists, simply serve it.
    # We only want to let Apache serve files and not directories.
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]

    # Rewrite all other queries to the front controller.
    RewriteRule .? %{ENV:BASE}/index.php [L]
</IfModule>

Plik Procfile:

web: $(composer config bin-dir)/heroku-php-apache2 public/
1

Czysty guess, ale w logu jest coś takiego:
"Environment variable not found: "APP_SECRET"."
próbowałeś ustawić tę zmienną?

0

Ustawiłem zmienną APP_SECRET na wartość, która jest zdefiniowana w pliku konfiguracji projektu: .env

heroku config:set APP_SECRET=30e7983afdf8e7d9d51c620e6242ff22

Ale widzę, że ten błąd dalej się w logach przewija.

2018-12-16T22:18:18.082389+00:00 app[api]: Update JAWSDB_NAVY by jawsdb by user [email protected]
2018-12-16T22:18:19.594410+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:18:19.636057+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:18:19.648079+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:18:21.656931+00:00 app[web.1]: Starting httpd...
2018-12-16T22:18:21.855028+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:18:21.831893+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:18:21.990857+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:18:24.064067+00:00 heroku[web.1]: Starting process with command `heroku-php-apache2`
2018-12-16T22:18:27.464702+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:18:27.507735+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-16T22:18:27.521502+00:00 app[web.1]: Starting php-fpm...
2018-12-16T22:18:29.918247+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:19:55.118149+00:00 app[api]: Starting process with command `php bin/console cache:clear` by user [email protected]
2018-12-16T22:20:01.747584+00:00 heroku[run.9824]: State changed from starting to up
2018-12-16T22:20:01.901755+00:00 heroku[run.9824]: Starting process with command `php bin/console cache:clear`
2018-12-16T22:20:01.856193+00:00 heroku[run.9824]: Awaiting client
2018-12-16T22:20:12.481356+00:00 heroku[run.9824]: State changed from up to complete
2018-12-16T22:20:12.462316+00:00 heroku[run.9824]: Process exited with status 0
2018-12-16T22:20:28.000000+00:00 app[api]: Build started by user [email protected]
2018-12-16T22:20:45.304751+00:00 heroku[web.1]: State changed from up to starting
2018-12-16T22:20:46.407468+00:00 app[web.1]: Going down, terminating child processes...
2018-12-16T22:20:46.378129+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:20:46.496774+00:00 heroku[web.1]: Process exited with status 143
2018-12-16T22:20:45.026215+00:00 app[api]: Release v13 created by user [email protected]
2018-12-16T22:20:45.026215+00:00 app[api]: Deploy 234f942e by user [email protected]
2018-12-16T22:20:46.000000+00:00 app[api]: Build succeeded
2018-12-16T22:20:57.144644+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2018-12-16T22:20:57.297898+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-16T22:20:59.446215+00:00 app[web.1]: Starting httpd...
2018-12-16T22:20:59.812806+00:00 heroku[web.1]: State changed from starting to up
2018-12-16T22:21:01.434162+00:00 app[web.1]: 2018-12-16T22:21:01+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-16T22:21:01.910240+00:00 app[web.1]: 10.79.217.135 - - [16/Dec/2018:22:21:01 +0000] "GET / HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/2010010
1 Firefox/64.0
2018-12-16T22:21:02.128264+00:00 app[web.1]: 2018-12-16T22:21:02+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-16T22:21:02.152497+00:00 app[web.1]: 10.79.217.135 - - [16/Dec/2018:22:21:02 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Ge
cko/20100101 Firefox/64.0
2018-12-16T22:21:05.789943+00:00 app[web.1]: 2018-12-16T22:21:05+00:00 [critical] Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: "Environmen
t variable not found: "APP_SECRET"." at /app/vendor/symfony/dependency-injection/EnvVarProcessor.php line 77
2018-12-16T22:21:05.799599+00:00 app[web.1]: 10.69.9.74 - - [16/Dec/2018:22:21:05 +0000] "GET /login HTTP/1.1" 500 495 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100
101 Firefox/64.0
2018-12-16T22:21:05.799883+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=cc0a1f9d-dab1-478e-bffa-f871429c662b fwd="83.218.117.48" dyno=
web.1 connect=0ms service=70ms status=500 bytes=719 protocol=https
2018-12-16T22:24:35.095787+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=e798040d-b910-4e5e-8648-4c4f3f632dd5 fwd="83.218.117.48" dyno=
web.1 connect=1ms service=37ms status=500 bytes=719 protocol=https
2018-12-16T22:24:35.084785+00:00 app[web.1]: 2018-12-16T22:24:35+00:00 [critical] Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: "Environmen
t variable not found: "APP_SECRET"." at /app/vendor/symfony/dependency-injection/EnvVarProcessor.php line 77
2018-12-16T22:24:35.097035+00:00 app[web.1]: 10.45.115.149 - - [16/Dec/2018:22:24:35 +0000] "GET /login HTTP/1.1" 500 495 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20
100101 Firefox/64.0
2018-12-16T22:24:35.318184+00:00 app[web.1]: 2018-12-16T22:24:35+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-16T22:24:35.332835+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_i
d=f044088a-212b-4c94-ae50-d0c0e5f4247c fwd="83.218.117.48" dyno=web.1 connect=0ms service=34ms status=499 bytes= protocol=https
2018-12-16T22:24:35.336001+00:00 app[web.1]: 10.45.115.149 - - [16/Dec/2018:22:24:35 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Ge
cko/20100101 Firefox/64.0
2018-12-16T22:58:23.708818+00:00 heroku[web.1]: Idling
2018-12-16T22:58:23.729747+00:00 heroku[web.1]: State changed from up to down
2018-12-16T22:58:24.937738+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-16T22:58:24.962848+00:00 app[web.1]: Going down, terminating child processes...
2018-12-17T00:34:59.751603+00:00 heroku[web.1]: Unidling
2018-12-17T00:35:05.997835+00:00 heroku[web.1]: Starting process with command `$(composer config bin-dir)/heroku-php-apache2 public/`
2018-12-17T00:35:11.808711+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2018-12-17T00:35:11.888644+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-17T00:35:11.976642+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-17T00:35:12.010271+00:00 app[web.1]: Starting php-fpm...
2018-12-17T00:35:14.287659+00:00 heroku[web.1]: State changed from starting to up
2018-12-17T00:35:14.039513+00:00 app[web.1]: Starting httpd...
2018-12-17T00:35:16.114962+00:00 app[web.1]: 2018-12-17T00:35:16+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /robots.txt"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T00:35:16.438891+00:00 heroku[router]: at=info method=GET path="/robots.txt" host=obydzialalo.herokuapp.com request_id=1a7dabd9-2af5-45fa-8f9e-d33d0f3ada51 fwd="88.99.195.227"
dyno=web.1 connect=1ms service=598ms status=404 bytes=683 protocol=http
2018-12-17T00:35:16.438355+00:00 app[web.1]: 10.31.52.90 - - [17/Dec/2018:00:35:15 +0000] "GET /robots.txt HTTP/1.1" 404 471 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko
/20050920 Firefox/52.7.0
2018-12-17T00:35:16.650568+00:00 app[web.1]: 2018-12-17T00:35:16+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T00:35:16.662068+00:00 app[web.1]: 10.123.135.185 - - [17/Dec/2018:00:35:16 +0000] "GET / HTTP/1.1" 404 471 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.10) Gecko/200509
20 Firefox/52.7.0
2018-12-17T00:35:16.663600+00:00 heroku[router]: at=info method=GET path="/" host=obydzialalo.herokuapp.com request_id=ddc4b7b5-3359-41fc-b907-3a9b21fa0c40 fwd="88.99.195.227" dyno=web.1
 connect=1ms service=23ms status=404 bytes=683 protocol=http
2018-12-17T01:09:30.990033+00:00 heroku[web.1]: Idling
2018-12-17T01:09:30.994477+00:00 heroku[web.1]: State changed from up to down
2018-12-17T01:09:32.154382+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-12-17T01:09:32.184560+00:00 app[web.1]: Going down, terminating child processes...
2018-12-17T01:09:32.300524+00:00 heroku[web.1]: Process exited with status 143
2018-12-17T09:10:58.766586+00:00 heroku[web.1]: Unidling
2018-12-17T09:10:58.787792+00:00 heroku[web.1]: State changed from down to starting
2018-12-17T09:11:05.036520+00:00 heroku[web.1]: Starting process with command `$(composer config bin-dir)/heroku-php-apache2 public/`
2018-12-17T09:11:09.360896+00:00 app[web.1]: DOCUMENT_ROOT changed to 'public/'
2018-12-17T09:11:09.460331+00:00 app[web.1]: Optimizing defaults for 1X dyno...
2018-12-17T09:11:09.507532+00:00 app[web.1]: 4 processes at 128MB memory limit.
2018-12-17T09:11:09.525325+00:00 app[web.1]: Starting php-fpm...
2018-12-17T09:11:11.692846+00:00 heroku[web.1]: State changed from starting to up
2018-12-17T09:11:13.275304+00:00 heroku[router]: at=info method=GET path="/" host=obydzialalo.herokuapp.com request_id=dbed9dbd-4e34-4cac-8b8b-2512898010f1 fwd="83.218.117.48" dyno=web.1
 connect=1ms service=403ms status=404 bytes=683 protocol=https
2018-12-17T09:11:13.756161+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_i
d=0cd27a87-a195-4a27-b2f1-047e63cdb927 fwd="83.218.117.48" dyno=web.1 connect=1ms service=26ms status=499 bytes= protocol=https
2018-12-17T09:11:13.748391+00:00 app[web.1]: 2018-12-17T09:11:13+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T09:11:13.756213+00:00 app[web.1]: 10.51.203.60 - - [17/Dec/2018:09:11:13 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gec
ko/20100101 Firefox/64.0
2018-12-17T09:11:17.251089+00:00 app[web.1]: 2018-12-17T09:11:17+00:00 [critical] Uncaught PHP Exception Symfony\Component\DependencyInjection\Exception\EnvNotFoundException: "Environmen
t variable not found: "APP_SECRET"." at /app/vendor/symfony/dependency-injection/EnvVarProcessor.php line 77
2018-12-17T09:11:17.264248+00:00 app[web.1]: 10.148.7.14 - - [17/Dec/2018:09:11:17 +0000] "GET /login HTTP/1.1" 500 495 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/2010
0101 Firefox/64.0
2018-12-17T09:11:17.454781+00:00 app[web.1]: 2018-12-17T09:11:17+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T09:11:17.459340+00:00 app[web.1]: 10.148.7.14 - - [17/Dec/2018:09:11:17 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Geck
o/20100101 Firefox/64.0
2018-12-17T09:13:46.444773+00:00 heroku[web.1]: Restarting
2018-12-17T09:13:46.463092+00:00 heroku[web.1]: State changed from up to starting
2018-12-17T09:13:45.635243+00:00 app[api]: Set APP_SECRET config vars by user [email protected]
2018-12-17T09:13:45.635243+00:00 app[api]: Release v14 created by user [email protected]
2018-12-17T09:13:48.472214+00:00 app[web.1]: Going down, terminating child processes...
2018-12-17T09:13:48.717441+00:00 heroku[web.1]: Process exited with status 143
2018-12-17T09:13:52.332428+00:00 heroku[web.1]: Starting process with command `$(composer config bin-dir)/heroku-php-apache2 public/`
2018-12-17T09:13:58.979430+00:00 app[web.1]: Starting httpd...
2018-12-17T09:13:59.889046+00:00 heroku[web.1]: State changed from starting to up
2018-12-17T09:14:01.123002+00:00 heroku[router]: at=info method=GET path="/" host=obydzialalo.herokuapp.com request_id=3396a1f1-a011-45fb-b193-d75672557696 fwd="83.218.117.48" dyno=web.1
 connect=1ms service=270ms status=404 bytes=683 protocol=https
2018-12-17T09:14:01.016961+00:00 app[web.1]: 2018-12-17T09:14:01+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T09:14:01.123401+00:00 app[web.1]: 10.31.125.56 - - [17/Dec/2018:09:14:00 +0000] "GET / HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101
 Firefox/64.0
2018-12-17T09:14:01.351407+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_i
d=8df96b39-0dab-4aa0-b043-8b0c3a0efa4c fwd="83.218.117.48" dyno=web.1 connect=1ms service=19ms status=499 bytes= protocol=https
2018-12-17T09:14:01.340963+00:00 app[web.1]: 2018-12-17T09:14:01+00:00 [error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "G
ET /favicon.ico"" at /app/vendor/symfony/http-kernel/EventListener/RouterListener.php line 139
2018-12-17T09:14:01.356849+00:00 app[web.1]: 10.31.125.56 - - [17/Dec/2018:09:14:01 +0000] "GET /favicon.ico HTTP/1.1" 404 471 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gec
ko/20100101 Firefox/64.0
2018-12-17T09:14:04.476798+00:00 heroku[router]: at=info method=GET path="/login" host=obydzialalo.herokuapp.com request_id=2faec483-bd9d-4865-a9ac-95cb6d413e14 fwd="83.218.117.48" dyno=
web.1 connect=1ms service=74ms status=500 bytes=811 protocol=https
2018-12-17T09:14:04.715145+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/favicon.ico" host=obydzialalo.herokuapp.com request_i
d=e356b0f5-b0a0-42b9-8c6f-d5bbc36aca5f fwd="83.218.117.48" dyno=web.1 connect=1ms service=42ms status=499 bytes= protocol=https

1

Jak ci wywala 500tkę, a na localu działało to najprawdopodobniej:
-zły wpis w htaccess
-złe uprawnienia do plików
-błędny routing
-błędne "drzewo" plików, czyli apk w złym folderze itp.

1
czysteskarpety napisał(a):

Jak ci wywala 500tkę, a na localu działało to najprawdopodobniej:
-zły wpis w htaccess

Zaaktualizowałem plik .htaccess poprzez wywołanie komendy:

composer require symfony/apache-pack

Teraz plik wygląda tak:

# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex index.php

# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
# Options FollowSymlinks

# Disabling MultiViews prevents unwanted negotiation, e.g. "/index" should not resolve
# to the front controller "/index.php" but be rewritten to "/index.php/index".
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Determine the RewriteBase automatically and set it as environment variable.
    # If you are using Apache aliases to do mass virtual hosting or installed the
    # project in a subdirectory, the base path will be prepended to allow proper
    # resolution of the index.php file and to redirect to the correct URI. It will
    # work in environments without path prefix as well, providing a safe, one-size
    # fits all solution. But as you do not need it in this case, you can comment
    # the following 2 lines to eliminate the overhead.
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    RewriteRule ^(.*) - [E=BASE:%1]

    # Sets the HTTP_AUTHORIZATION header removed by Apache
    RewriteCond %{HTTP:Authorization} .
    RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect to URI without front controller to prevent duplicate content
    # (with and without `/index.php`). Only do this redirect on the initial
    # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
    # endless redirect loop (request -> rewrite to front controller ->
    # redirect -> request -> ...).
    # So in case you get a "too many redirects" error or you always get redirected
    # to the start page because your Apache does not expose the REDIRECT_STATUS
    # environment variable, you have 2 choices:
    # - disable this feature by commenting the following 2 lines or
    # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
    #   following RewriteCond (best solution)
    RewriteCond %{ENV:REDIRECT_STATUS} ^$
    RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]

    # If the requested filename exists, simply serve it.
    # We only want to let Apache serve files and not directories.
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]

    # Rewrite all other queries to the front controller.
    RewriteRule ^ %{ENV:BASE}/index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        # When mod_rewrite is not available, we instruct a temporary redirect of
        # the start page to the front controller explicitly so that the website
        # and the generated links can still be used.
        RedirectMatch 307 ^/$ /index.php/
        # RedirectTemp cannot be used instead
    </IfModule>
</IfModule>

-złe uprawnienia do plików

Gdzie je można ustawić/sprawdzić jakie są (w jakim pliku)?

-błędny routing

Polecenie

php bin/console debug:router

Wyświetla mi prawidłowo wszystkie ścieżki, które skonfigurowałem więc to nie ten problem.

-błędne "drzewo" plików, czyli apk w złym folderze itp.

To by chyba wypluwał przy logach.

Update:
Plik htaccess był jednym z problemów.
Ten, który wrzuciłem w tym poście jest prawidłowy.
Do tego doszły problemy z webpackiem na serwerze.
Pomocny okazał się ten link:
https://medium.com/@jontorrado/deploying-a-symfony-4-application-to-heroku-with-webpack-abdf7771cde9

Update 2:
Jak wam wywala kod błędu 500 a w logach nie zgłasza błędów to ustawcie zmienną APP_SECRET.

1 użytkowników online, w tym zalogowanych: 0, gości: 1