isoos/cassandart

Connection reset by peer.

Opened this issue · 6 comments

Hi, am playing with the driver, i first have fresh setup of 3 nodes cluster locally. Then i try the driver;

   final db = await Cluster.connect(
    ['192.168.1.7:9042'],
    authenticator: PasswordAuthenticator('cassandra', 'cassandra'),
  );

  print('Connected to our database');

  await Future.delayed(Duration(seconds: 5));
  await db.close();

i immediately get the following error.

Connected to our database
Unhandled exception:
SocketException: OS Error: Connection reset by peer, errno = 54, address = 192.168.1.7, port = 51986

using python driver with the same fresh setup after this error, it does not produce with python.

Any idea,
Thanks.

isoos commented

Maybe SSL?

@isoos am not using SSL, its disabled. its on my local dev machine.

isoos commented

Not sure. I had once an issue with a dockerized cassandra instance, but don't recall which distribution it was.
What's the full stacktrace? Can you debug the state around this code? (either in debug mode or printing some strings)

final socket = await Socket.connect(host, port);

The func did not through any error. But i noticed;
removing;
await Future.delayed(Duration(seconds: 5));
And stopping client does not through the error, not sure What is going on. Could it be the delay fucn, is freezing the connection, but does not make a sense.

isoos commented

I'm not sure. Did you try to execute a query or something else? We'll need more debug information (incl. versions used) or stacktraces...

shyaml commented

I gave a try and had the same connectivity issue .I replaced localhost with 127.0.0.1 and the db connect was successful . However I had another issue with the database query in the code I simply removed the code block and used a tool to connect and browse the db . The driver was able to create table tbl and data looks good