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

JSON Body not sent to rollbar

Open tobz-nz opened this issue 7 years ago • 6 comments

Is it just me or is the json body of a request not sent along with the error? I get headers & GET/POST data, but no JSON body content

tobz-nz avatar Apr 10 '17 00:04 tobz-nz

@tobz-nz are you getting an error like "API error: Invalid format. data.body must not be undefined. Instead, it should be an object with a 'message', 'trace', 'trace_chain', or 'crash_report' key."? If this is the case I found that laravel-rollbar is tied to 0.15 of rollbar/rollbar which has the following:

https://github.com/rollbar/rollbar-php/blob/v0.15.0/src/rollbar.php#L289

notice the UTF-8//IGNORE and it looks based on PHP comments:

http://php.net/manual/en/function.iconv.php#108643

That this is not supported in newer versions of PHP, in my case we are using PHP 7.1 and have hit this issue.

mrtimp avatar May 10 '17 02:05 mrtimp

My version constraint it "jenssegers/rollbar": "^1.5", (installed version is 1.5.1) I just have the default Laravel setup. I have an api, when a request comes in with a json body & an error occurs the request body is not sent through to Rollbar. I've not configured anything manually to do with sending the error. Do I need to do some extra setup?

tobz-nz avatar May 10 '17 02:05 tobz-nz

I should have clarified that the error "API error: ..." was actually an exception that was displayed inside the Rollbar dashboard. So if you aren't seeing that then its likely not the same issue I've hit.

Are you sure you've followed all of the steps here:

https://github.com/jenssegers/laravel-rollbar#installation

You need to ensure that you've configured the service provider, configured it with your Rollbar token etc and attached it to your exception/error handler.

mrtimp avatar May 10 '17 03:05 mrtimp

I had the same problem. Couldn't get it to work with this package, but the official package from Rollbar (forked from this one) worked out of the box for me.

edbentinck avatar Jun 13 '17 00:06 edbentinck

Same issue here, but's not directly a bug in this, plain body data ist not recognized by the official rollbar package. Can you maybe update the official rollbar package in the dependencies?

mThallerWeb avatar Jun 29 '17 09:06 mThallerWeb

I'm having the same issue as @mThallerWeb.

jschlies avatar Sep 19 '17 20:09 jschlies