-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
Crashes on Motorola devices for Sentry.traceHeaders() IllegalArgumentException:String representation of SentryId has either 32 (UUID no dashes) or 36 characters long (completed UUID). Received: 00000000 #2325
Comments
This looks like a Motorola issue indeed (e.g. a similar issue reported on Gson), but could you share a bit more details, why are you using Also, I believe I'm all in for adding a guard flag against invalid UUID, but wanna better understand exactly what is the pattern. It's hard to reproduce since we do not have those Motorola devices in hand. Thank you! |
Thanks for looking into it. I'm afraid the stack trace is obfuscated until the block I've pasted which gets called during app start within an app initializer from Google's startupx library. To be fair it's possible that we generally used this method wrong. I'll try to add more infos on Monday. (Unfortunately we also don't have any Motorola devices) |
@kibotu thanks, yeah, we'd need to find out where exactly this is coming from. You aren't uploading the proguard mappings, are you? Otherwise the stacktrace should be unminifed |
here the stacktrace, as mentioned sentry library is obfuscated:
we were trying to add network performance monitoring and added an interceptor to the okhttp client import io.sentry.Sentry
import io.sentry.SentryTraceHeader
import io.sentry.SpanId
import io.sentry.SpanStatus
import io.sentry.TransactionContext
import io.sentry.protocol.SentryId
import okhttp3.Interceptor
import okhttp3.Response
/**
* Interceptor used to start transactions and/or spans for monitoring API Requests in Sentry Performance Monitoring
*/
internal class SentryApiMonitoringInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request()
val ongoingTransactionOrSpan = Sentry.getSpan() ?: Sentry.startTransaction("Request", "network")
// add api call child spans to ongoing transaction/span
val requestChildSpan = ongoingTransactionOrSpan.startChild("HTTP ${request.method}", "${request.url.host}${request.url.encodedPath}")
// also create a separated transaction for api calls to be viewed independently
val generalApiTransaction = Sentry.startTransaction(
TransactionContext.fromSentryTrace(
"HTTP ${request.method} ${request.url.host}${request.url.encodedPath}",
"request",
Sentry.traceHeaders() ?: SentryTraceHeader(SentryId.EMPTY_ID, SpanId.EMPTY_ID, true)
),
false
)
val response = chain.proceed(request)
requestChildSpan.finish(SpanStatus.fromHttpStatusCode(response.code))
generalApiTransaction.finish(SpanStatus.fromHttpStatusCode(response.code))
return response
}
}
|
So, after looking into this a bit more, I believe the culprit is here
probably on Motorola devices The immediate fix for you @kibotu will be to get rid of this block: val generalApiTransaction = Sentry.startTransaction(
TransactionContext.fromSentryTrace(
"HTTP ${request.method} ${request.url.host}${request.url.encodedPath}",
"request",
Sentry.traceHeaders() ?: SentryTraceHeader(SentryId.EMPTY_ID, SpanId.EMPTY_ID, true)
),
false
) because However we should still add some checks to make SentryId fail-safe. |
thanks :) |
Gradle Version
7.5.1
AGP Version
7.3.0
Code Minifier/Optimizer
R8
Version
3.2.0
Sentry SDK Version
6.5.0
Steps to Reproduce
app crashes on Motorola devices with
String representation of SentryId has either 32 (UUID no dashes) or 36 characters long (completed UUID). Received: 00000000
looks like Sentry.traceHeaders() will not have valid uuids on Motorola devices.
Expected Result
well ... not to crash (voting for github template for crash reporting)
Actual Result
crashes
affected devices
The text was updated successfully, but these errors were encountered: