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

Error sometimes in Logs : Argument #2 ($reportBindings) must be of type bool, null given.

Open luca-alsina opened this issue 3 years ago • 11 comments

I'm getting this error sometimes in my LOGS :

[2022-05-21 04:00:04] local.ERROR: Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 {"exception":"[object] (TypeError(code: 0): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 at /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/Recorders/QueryRecorder/QueryRecorder.php:19) [stacktrace] #0 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(170): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder->__construct() #1 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(871): Spatie\\LaravelIgnition\\IgnitionServiceProvider->Spatie\\LaravelIgnition\\{closure}() #2 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(756): Illuminate\\Container\\Container->build() #3 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(855): Illuminate\\Container\\Container->resolve() #4 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\\Foundation\\Application->resolve() #5 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(840): Illuminate\\Container\\Container->make() #6 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(248): Illuminate\\Foundation\\Application->make() #7 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(63): Spatie\\LaravelIgnition\\IgnitionServiceProvider->startRecorders() #8 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\\LaravelIgnition\\IgnitionServiceProvider->boot() #9 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #10 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #11 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod() #12 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call() #13 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(928): Illuminate\\Container\\Container->call() #14 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(909): Illuminate\\Foundation\\Application->bootProvider() #15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #16 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(910): array_walk() #17 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #18 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(239): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #19 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith() #20 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #21 /var/data/inpicture/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle() #22 {main} "}

Specs :

Laravel 9 PHP 8.1.5

luca-alsina avatar May 21 '22 08:05 luca-alsina

Hi @luca-alsina, this sounds like a configuration issue. Can you compare your config/flare.php with the default config file found here? https://github.com/spatie/laravel-ignition/blob/main/config/flare.php

AlexVanderbist avatar May 23 '22 11:05 AlexVanderbist

I currently don't have config/flare.php file in my app. I think he is in default state.

luca-alsina avatar May 23 '22 12:05 luca-alsina

I'm getting this error sometimes in my LOGS :

[2022-05-21 04:00:04] local.ERROR: Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 {"exception":"[object] (TypeError(code: 0): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder::__construct(): Argument #2 ($reportBindings) must be of type bool, null given, called in /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php on line 170 at /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/Recorders/QueryRecorder/QueryRecorder.php:19) [stacktrace] #0 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(170): Spatie\\LaravelIgnition\\Recorders\\QueryRecorder\\QueryRecorder->__construct() #1 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(871): Spatie\\LaravelIgnition\\IgnitionServiceProvider->Spatie\\LaravelIgnition\\{closure}() #2 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(756): Illuminate\\Container\\Container->build() #3 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(855): Illuminate\\Container\\Container->resolve() #4 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(692): Illuminate\\Foundation\\Application->resolve() #5 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(840): Illuminate\\Container\\Container->make() #6 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(248): Illuminate\\Foundation\\Application->make() #7 /var/data/inpicture/www/vendor/spatie/laravel-ignition/src/IgnitionServiceProvider.php(63): Spatie\\LaravelIgnition\\IgnitionServiceProvider->startRecorders() #8 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): Spatie\\LaravelIgnition\\IgnitionServiceProvider->boot() #9 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #10 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure() #11 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod() #12 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Container/Container.php(651): Illuminate\\Container\\BoundMethod::call() #13 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(928): Illuminate\\Container\\Container->call() #14 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(909): Illuminate\\Foundation\\Application->bootProvider() #15 [internal function]: Illuminate\\Foundation\\Application->Illuminate\\Foundation\\{closure}() #16 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(910): array_walk() #17 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php(17): Illuminate\\Foundation\\Application->boot() #18 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(239): Illuminate\\Foundation\\Bootstrap\\BootProviders->bootstrap() #19 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\\Foundation\\Application->bootstrapWith() #20 /var/data/inpicture/www/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\\Foundation\\Console\\Kernel->bootstrap() #21 /var/data/inpicture/www/artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle() #22 {main} "}

Specs :

Laravel 9 PHP 8.1.5

I have the same issue with this error every time I upload my app, either for production or development servers.

Messhias avatar Jun 13 '22 15:06 Messhias

Just wanted to say I'm having the same issue, running PHP 8.1.6. Frustrating thing is that it only happens sometimes, when running php artisan optimize. Occasionally breaks my CI script... but not consistently. Very strange.

SceptreData avatar Jul 08 '22 16:07 SceptreData

Just wanted to say I'm having the same issue, running PHP 8.1.6. Frustrating thing is that it only happens sometimes when running PHP artisan optimize. Occasionally breaks my CI script... but not consistently. Very strange.

I tried right now, it happen too.

Messhias avatar Jul 12 '22 21:07 Messhias

Yes it happens to me as well. It breaks my Ci script. any solution?

DeepakAryal avatar Jul 22 '22 11:07 DeepakAryal

Yes it happens to me as well. It breaks my Ci script. any solution?

I opened a PR that will stop this on https://github.com/spatie/laravel-ignition/pull/98, and incredible this is the only PR open and no one gives a chance to look at it.

Messhias avatar Jul 22 '22 15:07 Messhias

same here (breaks my CI script... but not consistently)

ivan-kudritskiy avatar Aug 16 '22 10:08 ivan-kudritskiy

Have the same problem sometimes

vismutx avatar Aug 16 '22 23:08 vismutx

Have the same problem sometimes

In the #81 solves this problem.

Messhias avatar Aug 17 '22 06:08 Messhias

rm -rf bootstrap/cache/*.php

once again did the trick for me.

fabian-rohr avatar Aug 17 '22 09:08 fabian-rohr

Hi there, for some reason it seems like your application's config is missing some important keys... This might be due to config caching. I'd recommend trying php artisan config:clear and if that doesn't work, rm -rf bootstrap/cache/*.php like @Hillcow suggested.

I've also added some default values for the missing config keys to avoid having this problem in the future. Running composer update should pull those in and fix the issue altogether.

Good luck & feel free to open a new issues if the problem persists

AlexVanderbist avatar Aug 26 '22 13:08 AlexVanderbist