sentry-laravel icon indicating copy to clipboard operation
sentry-laravel copied to clipboard

Fix required from sentry-php - framebuilder Undefined array key 0

Open tom-id-au opened this issue 5 months ago • 1 comments

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

4.14.1

Laravel version

11.45.1

Steps to reproduce

I was getting the same stack trace as reported in the bug in sentry-php:

Undefined array key 0 {"userId":1203,"exception":"[object] (ErrorException(code: 0): Undefined array key 0 at /Users/.../vendor/sentry/sentry/src/FrameBuilder.php:226)

I copied the fix from the PR to the relevant location in the vendor folder and it fixed it:

https://github.com/getsentry/sentry-php/pull/1862

Expected result

Show the error details.

Actual result

Blocked showing errors:

[2025-06-24 01:40:54] local.ERROR: Undefined array key 0 {"userId":1203,"exception":"[object] (ErrorException(code: 0): Undefined array key 0 at /Users/.../vendor/sentry/sentry/src/FrameBuilder.php:226) [stacktrace] #0 /Users/.../vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(256): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'Undefined array...', '/Users/tomoconn...', 226) #1 /Users/.../vendor/sentry/sentry/src/FrameBuilder.php(226): Illuminate\Foundation\Bootstrap\HandleExceptions->Illuminate\Foundation\Bootstrap\{closure}(2, 'Undefined array...', '/Users/tomoconn...', 226) #2 /Users/.../vendor/sentry/sentry/src/FrameBuilder.php(192): Sentry\FrameBuilder->getFunctionArgumentValues(Object(ReflectionMethod), Array) #3 /Users/.../vendor/sentry/sentry/src/FrameBuilder.php(111): Sentry\FrameBuilder->getFunctionArguments(Array)

tom-id-au avatar Jun 24 '25 02:06 tom-id-au

You can run composer update -W to update dependencies of dependencies. Would recommend running this always. We‘ll push a new release of the Laravel SDK as well, to bump the min version.

On a side note, do you have a reproduction of the problem?

cleptric avatar Jun 24 '25 02:06 cleptric