bugsnag / bugsnag-android-gradle-plugin

Gradle plugin for BugSnag which uploads ProGuard, DexGuard and NDK mapping files, and sends build notifications
https://docs.bugsnag.com/build-integrations/gradle/
MIT License
70 stars 38 forks source link

Mapping file upload fails #308

Closed ZacSweers closed 3 years ago

ZacSweers commented 4 years ago

Describe the bug

In uploads, it seems that bugsnag's endpoints occasionally timeout

[2020-09-16T00:56:15.468Z] Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Bugsnag request failed to complete

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.internal.UploadRequestClient.makeRequestIfNeeded(UploadRequestClient.kt:39)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.BugsnagUploadProguardTask.upload(BugsnagUploadProguardTask.kt:104)

[2020-09-16T00:56:15.468Z]  at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:104)

[2020-09-16T00:56:15.468Z]  ... 181 more

[2020-09-16T00:56:15.468Z] Caused by: java.lang.IllegalStateException: Bugsnag request failed to complete

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.internal.BugsnagHttpClientHelperKt$retryInterceptor$1.intercept(BugsnagHttpClientHelper.kt:75)

[2020-09-16T00:56:15.468Z]  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

[2020-09-16T00:56:15.468Z]  at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)

[2020-09-16T00:56:15.468Z]  at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.BugsnagMultiPartUploadRequest.uploadToServer(BugsnagMultiPartUploadRequest.kt:54)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.BugsnagMultiPartUploadRequest.uploadMultipartEntity(BugsnagMultiPartUploadRequest.kt:38)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.BugsnagUploadProguardTask$upload$response$1.invoke(BugsnagUploadProguardTask.kt:106)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.BugsnagUploadProguardTask$upload$response$1.invoke(BugsnagUploadProguardTask.kt:42)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.internal.UploadRequestClient$makeRequestIfNeeded$$inlined$getOrPut$lambda$1.call(UploadRequestClient.kt:36)

[2020-09-16T00:56:15.468Z]  at com.bugsnag.android.gradle.internal.UploadRequestClient$makeRequestIfNeeded$$inlined$getOrPut$lambda$1.call(UploadRequestClient.kt:12)

[2020-09-16T00:56:15.469Z]  at com.bugsnag.android.gradle.internal.UploadRequestClient.makeRequestIfNeeded(UploadRequestClient.kt:38)

[2020-09-16T00:56:15.469Z]  ... 183 more

[2020-09-16T00:56:15.469Z] Caused by: java.io.IOException: Canceled

[2020-09-16T00:56:15.469Z]  at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:72)

[2020-09-16T00:56:15.469Z]  at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)

[2020-09-16T00:56:15.469Z]  at com.bugsnag.android.gradle.internal.BugsnagHttpClientHelperKt$retryInterceptor$1.intercept(BugsnagHttpClientHelper.kt:69)

[2020-09-16T00:56:15.469Z]  ... 193 more

Steps to reproduce

  1. Upload a mapping file often enough to hit it

Environment

We haven't been able to get a public repro, but are uploading to a custom endpoint per our shared channel with the team

mattdyoung commented 3 years ago

Closing as we haven't seen any other instances of this failing for a few months now.

We believe implementing gzip compression, available from v5.4.0 onwards reduced the likelihood of the timeouts.

It's also possible to increase the timeout from the default 1 minute by setting the requestTimeoutMs property in the plugin config. E.g.

bugsnag {
    requestTimeoutMs = 300000L
}
shashachu commented 3 years ago

@mattdyoung At Pinterest we are seeing this same issue very intermittently on CI. We're on plugin version 5.7.0. We'll try to increase the timeout to see if that resolves it. Thanks!

mattdyoung commented 3 years ago

@shashachu Thanks for the info. If you do still see issues please send the full details to support@bugsnag.com and we can investigate further.