phptek / silverstripe-sentry

Flexible Sentry compatible bug aggregation client for Silverstripe applications.
BSD 3-Clause "New" or "Revised" License
12 stars 22 forks source link

SS4 PHP7.3 version 3.1 not reporting #39

Closed Firesphere closed 4 years ago

Firesphere commented 4 years ago

It seems the 3.x branch, with SS4 and PHP7.3 is not reporting anything. 😢

phptek commented 4 years ago

Use the 3.0.1 release

phptek commented 4 years ago

Be sure to check the README too, a few things have changed, if all you've been using is 3.0.x-dev

Firesphere commented 4 years ago

Yep, I've done all the updates and changes, (including using 3.0.1), but it's not doing anything, even if I purposefully throw an error.

To clear any issues, I can connect to Sentry just fine from the prod environment.

Here's my YML:

_config# cat sentry.yml 
---
Name: my-project-config-sentry
After:
  - 'sentry-config'
---
PhpTek\Sentry\Adaptor\SentryAdaptor:
  opts:
    dsn: https://mykey:andsentrykey@sentry.io/1722555
phptek commented 4 years ago

Weird.

Here's mine, and I can confirm it reports A-OK to sentry.io

#> composer info phptek/sentry | grep versions
versions : * 3.0.1
Name: my-project-sentry
After:
  - 'sentry-config'
---

PhpTek\Sentry\Adaptor\SentryAdaptor:
  opts:
    dsn: 'https://0foobar6e4a30986bc97488489@sentry.io/1770597'

The only difference I see, is that my DSN is quoted. FYI, As of 3.0.1, you can also declare SENTRY_DSN in .env.

phptek commented 4 years ago

Your DSN format looks different to mine though...

Ah....and mine is on php 7.1 though...one sec

phptek commented 4 years ago

Works in 7.3 too.

Firesphere commented 4 years ago

I are confused now....

I have no clue what's going wrong :/

phptek commented 4 years ago

Can you debug the write() method in SentryHandler. If $record is populated with data, in capture message or captureException(), then that's the jump off point to Monolog, Sentry SDK etc.

You can also ensure that your DSN is being propagated correctly by debugging SentryAdaptor::getOpts()...(I think it's SentryAdaptor off the top if my head)

Firesphere commented 4 years ago

I got it to work with the .env instead. I still have no clue why it wasn't working with the YML though.

I did try the legacy and new Sentry key, but no luck in YML.

phptek commented 4 years ago

That is weird, but I will say this after playing around with the config quite a lot yesterday. flush=all doesn't always purge YML config changes. To guarantee you're operating with the YML you think you're operating with, is to rm -rf /tmp/silverstripe-cache.

Another "cool" (TM) thing I spotted yesterday was that while playing with YML config, no matter what I did (including purging the cache as above), Injector insisted that a non-existent YML config was still set. I struggled with that for an hour or so, and then thought "Is it in memory?". Sure enough, restarting the webserver was what was needed.

Firesphere commented 4 years ago

Sometimes YML is weird, I'll close this for now, as it's all working for me from both YML (locally) and .env (prod)