Skip to content

[13.x] Fix HandleExceptions fatal when static::$app is null during Octane request marshaling#60439

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
majidfeiz:fix/handle-exceptions-null-app-deprecation
Jun 8, 2026
Merged

[13.x] Fix HandleExceptions fatal when static::$app is null during Octane request marshaling#60439
taylorotwell merged 1 commit into
laravel:13.xfrom
majidfeiz:fix/handle-exceptions-null-app-deprecation

Conversation

@majidfeiz

@majidfeiz majidfeiz commented Jun 7, 2026

Copy link
Copy Markdown

Problem

When using Laravel Octane with FrankenPHP and symfony/http-foundation 8.1, all JSON requests return empty HTTP 500 responses with no logged errors.

Root cause (two combined bugs):

  1. Symfony 8.1 added PHP 8.4 property set hooks on Request::$request and other public properties that fire E_USER_DEPRECATED on direct assignment. FrankenPHP's marshalRequest() assigns to this property during request setup — before the Octane sandbox app is fully initialized.

  2. When the deprecation fires, HandleExceptions::shouldIgnoreDeprecationErrors() calls static::$app->hasBeenBootstrapped() — but in Octane's transitional state, static::$app can be null, causing a fatal "Call to member function on null", which results in a silent empty HTTP 500.

Fix

Add a null guard before calling any method on static::$app:

protected function shouldIgnoreDeprecationErrors()
{
    return ! class_exists(LogManager::class)
        || is_null(static::$app)    // ← added
        || ! static::$app->hasBeenBootstrapped()
        || ...;
}

Why it doesn't break existing features

  • The check short-circuits only when $app is null — a state where logging deprecations is impossible anyway.
  • All 17 existing HandleExceptionsTest tests pass unchanged.
  • Existing behavior for normal (non-Octane) apps is completely unaffected.

Benefit to end users

Octane + FrankenPHP users running symfony/http-foundation 8.1 can send JSON requests without getting silent HTTP 500 errors.

Closes #60365

@taylorotwell taylorotwell merged commit 1b1d612 into laravel:13.x Jun 8, 2026
55 checks passed
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

Successfully merging this pull request may close these issues.

Octane + Symfony 8: JSON requests return empty 500 (createFromBase triggers http-foundation 8.1 deprecation; HandleExceptions fatals on unbound config)

2 participants