Skip to content

Undeclared dependency in AbstractTraceableHttpClient #714

@Dormilich

Description

@Dormilich

Environment

PHP: 7.4.33
sentry/sdk: (omitted)
sentry/sentry: 3.17.0
sentry/sentry-symfony: 4.7.0
symfony/*: 5.4.21

Steps to Reproduce

Note: Installation done through composer

  1. install Symfony LTS (5.4)
  2. install symfony/http-client and nyholm/psr7
  3. disable sentry/sdk in composer.json
  4. install sentry/sentry-symfony
  5. use default configuration (tracing enabled)
  6. trigger the error by running code that makes an HTTP request

Expected Result

The HTTP request should be processed without error.

Actual Result

The requests throws a class-not-found error.

NOTICE: PHP message: php.CRITICAL: Uncaught Error: Class 'GuzzleHttp\Psr7\Uri' not found {"exception":"[object] (Error(code: 0): Class 'GuzzleHttp\\Psr7\\Uri' not found at /app/vendor/sentry/sentry-symfony/src/Tracing/HttpClient/AbstractTraceableHttpClient.php:54)"} []

The reason for this error is that GuzzleHttp\Psr7\Uri is used in AbstractTraceableHttpClient::request() without declaring it a dependency in either sentry/sentry-symfony or sentry/sentry. However, guzzlehttp/psr7 is a dependency of sentry/sdk.

A possible fix were to have a dependency on Psr\Http\Message\UriFactoryInterface in AbstractTraceableHttpClient since that is already required by sentry/sentry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions