buggregator / server

Buggregator is a lightweight, standalone server that offers a range of debugging features for PHP applications.
https://buggregator.dev/
Other
682 stars 24 forks source link

[BUG] Sentry PHP / Symfony Bundle #92

Closed gander closed 10 months ago

gander commented 11 months ago

Config

SENTRY_DSN=http://sentry@buggregator:8000/1
VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=buggregator:9912
MONOLOG_SOCKET_HOST=buggregator:9913
MAILER_DSN=smtp://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://sentry.io)
sentry/sentry-symfony 4.12.0 Symfony integration for Sentry (http://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://http://buggregator:8000/api/1/envelope/"
      -customMetadata: []
    }
  }
  trace: {▶}
}
gander commented 10 months ago

Now it's working image