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

[BUG] Sentry PHP / Symfony Bundle #92

Closed
gander opened this issue Nov 17, 2023 · 1 comment · Fixed by #100
Closed

[BUG] Sentry PHP / Symfony Bundle #92

gander opened this issue Nov 17, 2023 · 1 comment · Fixed by #100
Assignees

Comments

@gander
Copy link

gander commented Nov 17, 2023

Config

SENTRY_DSN=http:https://sentry@buggregator:8000/1
VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=buggregator:9912
MONOLOG_SOCKET_HOST=buggregator:9913
MAILER_DSN=smtp:https://buggregator:1025

VarDumper, Monolog and SMTP modules working properly. I checked the hosts from the container - they are reachable.

Packages

package version description
sentry/sdk 3.5.0 This is a metapackage shipping sentry/sentry with a recommended HTTP client.
sentry/sentry 3.22.1 A PHP SDK for Sentry (http:https://sentry.io)
sentry/sentry-symfony 4.12.0 Symfony integration for Sentry (http:https://getsentry.com)

Code

I put a dump here to find out why communication is not working

\Sentry\Transport\HttpTransport::send

        try {
            /** @var ResponseInterface $response */
            $response = $this->httpClient->sendAsyncRequest($request)->wait();
        } catch (\Throwable $exception) {
            dump($exception);

            $this->logger->error(
                sprintf('Failed to send the event to Sentry. Reason: "%s".', $exception->getMessage()),
                ['exception' => $exception, 'event' => $event]
            );

            return new RejectedPromise(new Response(ResponseStatus::failed(), $event));
        }

Exception

Http\Client\Common\Exception\ServerErrorException {#6139 ▼
  #message: "Internal Server Error"
  #code: 500
  #file: "/var/www/html/vendor/php-http/client-common/src/Plugin/ErrorPlugin.php"
  #line: 87
  -request: GuzzleHttp\Psr7\Request {[#6120 ▼]
    -method: "POST"
    -requestTarget: null
    -uri: GuzzleHttp\Psr7\Uri {#6115 ▶}
    -headers: array:4 [▼
      "Host" => array:1 [▼
        0 => "buggregator:8000"
      ]
      "Content-Type" => array:1 [▼
        0 => "application/x-sentry-envelope"
      ]
      "User-Agent" => array:1 [▼
        0 => "sentry.php.symfony/4.12.0"
      ]
      "X-Sentry-Auth" => array:1 [▼
        0 => "Sentry sentry_version=7, sentry_client=sentry.php.symfony/4.12.0, sentry_key=sentry"
      ]
    ]
    -headerNames: array:4 [▶]
    -protocol: "1.1"
    -stream: GuzzleHttp\Psr7\Stream {#6119 ▶}
  }
  #response: GuzzleHttp\Psr7\Response {[#6064 ▼]
    -reasonPhrase: "Internal Server Error"
    -statusCode: 500
    -headers: array:10 [▶]
    -headerNames: array:10 [▶]
    -protocol: "1.1"
    -stream: GuzzleHttp\Psr7\Stream {#6113 ▼
      -stream: stream resource @1608 ▶}
      -size: null
      -seekable: true
      -readable: true
      -writable: false
      -uri: "Symfony-Component-HttpClient-Response-StreamWrapper:https://http:https://buggregator:8000/api/1/envelope/"
      -customMetadata: []
    }
  }
  trace: {▶}
}
@butschster butschster self-assigned this Nov 17, 2023
@butschster butschster linked a pull request Dec 1, 2023 that will close this issue
@gander
Copy link
Author

gander commented Dec 2, 2023

Now it's working
image

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

Successfully merging a pull request may close this issue.

2 participants