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

Spanner: "Default config is invalid" error #1871

Closed
SanjayVas opened this issue May 5, 2022 · 4 comments
Closed

Spanner: "Default config is invalid" error #1871

SanjayVas opened this issue May 5, 2022 · 4 comments
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner API.

Comments

@SanjayVas
Copy link

SanjayVas commented May 5, 2022

Environment details

  1. Specify the API at the beginning of the title. For example, "BigQuery: ...").
    General, Core, and Other are also allowed as types
  2. OS type and version: Debian Linux Bookworm (gLinux)
  3. Java version: JDK11
  4. version(s): google-cloud-spanner 6.23.3, grpc-java 1.45.1

Steps to reproduce

  1. Connect to Spanner in Google Cloud project

Code example

val spanner = SpannerOptions.newBuilder()
    .setProjectId(projectName)
    .build()
    .service

Stack trace

com.google.cloud.spanner.SpannerException: UNKNOWN: Default config is invalid: Status{code=UNKNOWN, description=None of [grpclb] specified by Service Config are available., cause=null}
        at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerExceptionPreformatted(SpannerExceptionFactory.java:284)
        at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:61)
        at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:181)
        at com.google.cloud.spanner.SpannerExceptionFactory.newSpannerException(SpannerExceptionFactory.java:110)
        at com.google.cloud.spanner.spi.v1.GapicSpannerRpc.<init>(GapicSpannerRpc.java:517)
        at com.google.cloud.spanner.spi.v1.GapicSpannerRpc.<init>(GapicSpannerRpc.java:302)
        at com.google.cloud.spanner.SpannerOptions$DefaultSpannerRpcFactory.create(SpannerOptions.java:469)
        at com.google.cloud.spanner.SpannerOptions$DefaultSpannerRpcFactory.create(SpannerOptions.java:464)
        at com.google.cloud.ServiceOptions.getRpc(ServiceOptions.java:560)
        at com.google.cloud.spanner.SpannerOptions.getSpannerRpcV1(SpannerOptions.java:1320)
        at com.google.cloud.spanner.SpannerImpl.<init>(SpannerImpl.java:132)
        at com.google.cloud.spanner.SpannerOptions$DefaultSpannerFactory.create(SpannerOptions.java:459)
        at com.google.cloud.spanner.SpannerOptions$DefaultSpannerFactory.create(SpannerOptions.java:454)
        at com.google.cloud.ServiceOptions.getService(ServiceOptions.java:540)

...

Caused by: java.lang.IllegalStateException: Default config is invalid: Status{code=UNKNOWN, description=None of [grpclb] specified by Service Config are available., cause=null}
        at com.google.common.base.Preconditions.checkState(Preconditions.java:590)
        at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:676)
        at io.grpc.internal.ManagedChannelImplBuilder.build(ManagedChannelImplBuilder.java:630)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:297)
        at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createSingleChannel(InstantiatingGrpcChannelProvider.java:388)
        at com.google.api.gax.grpc.ChannelPool.<init>(ChannelPool.java:105)
        at com.google.api.gax.grpc.ChannelPool.create(ChannelPool.java:83)
        at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.createChannel(InstantiatingGrpcChannelProvider.java:236)
        at com.google.api.gax.grpc.InstantiatingGrpcChannelProvider.getTransportChannel(InstantiatingGrpcChannelProvider.java:230)
        at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:201)
        at com.google.cloud.spanner.v1.stub.GrpcSpannerStub.create(GrpcSpannerStub.java:231)
        at com.google.cloud.spanner.spi.v1.GapicSpannerRpc.<init>(GapicSpannerRpc.java:411)
        ... 32 more

Any additional information below

This seems to be a regression. It was working with google-cloud-spanner 3.0.3 and grpc-java 1.3.9.

@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label May 5, 2022
@SanjayVas
Copy link
Author

Just in case it's relevant, my project is built using Bazel and pulls in grpc-java as a repo dependency. This means that it's depending on grpc-java via source despite pulling google-cloud-spanner from Maven. See https://github.com/grpc/grpc-java/blob/v1.45.1/repositories.bzl.

@SanjayVas
Copy link
Author

Hacky workaround:

LoadBalancerRegistry.getDefaultRegistry().register(io.grpc.grpclb.GrpclbLoadBalancerProvider())

@SanjayVas
Copy link
Author

Looks like this might actually be a grpc-java issue. See grpc/grpc-java#9149.

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels May 6, 2022
@ansh0l
Copy link
Member

ansh0l commented May 23, 2022

@SanjayVas I see that the linked issue is resolved. Please reopen if you are still facing any issues

@ansh0l ansh0l closed this as completed May 23, 2022
@ansh0l ansh0l removed 🚨 This issue needs some love. triage me I really want to be triaged. labels May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API.
Projects
None yet
Development

No branches or pull requests

3 participants