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
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/635474but now it cannot edit my .env file with the errorPlease 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 errorUnable to locate publishable resources.After setup the env manually it seems to send out the transaction and error, but there is nothing in sentry.
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 theHttpTransportclass here:vendor/sentry/sentry/src/Transport/HttpTransport.phpon about line133in thesendfunctioncatchblock and see if that gives you some clue what is going on!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:discoveron Laravel 5.6.