apache / cassandra-gocql-driver

GoCQL Driver for Apache Cassandra®
https://cassandra.apache.org/
Apache License 2.0
2.58k stars 621 forks source link

"panic: no valid connect address for host" when establishing a session #1769

Open john-m-liu opened 4 months ago

john-m-liu commented 4 months ago

Please answer these questions before submitting your issue. Thanks!

What version of Cassandra are you using?

Scylla version 4.6.3

What version of Gocql are you using?

v1.11.0

What version of Go are you using?

1.22.4

What did you do?

call gocql.CreateSession() to connect to my cluster

What did you expect to see?

no error

What did you see instead?

the following panic:

panic: no valid connect address for host: . Is your cluster configured correctly?


If you are having connectivity related issues please share the following additional information

Describe your Cassandra cluster

please provide the following information


On this line in host_source.go, nil is always being passed as the connection address param. That nil connection address will eventually get passed to here, which will panic.

To reproduce, I simply ran the hello world example in https://github.com/gocql/gocql/blob/master/example_test.go and get this panic if I'm on https://github.com/gocql/gocql/commit/f42e40c76c55a5d8b9a9032f1916c8cde79b7639 or later. The hello world test passes if I'm on a commit earlier than that.

I suspect that I'm missing something obvious because if this is in fact an issue, it should prevent all users from being able to connect with the driver yet I don't see any mention of this issue. I'm encountering this when upgrading the scylla fork of the driver in my app from a version that does not contain this commit to a version that does

OleksiienkoMykyta commented 1 day ago

@john-m-liu, as I understand from (https://github.com/scylladb/gocql/issues/191) the issue is on the user's side. Can we close the issue, if it doesn't persist?