question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BigtableSession should check for null credentials

See original GitHub issue

I am using the Bigtable emulator for development, which doesn’t require authentication so is configured with CredentialType.None. The CredentialFactory returns null when asked for credentials of this type: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/master/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/config/CredentialFactory.java#L138

BigtableSession uses this factory and does not check for null credentials, resulting in null being passed into createNettyChannel: https://github.com/GoogleCloudPlatform/cloud-bigtable-client/blob/master/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java#L470

This leads to failure with a NullPointerException:

Exception in thread "main" java.lang.NullPointerException: interceptor
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:787)
	at io.grpc.ClientInterceptors$InterceptorChannel.<init>(ClientInterceptors.java:113)
	at io.grpc.ClientInterceptors$InterceptorChannel.<init>(ClientInterceptors.java:107)
	at io.grpc.ClientInterceptors.intercept(ClientInterceptors.java:102)
	at io.grpc.internal.ManagedChannelImpl.<init>(ManagedChannelImpl.java:406)
	at io.grpc.internal.AbstractManagedChannelImplBuilder.build(AbstractManagedChannelImplBuilder.java:295)
	at com.google.cloud.bigtable.grpc.BigtableSession.createNettyChannel(BigtableSession.java:494)
	at com.google.cloud.bigtable.grpc.BigtableSession$5.create(BigtableSession.java:462)
	at com.google.cloud.bigtable.grpc.io.ChannelPool.<init>(ChannelPool.java:246)
	at com.google.cloud.bigtable.grpc.BigtableSession.createChannelPool(BigtableSession.java:458)
	at com.google.cloud.bigtable.grpc.BigtableSession.createChannelPool(BigtableSession.java:439)
	at com.google.cloud.bigtable.grpc.BigtableClusterUtilities.<init>(BigtableClusterUtilities.java:152)
	at com.google.cloud.bigtable.grpc.BigtableClusterUtilities.forAllInstances(BigtableClusterUtilities.java:69)
	at com.google.cloud.bigtable.grpc.BigtableClusterUtilities.lookupInstanceId(BigtableClusterUtilities.java:82)
	at com.google.cloud.bigtable.grpc.BigtableSession.resolveLegacyOptions(BigtableSession.java:278)
	at com.google.cloud.bigtable.grpc.BigtableSession.<init>(BigtableSession.java:205)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
sduskiscommented, May 15, 2018

We fixed this problem recently. This ought to be fixed once we release 1.4.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

BigtableSession should check for null credentials · Issue #1478
I am using the Bigtable emulator for development, which doesn't require authentication so is configured with CredentialType.None.
Read more >
BigtableSession (Cloud Bigtable HBase Client for Java 1.12.0 ...
This method allows users to override the default implementation with their own. Parameters: channelFactory - a ChannelPool.ChannelFactory object ...
Read more >
com.google.cloud.bigtable.config.CredentialOptions ... - Tabnine
Helper function that either returns the mock Bigtable service supplied by {@link * #withBigtableService} or creates and returns an implementation that talks ...
Read more >
BigtableOptions (Cloud Bigtable HBase Client for Java 1.8.0 ...
An immutable class providing access to configuration options for Bigtable. ... Returns: Null to indicate no credentials, otherwise, the Credentials object.
Read more >
redux - User credentials are null when using getSession() in ...
I'm trying to access the user credentials from the JWT & Session using callbacks import NextAuth from "next-auth/next"; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found