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

Crashpad upload error (linux) #34

Closed
alexey-prokopyev opened this issue Aug 30, 2019 · 4 comments
Closed

Crashpad upload error (linux) #34

alexey-prokopyev opened this issue Aug 30, 2019 · 4 comments

Comments

@alexey-prokopyev
Copy link

alexey-prokopyev commented Aug 30, 2019

I'm going to use crashpad and sentry in Ubuntu. After building sentrypad a run sentry_example_crashpad and get:
FATAL http_transport_socket.cc:548] Check failed: scheme == “http”. Got https for scheme in ‘https://sentry.io/MY_DSN’.
It looks like crashpad_client was built without define "crashpad_use_boringssl_for_http_transport_socket=true" (i got crashpad_client by running scripts/download.sh crashpad)

@alexey-prokopyev alexey-prokopyev changed the title Crashpad upload error with https (linux) Crashpad upload error (linux) Aug 30, 2019
@mitsuhiko
Copy link
Member

Yep, currently only the http transport works. I'm investigating if we should remove all the crashpad/breakpad upload functionality and just do this ourselves separately since we need an independent http transport anyways for custom events.

@MouhK
Copy link

MouhK commented Nov 21, 2019

Hi,

I faced the same issue, using the native sdk, maybe this patch is enough, seems to work so far.

From 596e29d5571c40ca1301343ea5baa4923d6c5f04 Mon Sep 17 00:00:00 2001
From: Mouhamad Kebe <mouhamad.kebe@blade-group.com>
Date: Fri, 15 Nov 2019 11:58:19 +0100
Subject: [PATCH] linux: Add "Host:" to HTTP request

---
 crashpad/build/crashpad/util/net/http_transport_socket.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/crashpad/build/crashpad/util/net/http_transport_socket.cc b/crashpad/build/crashpad/util/net/http_transport_socket.cc
index 4dd01b6..fb179ed 100644
--- a/crashpad/build/crashpad/util/net/http_transport_socket.cc
+++ b/crashpad/build/crashpad/util/net/http_transport_socket.cc
@@ -327,6 +327,7 @@ base::ScopedFD CreateSocket(const std::string& hostname,
 
 bool WriteRequest(Stream* stream,
                   const std::string& method,
+                  const std::string& hostname,
                   const std::string& resource,
                   const HTTPHeaders& headers,
                   HTTPBodyStream* body_stream) {
@@ -335,6 +336,11 @@ bool WriteRequest(Stream* stream,
   if (!stream->LoggingWrite(request_line.data(), request_line.size()))
     return false;
 
+  // Write Host header
+  request_line = base::StringPrintf("Host: %s\r\n", hostname.c_str());
+  if (!stream->LoggingWrite(request_line.data(), request_line.size()))
+    return false;
+
   // Write headers, and determine if Content-Length has been specified.
   bool chunked = true;
   size_t content_length = 0;
@@ -574,7 +580,7 @@ bool HTTPTransportSocket::ExecuteSynchronously(std::string* response_body) {
 #endif  // CRASHPAD_USE_BORINGSSL
 
   if (!WriteRequest(
-          stream.get(), method(), resource, headers(), body_stream())) {
+          stream.get(), method(), hostname, resource, headers(), body_stream())) {
     return false;
   }
 
-- 
2.11.0

Cheers

@alexey-prokopyev
Copy link
Author

Thanx to MouthK, but i still getting an error
FATAL http_transport_socket.cc:548] Check failed: scheme == “http”. Got https for scheme in ‘https://sentry.io/MY_DSN’.
Building crashpad_utils with -DCRASHPAD_USE_BORINGSSL cause many errors.

@Swatinem
Copy link
Member

With the rewrite of sentry-native that will be released later today, we do not currently support building the crashpad backend on linux. I will be focusing on breakpad support, and maybe revisit supporting crashpad on linux after that. Like @mitsuhiko mentioned already, maybe we will end up not using the crashpad upload functionality at all, but rather upload in the SDK itself.

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

No branches or pull requests

4 participants