You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Trying to set the user-agent with a header provider throws an IllegalArgumentException:
Exception in thread "main" java.lang.IllegalArgumentException: Multiple entries with same key: user-agent=test and user-agent=spanner-java/
at com.google.common.collect.RegularImmutableMap.duplicateKeyException(RegularImmutableMap.java:181)
at com.google.common.collect.RegularImmutableMap.createHashTable(RegularImmutableMap.java:120)
at com.google.common.collect.RegularImmutableMap.create(RegularImmutableMap.java:81)
at com.google.common.collect.ImmutableMap$Builder.build(ImmutableMap.java:355)
at com.google.cloud.spanner.spi.v1.GapicSpannerRpc.<init>(GapicSpannerRpc.java:317)
at com.google.cloud.spanner.SpannerOptions$DefaultSpannerRpcFactory.create(SpannerOptions.java:467)
at com.google.cloud.spanner.SpannerOptions$DefaultSpannerRpcFactory.create(SpannerOptions.java:462)
at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:561)
at com.google.cloud.spanner.SpannerOptions.getSpannerRpcV1(SpannerOptions.java:1169)
at com.google.cloud.spanner.SpannerImpl.<init>(SpannerImpl.java:134)
at com.google.cloud.spanner.SpannerOptions$DefaultSpannerFactory.create(SpannerOptions.java:457)
at com.google.cloud.spanner.SpannerOptions$DefaultSpannerFactory.create(SpannerOptions.java:452)
at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:541)
at com.google.cloud.spanner.Main.main(Main.java:40)
You can reproduce the error with the following code:
Trying to set the user-agent with a header provider throws an
IllegalArgumentException:You can reproduce the error with the following code: