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

NPE in SplunkRumBuilder.build #1030

Open
ber4444 opened this issue Oct 21, 2024 · 3 comments
Open

NPE in SplunkRumBuilder.build #1030

ber4444 opened this issue Oct 21, 2024 · 3 comments
Labels
needs author feedback Waiting for additional feedback from the author

Comments

@ber4444
Copy link

ber4444 commented Oct 21, 2024

OS version: android14
Model:Galaxy S23
SDK version:1.6.0
Stacktrace:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'char java.lang.String.charAt(int)' on a null object reference
       at okhttp3.internal.idn.IdnaMappingTable.findRangesOffset(IdnaMappingTable.java:242)
       at okhttp3.internal.idn.IdnaMappingTable.map(IdnaMappingTable.java:130)
       at okhttp3.internal._HostnamesCommonKt.idnToAscii(-HostnamesCommon.kt:322)
       at okhttp3.internal._HostnamesCommonKt.toCanonicalHost(-HostnamesCommon.kt:307)
       at okhttp3.HttpUrl$Builder.parse$okhttp(HttpUrl.java:1448)
       at okhttp3.HttpUrl$Companion.get(HttpUrl.java:1744)
       at okhttp3.HttpUrl$Companion.parse(HttpUrl.java:1754)
       at okhttp3.HttpUrl.parse(HttpUrl.java:34)
       at zipkin2.reporter.okhttp3.InternalOkHttpSender.newEndpoint(InternalOkHttpSender.java:61)
       at zipkin2.reporter.okhttp3.InternalOkHttpSender.newEndpoint(InternalOkHttpSender.java:36)
       at zipkin2.reporter.BaseHttpSender.nextEndpoint(BaseHttpSender.java:108)
       at zipkin2.reporter.BaseHttpSender.<init>(BaseHttpSender.java:96)
       at zipkin2.reporter.BaseHttpSender.<init>(BaseHttpSender.java:78)
       at zipkin2.reporter.okhttp3.InternalOkHttpSender.<init>(InternalOkHttpSender.java:44)
       at zipkin2.reporter.okhttp3.OkHttpSender.<init>(OkHttpSender.java:184)
       at zipkin2.reporter.okhttp3.OkHttpSender$Builder.build(OkHttpSender.java:175)
       at com.splunk.rum.RumInitializer.buildCustomizedZipkinSender(RumInitializer.java:383)
       at com.splunk.rum.RumInitializer.buildStorageBufferingExporter(RumInitializer.java:360)
       at com.splunk.rum.RumInitializer.buildExporter(RumInitializer.java:350)
       at com.splunk.rum.RumInitializer.buildFilteringExporter(RumInitializer.java:328)
       at com.splunk.rum.RumInitializer.lambda$initialize$0(RumInitializer.java:119)
       at io.opentelemetry.android.OpenTelemetryRumBuilder.buildTracerProvider(OpenTelemetryRumBuilder.java:481)
       at io.opentelemetry.android.OpenTelemetryRumBuilder.build(OpenTelemetryRumBuilder.java:320)
       at com.splunk.rum.RumInitializer.initialize(RumInitializer.java:206)
       at com.splunk.rum.SplunkRum.initialize(SplunkRum.java:108)
       at com.splunk.rum.SplunkRumBuilder.build(SplunkRumBuilder.java:348)
@breedx-splk
Copy link
Contributor

Thanks @ber4444 . Was this a one-off problem or is it easily reproducible? Can you share the code that initializes your SplunkRum instance?

@breedx-splk breedx-splk added the needs author feedback Waiting for additional feedback from the author label Oct 21, 2024
@ber4444
Copy link
Author

ber4444 commented Oct 21, 2024

Seems to be one-off (so far!), code is:

SplunkRum.builder()
        .setRealm("us0")
        .setRumAccessToken(token)
        .setApplicationName("xxx")
        .enableDiskBuffering()
        .setDeploymentEnvironment(BuildConfig.FLAVOR)
        .setGlobalAttributes(
            Attributes.builder()
                .put(StandardAttributes.APP_VERSION, appVersion)
                .put(StandardAttributes.APP_BUILD_TYPE, BuildConfig.BUILD_TYPE)
                .build()
        )
        .build(context)

@breedx-splk
Copy link
Contributor

That is super weird. So it's down in the url parsing code of okhttp. Because you're passing the realm as us0 it should be pretty straightforward for the sdk to build a parseable url. A couple follow-up questions:

  • What version of the splunk rum sdk are you using?
  • Are you bringing in a version of okhttp? If so, what version?
  • Is the token value dynamic or read from somewhere?

It's making me wonder if the realm or token values might have hidden unicode in them or are somehow broken....but if that were the case, it should be repeatable. Hrmph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs author feedback Waiting for additional feedback from the author
Projects
None yet
Development

No branches or pull requests

2 participants