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

Cannot invoke "java.util.Collection.size()" because "storageNodes" is null #29509

Closed
a601942905git opened this issue Dec 22, 2023 · 10 comments · Fixed by #29621
Closed

Cannot invoke "java.util.Collection.size()" because "storageNodes" is null #29509

a601942905git opened this issue Dec 22, 2023 · 10 comments · Fixed by #29621

Comments

@a601942905git
Copy link

Question

The following error occurs when shardingsphere integrates consul:Cannot invoke "java.util.Collection.size()" because "storageNodes" is null
config content:

mode:
  type: Cluster
  repository:
    type: consul
    props:
      namespace: governance_ds
      server-lists: localhost
      timeToLiveSeconds: 30
      blockQueryTimeToSeconds: 60

shardingsphere-jdbc-core version is:5.4.1
shardingsphere-cluster-mode-repository-consul version is:5.4.1

@RaigorJiang
Copy link
Contributor

Hi @a601942905git
Do you have configuration in consul, and how to reproduce this exception?

@a601942905git
Copy link
Author

What configuration do I need to add on consul

@a601942905git
Copy link
Author

Hi @a601942905git Do you have configuration in consul, and how to reproduce this exception?

Consul does not have any configuration. It can be started normally if it is replaced with zookeeper without adding configuration.

@a601942905git
Copy link
Author

@RaigorJiang you can see this method:org.apache.shardingsphere.mode.spi.PersistRepository#getChildrenKeys
zookeeper impl return empty collection
consul impl return null

@RaigorJiang
Copy link
Contributor

@RaigorJiang you can see this method:org.apache.shardingsphere.mode.spi.PersistRepository#getChildrenKeys zookeeper impl return empty collection consul impl return null

Hi @a601942905git , do you mean response.getValue() will be null?

image

@a601942905git
Copy link
Author

@RaigorJiang you can see this method:org.apache.shardingsphere.mode.spi.PersistRepository#getChildrenKeys zookeeper impl return empty collection consul impl return null

Hi @a601942905git , do you mean response.getValue() will be null?

image

yes

@RaigorJiang
Copy link
Contributor

Hi @a601942905git , do you mean response.getValue() will be null?
yes

In this case, we can judge response.getValue() first. Are you interested in submitting a PR?

@a601942905git
Copy link
Author

Hi @a601942905git , do you mean response.getValue() will be null?
yes

In this case, we can judge response.getValue() first. Are you interested in submitting a PR?

no

@linghengqian
Copy link
Member

linghengqian commented Jan 1, 2024

@linghengqian
Copy link
Member

  • Call the original implementer of the Consul integration @gavenpeng . Do you have time to deal with issues related to ConsulRepository.watch() failure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants