Skip to content
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

Deprecated: Use of "static" in callables is deprecated in /app/vendor/sentry/sentry/src/Serializer/AbstractSerializer.php on line 264 #1730

Closed
emircanerkul opened this issue Apr 4, 2024 · 6 comments · Fixed by #1732

Comments

@emircanerkul
Copy link

How do you use Sentry?

Self-hosted / on-premises

SDK version

4.6.1

Steps to reproduce

Have no idea. I'm seeing this in one of our Drupal projects but not the other one. They both use the same version. And the same PHP 8.2. Using https://git.drupalcode.org/project/raven/tree/5.0.9

Linked issue: #821

Expected result

There should be no errors.

Actual result

image
@stayallive
Copy link
Collaborator

stayallive commented Apr 4, 2024

This error comes from the code that serializes values, so something being serialized is triggering this. Are you submitting events to Sentry on that page? Or is that page triggering events?

You are using a Drupal plugin specifically, have you raised the issue there already (would be interesting to look at this with some more Drupal context)?

@emircanerkul
Copy link
Author

@stayallive I didn't create an issue on drupal because it's more related to that sentry/sentry dependency. Shouldn't these checks be done within this package? Yes, something on the page is triggering this error.

@stayallive
Copy link
Collaborator

A reproduction or failing test would be very helpful here since I have no clue how to trigger this and I'm not setup for Drupal development (hence my suggestion/question if you asked there first) in case it's something Drupal specific.

I'm sure we eventually have to tackle it here, but there it too little information to reproduce this for me at the moment.

@mfb
Copy link
Contributor

mfb commented Apr 4, 2024

This happens if a string happens to be a deprecated callable, and you run is_callable() on it.

Can sentry simply add @ to its is_callable() calls to silence the deprecation?

Minimal reproduce case:

require './vendor/autoload.php';

ini_set('error_reporting', E_ALL);
ini_set('zend.exception_ignore_args', FALSE);

\Sentry\init();

class foo {
  function __construct(string $bar) {
    \Sentry\captureException(new \Exception('doh!'));
  }
}

new foo('static::sort');

@cleptric
Copy link
Member

cleptric commented Apr 4, 2024

Yes

@emircanerkul
Copy link
Author

Thank you @mfb for the STP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants