Search code examples
iosfirebasefirebase-crash-reporting

Firebase crash batch upload fail for unknown reason


I'm trying to upload DSYM s to firebase, which worked perfectly till a few days before. When I start the script, and it s start loggin, a few lines after it stuck for a few minutes and then fails.

/Users/..../dSYMs/DF...C47.dSYM/Contents/Resources/DWARF/leveldb: warning: function at offset 0x51662 has no name
./Pods/FirebaseCrash/upload-sym-util.bash:365: error: upload: Unable to upload symbol file (reason unknown).

The interesting thing is, in firebase console it tells me the upload was successful:

Future stack traces for UUID B4...AAF will be symbolicated using the uploaded symbol file.

But it never, because I ve "uploaded" a few like this, and since that, I had a few more crashes, but still not symbolicated...

What's going on?

FYI: I'm using firebase crashreporting since February, and it worked nicely. I updated my mac to High Sierra a few days ago.

Thy


Solution

  • TL;DR

    Look for the following line in upload-sym-util.bash:

    HTTP_STATUS=$(curl ${CURLOPT} -sfL -H 'Content-Type: text/plain' -H "Authorization: Bearer ${BEARER_TOKEN}" -w '%{http_code}' -T "${FILE}" "${UPLOAD_URL}")
    

    And append --http1.1 at the end so that it becomes:

    HTTP_STATUS=$(curl ${CURLOPT} -sfL -H 'Content-Type: text/plain' -H "Authorization: Bearer ${BEARER_TOKEN}" -w '%{http_code}' -T "${FILE}" "${UPLOAD_URL}" --http1.1)
    

    Explanation

    We have been having this issue when uploading the DSYM files on Firebase via XCode. What was driving us crazy was that the process seemed to randomly succeed and fail. When the upload failed, it did after a few minutes.

    We managed to run the offending curl command manually and discovered that it was returning an HTTP status code of 000 which seems to happen when the connection is closed before the server actually returns anything (eg: timeout). By using the --verbose argument we discovered that curl was aborting the call with an INTERNAL_ERROR (err 2) which seemed to be linked with the use of HTTP/2. We managed to confirm this when we found out that the only machine that was able to upload the DSYM files correctly had the same version of curl as everyone else but with no HTTP/2 support, which was apparently added in High Sierra. We forced curl to use HTTP1.1 and it did the trick.