Server 500 error on a Heroku Hosted App - No errors during deployment steps

Server 500 error on a Heroku Hosted App - No errors during deployment steps

arodmcmxcix
Shopify Partner
9 0 0

I have a fully operational Shopify App written in PHP (using the Laravel web framework). The App has been fully tested and validated on a local host, i.e. all systems are operational. (local hosting is done via npm run dev and everything runs well)

To embed this App in a Shopify store front we have to host it via Heroku. Documentation here: https://shopify.dev/docs/apps/launch/deployment/deploy-web-app/deploy-to-heroku

The hosted app successfully builds in Heroku (deploys) but the resulting domain link only responds with server 500.

Here is my only clue: (I have scrubbed all sensitive info from the Heroku logs --tails):

2024-08-22T22:08:17.000000+00:00 app[api]: Build succeeded
2024-08-22T22:08:17.470839+00:00 app[api]: Release v22 created by user [USER_EMAIL]
2024-08-22T22:08:17.470839+00:00 app[api]: Deploy [DEPLOY_HASH] by user [USER_EMAIL]
2024-08-22T22:08:17.744947+00:00 heroku[web.1]: Restarting
2024-08-22T22:08:17.794733+00:00 heroku[web.1]: State changed from up to starting
2024-08-22T22:08:18.362067+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2024-08-22T22:08:18.379474+00:00 app[web.1]: [22-Aug-2024 22:08:18] NOTICE: Terminating ...
2024-08-22T22:08:18.457398+00:00 heroku[web.1]: Process exited with status 143
2024-08-22T22:08:24.597211+00:00 heroku[web.1]: Starting process with command `/app/entrypoint.sh`
2024-08-22T22:08:25.141282+00:00 app[web.1]: Running database migrations...
2024-08-22T22:08:25.768174+00:00 app[web.1]: Nothing to migrate.
2024-08-22T22:08:25.775066+00:00 app[web.1]: Starting nginx server...
2024-08-22T22:08:25.876962+00:00 app[web.1]: Service `hwdrivers` needs non existent service `dev`
2024-08-22T22:08:25.876963+00:00 app[web.1]: Service `machine-id` needs non existent service `dev`
2024-08-22T22:08:25.877145+00:00 app[web.1]: * Caching service dependencies ... [ ok ]
2024-08-22T22:08:25.894798+00:00 app[web.1]: * checkpath: owner `nginx:nginx` not found
2024-08-22T22:08:25.897181+00:00 app[web.1]: nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2024-08-22T22:08:25.902199+00:00 app[web.1]: * Starting nginx ...nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2024-08-22T22:08:25.904112+00:00 app[web.1]: [ ok ]
2024-08-22T22:08:25.907490+00:00 app[web.1]: Starting PHP server...
2024-08-22T22:08:25.946201+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
2024-08-22T22:08:25.946202+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
2024-08-22T22:08:25.946202+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
2024-08-22T22:08:25.946207+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
2024-08-22T22:08:25.946337+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: fpm is running, pid 129
2024-08-22T22:08:25.947102+00:00 app[web.1]: [22-Aug-2024 22:08:25] NOTICE: ready to handle connections
2024-08-22T22:08:26.335488+00:00 heroku[web.1]: State changed from starting to up
2024-08-22T22:12:39.697081+00:00 app[web.1]: 127.0.0.1 -  22/Aug/2024:22:12:39 +0000 "GET /index.php" 500
2024-08-22T22:12:39.697560+00:00 heroku[router]: at=info method=GET path="/" host=[HOST] request_id=[REQUEST_ID] fwd="[IP_ADDRESS]" dyno=web.1 connect=0ms service=89ms status=500 bytes=7032 protocol=https
2024-08-22T22:12:40.350975+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=[HOST] request_id=[REQUEST_ID] fwd="[IP_ADDRESS]" dyno=web.1 connect=0ms service=0ms status=200 bytes=232 protocol=https 

I have double checked the env files, composer.json, Dockerfile, and nginx.conf.

All of these files seem to be correct.

I have tried several additions to these files but non seem to fix the server 500.

Seemingly the only response from the Heroku logs is a GET 500 from index.php which has been attached:

 

<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

/*
|--------------------------------------------------------------------------
| Check If The Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is in maintenance / demo mode via the "down" command
| we will load this file so that any pre-rendered content can be shown
| instead of starting the framework, which could cause an exception.
|
*/

if (file_exists(__DIR__ . '/../storage/framework/maintenance.php')) {
    require __DIR__ . '/../storage/framework/maintenance.php';
}

/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| this application. We just need to utilize it! We'll simply require it
| into the script here so we don't need to manually load our classes.
|
*/

require __DIR__ . '/../vendor/autoload.php';

/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request using
| the application's HTTP kernel. Then, we will send the response back
| to this client's browser, allowing them to enjoy our application.
|
*/

$app = require_once __DIR__ . '/../bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = tap($kernel->handle(
    $request = Request::capture()
))->send();

$kernel->terminate($request, $response);

 

 



Replies 0 (0)