jkocik / laravel-profiler

Profiler for Laravel Framework
MIT License
188 stars 13 forks source link

Error: json_encode error: Malformed UTF-8 characters #17

Open mxkyu opened 11 months ago

mxkyu commented 11 months ago

I have this error with lots of production data (it contains large json data): GuzzleHttp\Exception\InvalidArgumentException: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded in /app/vendor/guzzlehttp/guzzle/src/Utils.php:299 In stack trace i found: #4 /app/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(57): GuzzleHttp\Client->request('POST', 'http://localhos...', Array) In file src/Processors/BroadcastingProcessor.php on line 57 i must do mb_convert_encoding(): mb_convert_encoding($dataTracker->data()->toArray(), 'UTF-8', 'UTF-8'), and it works without any error.

Can you fix it feature versions?

benascbr commented 3 weeks ago

Same here.

GuzzleHttp\Exception\InvalidArgumentException: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded in /foobar/vendor/guzzlehttp/guzzle/src/Utils.php:298
Stack trace:
#0 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(377): GuzzleHttp\Utils::jsonEncode()
#1 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(328): GuzzleHttp\Client->applyOptions()
#2 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer()
#3 /foobar/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync()
#4 /foobar/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(54): GuzzleHttp\Client->request()
#5 /foobar/vendor/jkocik/laravel-profiler/src/Processors/BroadcastingProcessor.php(40): JKocik\Laravel\Profiler\Processors\BroadcastingProcessor->broadcast()
#6 /foobar/vendor/jkocik/laravel-profiler/src/LaravelDataProcessor.php(58): JKocik\Laravel\Profiler\Processors\BroadcastingProcessor->process()
#7 /foobar/vendor/laravel/framework/src/Illuminate/Collections/Traits/EnumeratesValues.php(235): JKocik\Laravel\Profiler\LaravelDataProcessor->JKocik\Laravel\Profiler\{closure}()
#8 /foobar/vendor/jkocik/laravel-profiler/src/LaravelDataProcessor.php(56): Illuminate\Support\Collection->each()
#9 /foobar/vendor/jkocik/laravel-profiler/src/LaravelProfiler.php(96): JKocik\Laravel\Profiler\LaravelDataProcessor->process()
#10 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): JKocik\Laravel\Profiler\LaravelProfiler->JKocik\Laravel\Profiler\{closure}()
#11 /foobar/vendor/laravel/framework/src/Illuminate/Container/Util.php(41): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#12 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(81): Illuminate\Container\Util::unwrapIfClosure()
#13 /foobar/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(35): Illuminate\Container\BoundMethod::callBoundMethod()
#14 /foobar/vendor/laravel/framework/src/Illuminate/Container/Container.php(661): Illuminate\Container\BoundMethod::call()
#15 /foobar/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1173): Illuminate\Container\Container->call()
#16 /foobar/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(205): Illuminate\Foundation\Application->terminate()
#17 /foobar/vendor/laravel/octane/src/ApplicationGateway.php(51): Illuminate\Foundation\Http\Kernel->terminate()
#18 /foobar/vendor/laravel/octane/src/Worker.php(110): Laravel\Octane\ApplicationGateway->terminate()
#19 /foobar/vendor/laravel/octane/bin/swoole-server(120): Laravel\Octane\Worker->handle()
#20 [internal function]: {closure}()
#21 /foobar/vendor/laravel/octane/bin/swoole-server(170): OpenSwoole\Server->start()
#22 {main}