Skip to content
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

ERROR: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded #17

Closed
Phoenix3232 opened this issue Jun 10, 2024 · 1 comment

Comments

@Phoenix3232
Copy link

Подключил пакет в Laravel, но никакого профилирования не происходит.
Залез в исходный код, подключил логгер и словил такую ошибку при отправке данных в buggregator.

[2024-06-10 11:40:48] local.ERROR: json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded {"exception":"[object] (GuzzleHttp\Exception\InvalidArgumentException(code: 0): json_encode error: Malformed UTF-8 characters, possibly incorrectly encoded at /var/www/vendor/guzzlehttp/guzzle/src/Utils.php:298)
[stacktrace]
#0 /var/www/vendor/guzzlehttp/guzzle/src/Client.php(377): GuzzleHttp\Utils::jsonEncode('SpiralPackages\\...')
#1 /var/www/vendor/guzzlehttp/guzzle/src/Client.php(328): GuzzleHttp\Client->applyOptions(Object(GuzzleHttp\Psr7\Request), Array)
#2 /var/www/vendor/guzzlehttp/guzzle/src/Client.php(169): GuzzleHttp\Client->transfer(Object(GuzzleHttp\Psr7\Request), Array)
#3 /var/www/vendor/guzzlehttp/guzzle/src/Client.php(189): GuzzleHttp\Client->requestAsync('POST', Object(GuzzleHttp\Psr7\Uri), Array)
#4 /var/www/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(1125): GuzzleHttp\Client->request('POST', 'https://webhook...', Array)
#5 /var/www/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(907): Illuminate\Http\Client\PendingRequest->sendRequest('POST', 'https://webhook...', Array)
#6 /var/www/vendor/laravel/framework/src/Illuminate/Support/helpers.php(304): Illuminate\Http\Client\PendingRequest->Illuminate\Http\Client\{closure}(1)
#7 /var/www/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(905): retry(0, Object(Closure), 100, Object(Closure))
#8 /var/www/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php(804): Illuminate\Http\Client\PendingRequest->send('POST', 'https://webhook...', Array)
#9 /var/www/vendor/laravel/framework/src/Illuminate/Http/Client/Factory.php(471): Illuminate\Http\Client\PendingRequest->post('https://webhook...', 'SpiralPackages\\...')
#10 /var/www/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(357): Illuminate\Http\Client\Factory->__call('post', Array)
#11 /var/www/vendor/spiral-packages/profiler/src/Profiler.php(65): Illuminate\Support\Facades\Facade::__callStatic('post', Array)
#12 /var/www/vendor/maantje/xhprof-buggregator-laravel/src/middleware/XhprofProfiler.php(38): SpiralPackages\Profiler\Profiler->end()
#13 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(258): Maantje\XhprofBuggregatorLaravel\middleware\XhprofProfiler->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#14 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\Foundation\Http\Kernel->terminateMiddleware(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#15 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1178): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response))
#16 /var/www/public/index.php(17): Illuminate\Foundation\Application->handleRequest(Object(Illuminate\Http\Request))
#17 {main}
"}

@Phoenix3232
Copy link
Author

По итогу причина в том, что endpoint должен быть не http://127.0.0.1:8000/api/profiler/store
а http://buggregator:8000/api/profiler/store по имени сервиса в docker-compose

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

No branches or pull requests

1 participant