-
Notifications
You must be signed in to change notification settings - Fork 173
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
Deprecation warnings in 4.1.0 #483
Comments
The last three deprecations are fixed in getsentry/sentry-php#1206, and will be released in the next patch version of The first one instead is tricky, and I'm not sure we can overcome it... DBAL is pretty entangled now. |
The afromentioned deprecations about the |
How to suppress this error message? |
We're trying something more with #553, but it's possible that those deprecations will never go away since we have to support both DBAL v2 & v3 at the same time. |
But how can i suppress this message from output, when i call |
That's due to Symfony, not us, you need to check their docs. |
I don't deeply understand how errors are handled, but i think that it's an error(notice) inside error handler, and that is why it is not handled by other error handlers and go to STD_ERR in console.
|
I bet it won't, but can you please try updating to |
It's a deprecation, so it's handled like that. Since Symfony 5.1+, there's a dedicated channel: https://github.com/symfony/recipes/blob/master/symfony/monolog-bundle/3.7/config/packages/prod/deprecations.yaml |
Hi @ste93cry. Upgrading to 4.2.3 has removed the deprecation warning. I was on 4.2.2 previously. |
I think that the deprecation gone because you also upgraded the |
IIUC, the warnings should be gone in the latest |
I'm using DBAL v2.13.2
|
I just checked some projects I work on and I definitely still see the deprecation about the |
Still seing deprecations in 4.2.6 for DBAL 3.3.1 2022-02-02T18:39:03+00:00 [info] User Deprecated: Class "Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnection" should implement method "Doctrine\DBAL\Driver\Connection::getNativeConnection(): resource|object".
2022-02-02T18:39:03+00:00 [info] User Deprecated: Class "Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingServerInfoAwareDriverConnection" should implement method "Doctrine\DBAL\Driver\Connection::getNativeConnection(): resource|object".
2022-02-02T18:39:03+00:00 [info] User Deprecated: The "Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingServerInfoAwareDriverConnection" class implements "Doctrine\DBAL\Driver\ServerInfoAwareConnection" that is deprecated The methods defined in this interface will be made part of the {@see Driver} interface in the next major release.
2022-02-02T18:39:03+00:00 [info] User Deprecated: Class "Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingServerInfoAwareDriverConnection" should implement method "Doctrine\DBAL\Driver\Connection::getNativeConnection(): resource|object". |
hi ~ I also encounter the deprecation messages on the console. What I found out was that when I enabled Sentry as a logger DebugHandlersListener of SF was called after Sentry ErrorHandler was initialized. Therefore the following code $handler = set_exception_handler('var_dump');
$this->earlyHandler = \is_array($handler) ? $handler[0] : null;
restore_exception_handler(); sees the Sentry ErrorHandler instead of the Symfony ErrorHandler, what then results in the Logger not properly being setup for the ErrorHandler (which is normally done in DebugHandlersListener ::configure), which then results in the default BufferingLogger to be used for the deprecation message which are outputted at the end. As a fix for this I used Sentry logger using the old behaviour using monolog.type=service instead of sentry and the lazy loaded that services. This way DebugHandlersListener __constructor is caller before Sentry changes the error_handler. monolog:
handlers:
sentry:
type: service
id: App\Sentry\MonologHandler see: https://symfony.com/doc/current/service_container/lazy_services.html App\Sentry\MonologHandler:
lazy: true
public: true
arguments:
$hub: '@Sentry\State\HubInterface'
$level: !php/const Monolog\Logger::ERROR I hope this helps |
Thanks @wimwinterberg but unfortunately this is a known issue; see #337. |
I'm having the same issue @Tofandel is having, also on symfony 5.4.2 / php8.1 |
This comment was marked as off-topic.
This comment was marked as off-topic.
The deprecation warnings make it almost impossible to see real errors.
Odd, since this is Sentry's entire reason for being.
No idea how to solve it, alas, so I'm just part of the chorus hoping it
happens.
…On Wed, Mar 16, 2022 at 8:07 PM github-actions[bot] < ***@***.***> wrote:
This issue has gone three weeks without activity. In another week, I will
close it.
But! If you comment or otherwise update it, I will reset the clock, and if
you label it Status: Backlog or Status: In Progress, I will leave it
alone ... forever!
------------------------------
"A weed is but an unloved flower." ― *Ella Wheeler Wilcox* 🥀
—
Reply to this email directly, view it on GitHub
<#483 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEXIQP4JIO2U2NEWIMO3ODVAJZUPANCNFSM43FXRKGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I don't think that this is a fair statement. Just one deprecation remains, which is the one related to the DBAL, and it would have been fixed already if it was so easy to do it. The reality is a bit different unfortunately: that class is deprecated, but we have to implement it because otherwise our decorator would break the applications that expect the connection to be an instance of |
To be fair, I think that Symfony makes it too hard to hide
deprecation errors. And monolog is very confusing to someone who just
wants to capture errors.
It's not just Sentry, of course, several older bundles are full of
deprecation warnings. It's an oft-discussed issue.
…On Wed, Mar 16, 2022 at 8:39 PM Stefano Arlandini ***@***.***> wrote:
The deprecation warnings make it almost impossible to see real errors.
I don't think that this is a fair statement. Just one deprecation remains,
which is the one related to the DBAL, and it would have been fixed already
if it was so easy to do it. The reality is a bit different unfortunately:
that class is deprecated, but we have to implement it because otherwise our
decorator would break the applications that expect the connection to be an
instance of ExceptionConverterDriver
—
Reply to this email directly, view it on GitHub
<#483 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEXIQILZ5ECNZ3VUOTOA63VAJ5NJANCNFSM43FXRKGA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
For me, it's not just the deprecations (from #596) but my app effectively and suddenly (with Sentry v3.4?) stopped working. |
Please open a separate issue and post more details. An image of an error message is not enough to understand what's happening |
Hey! Can we fix this error? Some check on what version is used and determining correct class?
Running following versions:
Edit: |
@ste93cry can we drop the support for dbal v2 already and fix the deprecation? No need to support old dbal that is unmaintained. People can still install old versions of this lib to work with old dbal if needed. |
I would love to, but I don't think it's feasible without the proof that the majority of people upgraded from DBAL |
Looking at https://packagist.org/packages/doctrine/dbal/stats#major/all, I do see a 50/50 split between v2 and v3. So I don't see us of removing dbal v2 support anytime soon. |
Environment
How do you use Sentry?
self-hosted
Which SDK and version?
sentry-symfony 4.1.0
symfony 5.2.6
Steps to Reproduce
Symfony reports a couple of deprecation warnings
Expected Result
no warnings
Actual Result
The text was updated successfully, but these errors were encountered: