sentry-laravel: Sentry doesn't send exceptions

I followed all the instructions in the setup guide when I visit /debug-sentry I see an exception got thrown but I got nothing on my sentry issues dashboard.

when I run sentry:test I get

[sentry] Client DSN discovered!
[sentry] Generating test event
[sentry] Sending test event
[sentry] Event sent with ID: c299cb285e8b4e0db65d4ce9f7a1179d

I have my SENTRY_LARAVEL_DSN in the .env file. I tried php artisan config:clear several times and couldn’t make it. I also downloaded https://curl.haxx.se/ca/cacert.pem and configured php.ini

Laravel version 6.0 sentry/sentry-laravel 1.8 OS: WIN 10

I couldn’t find what is the issue, any help?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 3
  • Comments: 15

Most upvoted comments

Edit: My bad… I’d depleted my error usage! Oh my me!

PHP 7.4 Laravel 6.20.26 + Laravel 7 Centos 7 + Windows 10

This has started on my app since a few weeks ago. It just simply does not send the error to Sentry even though I have it all set up correctly and have sent the test transaction with success.

Performance however is working. and I can see the 500 errors that I trigger in the performance section, but nothing in Issues section.

Funny thing is I used to be able to set up projects really quickly with php artisan sentry:publish --dsn=https://MYKEY@o364535.ingest.sentry.io/635474 but now it cannot edit my .env file with the error Please check if your DSN is set properly in your config or '.env' as 'SENTRY_LARAVEL_DSN'. trying to publish the config file also throws this error Unable to locate publishable resources.

After setup the env manually it seems to send out the transaction and error, but there is nothing in sentry.

[Sentry] DSN discovered!
[Sentry] Generating test Event
[Sentry] Sending test Event
[Sentry] Transaction sent: cf9a0b4f12a24922bf1f9cfe879e7024
[Sentry] Event sent with ID: 6dd100ad4a234611826243bc0c70f6fa

Hi @abachi, you’ve actually done all I would suggest you’d do, so that’s very good!

The last thing to check before digging in the code would be to see if you’ve restarted your php-fpm service (if you even use that in your local environment) to apply the changes in your php.ini.

Assuming you did that the best thing would be to place a dd($exception); in the HttpTransport class here: vendor/sentry/sentry/src/Transport/HttpTransport.php on about line 133 in the send function catch block and see if that gives you some clue what is going on!

Hi @abachi, you’ve actually done all I would suggest you’d do, so that’s very good!

The last thing to check before digging in the code would be to see if you’ve restarted your php-fpm service (if you even use that in your local environment) to apply the changes in your php.ini.

Assuming you did that the best thing would be to place a dd($exception); in the HttpTransport class here: vendor/sentry/sentry/src/Transport/HttpTransport.php on about line 133 in the send function catch block and see if that gives you some clue what is going on!

In that case there might be something wrong with the cacert.pem still, I am not sure (because no idea what your setup is) but there could be separate php.ini files for the command line and web requests and maybe you only applied the changes to one and not the other, however not developing on Windows makes this a bit tricky to help you track down.

This was it for me, thank you! Dug into this section and there was a certificate issue. When I upgraded PHP my .ini setting for the cacert wasn’t there anymore. When I make requests to APIs I manually set it when I create the client, but could not figure out why sentry wasn’t working. Got this set in the .ini now and it reported just fine. Thank you!

The logger is not set by default yet (since the logger is new) and not wired by default.

But you did find the error, a forbidden error so I guess your DSN is wrong for instance.

P.S: Please edit your comment if you have more to add later instead of posting multiple updates (easier on the notifications for everyone) 😉

I recently resolved this issue by running php artisan package:discover on Laravel 5.6.