Hey all,
I'm really struggling here and spent hours trying to debug this
here's my route:
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
Log::info("Route started");
$controller_path = 'App\Http\Controllers';
Log::info('Current route', ['route' => Route::currentRouteName()]);
Route::get('/', function (Request $request) {
Log::info('Request data', ['request' => $request->all()]);
// your route logic
});
// Main Page Route
Route::get('/your-route', function (Request $request) {
Log::info('Request data', ['request' => $request->all()]);
// your route logic
});
//migrate
Route::get('/migrate', [App\Http\Controllers\MigrationController::class, 'migrate']);
Route::fallback(function () {
Log::info("Fallback route hit. Request details:", request()->all());
return view('404');
});
You'll notice the ton of debug lines and I've removed almost every other route for testing, when they were there everything got a 404 as well
Here's the story:
Everything runs fine locally running in docker, however as soon as it gets sent to run on google cloud run by google cloud build I get 404's on everything
In my logs I'm not getting the logs from inside the route:get's, just the "Log::info("Route started");"
I know phpfpm, nginx etc should be good as I'm getting the laravel 404 branded page
I just can't get over why it works locally, but not on google cloud run
The google cloud run logs are limited:
WARNING 2023-06-07T20:19:05.500783Z [httpRequest.requestMethod: GET] [httpRequest.status: 404] [httpRequest.responseSize: 7.15 KiB] [httpRequest.latency: 163 ms] [httpRequest.userAgent: Chrome 113.0.0.0] [ URL, blanking for span]
DEFAULT 2023-06-07T20:19:05.635658Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Route started
DEFAULT 2023-06-07T20:19:05.636061Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Current route {"route":null}
DEFAULT 2023-06-07T20:19:05.636663Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Route started
DEFAULT 2023-06-07T20:19:05.636680Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Current route {"route":null}
DEFAULT 2023-06-07T20:19:05.637018Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Route started
DEFAULT 2023-06-07T20:19:05.637110Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Current route {"route":null}
DEFAULT 2023-06-07T20:19:05.637403Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Route started
DEFAULT 2023-06-07T20:19:05.637517Z NOTICE: PHP message: [2023-06-07 20:19:05] development.INFO: Current route {"route":null}
DEFAULT 2023-06-07T20:19:05.666099Z 169.254.1.1 - - [07/Jun/2023:20:19:05 +0000] "GET /migrate HTTP/1.1" 404 6616 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36"
DEFAULT 2023-06-07T20:19:05.667023Z 127.0.0.1 - 07/Jun/2023:20:19:05 +0000 "GET /index.php" 404
I really appreciate anyones input, chatgpt has been leading me in circles of checking php-fpm, routes etc
but it must be somewhat right if it works locally, and even deployed serving the laravel 404 format
Oh, I also put a ping.html file in the public folder just to be sure, and that does return when deployed publically
thanks again