Skip to content

Uncaught TypeError: Rollbar\Payload\Person::__construct(): Argument #4 ($extra) must be of type array, App\Models\User given, called in /var/www/vendor/rollbar/rollbar/src/DataBuilder.php on line 949 #175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
azgooon opened this issue Apr 25, 2025 · 6 comments · Fixed by #176
Assignees
Milestone

Comments

@azgooon
Copy link

azgooon commented Apr 25, 2025

Hi,

I am experiencing below error:

[2025-04-25 13:25:45] local.ERROR: Uncaught TypeError: Rollbar\Payload\Person::__construct(): Argument #4 ($extra) must be of type array, App\Models\User given, called in /var/www/vendor/rollbar/rollbar/src/DataBuilder.php on line 949 and defined in /var/www/vendor/rollbar/rollbar/src/Payload/Person.php:18
Stack trace:
#0 /var/www/vendor/rollbar/rollbar/src/DataBuilder.php(949): Rollbar\Payload\Person->__construct('18', NULL, '[email protected]', Object(App\Models\User))
#1 /var/www/vendor/rollbar/rollbar/src/DataBuilder.php(380): Rollbar\DataBuilder->getPerson()
#2 /var/www/vendor/rollbar/rollbar/src/Config.php(798): Rollbar\DataBuilder->makeData('error', Object(Illuminate\Database\Eloquent\ModelNotFoundException), Array)
#3 /var/www/vendor/rollbar/rollbar/src/RollbarLogger.php(433): Rollbar\Config->getRollbarData('error', Object(Illuminate\Database\Eloquent\ModelNotFoundException), Array)
#4 /var/www/vendor/rollbar/rollbar/src/RollbarLogger.php(256): Rollbar\RollbarLogger->getPayload('c04def903df748b4890e65135ff05500', 'error', Object(Illuminate\Database\Eloquent\ModelNotFoundException), Array)
#5 /var/www/vendor/rollbar/rollbar/src/Handlers/ExceptionHandler.php(27): Rollbar\RollbarLogger->report('error', Object(Illuminate\Database\Eloquent\ModelNotFoundException), Array, true)
#6 [internal function]: Rollbar\Handlers\ExceptionHandler->handle(Object(Illuminate\Database\Eloquent\ModelNotFoundException))
#7 {main}
  thrown {"exception":"[object] (Symfony\\Component\\ErrorHandler\\Error\\FatalError(code: 0): Uncaught TypeError: Rollbar\\Payload\\Person::__construct(): Argument #4 ($extra) must be of type array, App\\Models\\User given, called in /var/www/vendor/rollbar/rollbar/src/DataBuilder.php on line 949 and defined in /var/www/vendor/rollbar/rollbar/src/Payload/Person.php:18

on a few occassions, I ignored it, simply assuming that it is #171, but it turned its not.

I experience the issue on rollbar/rollbar 4.1.1 and rollbar/rollbar-laravel 8.1.2.

Thanks,
Tom.

@danielmorell
Copy link
Collaborator

This issues was resolved in rollbar/rollbar v4.1.2. Please upgrade to that or a later version.

@danielmorell danielmorell self-assigned this Apr 29, 2025
@azgooon
Copy link
Author

azgooon commented Apr 30, 2025

@danielmorell Thanks for the update! Should the composer.json in rollbar-php-laravel point to version v4.1.2?

@danielmorell
Copy link
Collaborator

@azgooon Yeah that should get fixed! 🤦

@azgooon
Copy link
Author

azgooon commented May 6, 2025

@danielmorell , sorry to be a pain, but when I try to upgrade to version 8.1.3, the composer says that this version doesn't exist.
would it be related to the version 8.1.2 still being the newest on the packagist.org?

@danielmorell
Copy link
Collaborator

@azgooon No that's my bad. Packagist was being uncooperative the day I released 8.1.3. And I forgot to circle back later to get it sorted. You should be able to get 8.1.3 now.

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 a pull request may close this issue.

2 participants